-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
saving layouts #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
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 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. |
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, 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. |
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 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! |
is there any infrastructure to save and re-use layouts? couple things that would be nice
change my default layout
pass layout as argument to
mpl_to_plotly
,iplot_mpl
,plot_mpl
have style files (like matplotlib.style)
from plotly import style
with style.context('ieeetrans'):
py.iplot(....)
The text was updated successfully, but these errors were encountered: