GithubHelp home page GithubHelp logo

saving layouts about plotly.py HOT 3 CLOSED

plotly avatar plotly commented on May 2, 2024
saving layouts

from plotly.py.

Comments (3)

theengineear avatar theengineear commented on May 2, 2024

This is definitely something that's on our radar. Currently, the 'iplot_mpl' and 'plot_mpl' both have support for 'updating' with whatever options you want. For instance, this might work for you:

# save the layout you want to use later
import json
my_layout = {'title': 'the title i always use'}
with open('my_layout.json', 'w') as f:
    json.dump(my_layout, f)

Now, if you want to use that again...

import matplotlib
import plotly.plotly as py
import json
# make an mpl figure
## do mpl stuff -> get your 'mpl_fig' variable

# load up that layout
with open('my_layout.json') as f:
    my_layout = json.load(f)

# use that to update mpl
py.iplot_mpl(mpl_fig, update={'layout':my_layout})

note that the value for the keyword 'update' must be a valid figure object in plotly

Not saying this is perfect, but I don't think we know what is quite yet. So until then, this is still in discussion mode.

Therefore, I think you already have access to do point (2), but your points (1) and (3) are still up in the air on our end.

This is great feedback, we'll definitely keep this dialogue open as this gets sorted out.

from plotly.py.

arsenovic avatar arsenovic commented on May 2, 2024

great! that addresses (2) perfectly. i must have missed the update option from the users guide.

here is a link to matplotlib style sheets, fyi,
https://github.com/matplotlib/matplotlib/blob/master/doc/users/style_sheets.rst
it would also be cool for plotly to [eventually] provide a set of styles, like ggplot, nyt, printable, journal, etc. i hate seeing time wasted on redundant styling.

by the way, the users guide has helped me enormously. i find the narrative-style docs are much easier to follow than the API-web style. and i love the way plotly is moving. the get_figure() provides a great cross-over workflow.

from plotly.py.

theengineear avatar theengineear commented on May 2, 2024

Awesome. This is great to hear! The team, i.e., @etpinard, has been putting a ton of effort into the user guides.

I've checked out the matplotlib styles. Setting defaults and overwriting them is definitely a valid solution to this problem. I think that matplotlib 1.4.x is supposed to push the style features even further.

We're still trying to figure out the best way to do something like get_style(get_figure("")) so that we see folks grabbing other's styles easily without the original user needing to put in too much effort into making some sort of default style...

I'm going to close this, but reopen it or open a new issue if there's something else to add.

Again, thanks for the feedback!

from plotly.py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.