Closed kcpevey closed 3 years ago
If you have a handle to the object you want to plot (e.g. the polygons overlaid on a map, or whatever specific thing you want), you should be able to use the instructions in http://holoviews.org/user_guide/Plots_and_Renderers.html to render it to PNG. E.g.:
import holoviews as hv
hv.extension("bokeh")
curve = hv.Curve(range(10))
renderer=hv.renderer('bokeh')
renderer.save(curve.options(toolbar=None), '/tmp/test', fmt='png')
!open /tmp/test.png
In this case, you might have to do some work to get the specific object you want, possibly recreating just the bits you need in a subsequent cell.
Assigning this to myself to test Jim's suggestion
I think there's actually a simpler way now. @jlstevens?
There is now hv.save
which takes the object to export and some arguments. It has a decent docstring which explains how to use it...
I dug around on the interwebs and found some discussion on why this is challenging (admittedly didn't understand half of it). What I came up with was this command:
%%output fig='png' filename='foo'
If I'm using the drawing tools, that will grab the tables too. Is there another/better way to grab JUST the Drawing (preferably without the tool icons)?