-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
can't save to png with a BytesIO buffer #1381
Comments
Thanks for reporting this. Which Python version are you using? |
3.5.3 |
Thanks for reporting this, I think what's happening here is that you're trying to save a |
Probably not, I am new to holoviews. I'll post more details tomorrow. Thanks for being proactive! |
At the very least we should generate better exceptions when trying to export objects that might have trouble exporting. |
Hi, yes indeed I was creating a HoloMap and that was the problem. To give some context, I am implementing a Django website which will display some interactive plots and also export them as png or pdf. I am (was?) hoping to avoid coding the plots twice (in bokeh - for interactivity - and matplotlib - for exportation) using Holoviews as a frontend. I see now that rendering is quite different in both so I am not sure if that's worth it anymore. I take this opportunity to give some feedback on the documentation (if you're interested):
Not knowing where to ask this, why not here...
Any help much appreciated! |
Thanks for the detailed feedback, it's incredibly useful. I'll go through it step by step both to answer your questions and for us to figure out how to better document the various issues. The first three points would be well addressed by a tutorial about working with holoviews outside of the notebook and some documentation about working with renderers and plots. I've got a few drafts of this, which need tidying up but I think we should definitely try to get that done for 1.7.1.
Yes, you can get a handle on the plotting object using the Renderer. The easiest thing to do is this: bokeh_renderer = hv.Store.renderers['bokeh'].instance()
hvplot = bokeh_renderer.get_plot(hobj)
# You can now access the bokeh plot (or matplotlib figure by accessing hvplot.state)
hvplot.state
That's odd, definitely looks correct to me. I'll try it shortly.
What do you mean by this?
Yes, simply declare markers = hv.Cycle(values=['square', 'triangle', 'circle'])
hv.NdOverlay({i: hv.Points(np.random.rand(10,2)) for i in range(3)})(style={'Points': dict(marker=markers)}) |
To re-iterate what Philipp said, thanks for the feedback!
In that case, please add it to the issue with the 1.7.1 TODO list.
I think this means adding clickable links in the figure itself (e.g the figure title). I believe I've seen matplotlib examples of this in the past but haven't encountered this idea since. |
Thank you so much for these answers! I'll check them out asap. For the URL thing, I'd like to allow the user to click on a point / line / label to reach another page, as described here: |
Hi,
I'm trying to save a Holoviews figure to png, but I fall on a bug. In plotting.renderer.save, line 477 handles BytesIO as filename, but line 469 doesn't (tries to combine the filename with '.html':
self_or_cls.export_widgets(plot, basename+'.html', fmt)
).Holoviews version 1.7.0
The text was updated successfully, but these errors were encountered: