Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi Tim,
Want to take a look at these? I kept it to just the bar and histogram plots so you could provide some feedback. The main issue several of these libraries have is no obvious way to generate an image and return that image into the notebook cell.
plotly
You can see some of the saga here, but there's no great way to get an image from
plotly.offline
. In the meantime I have a fork which lets me pass asave_img
parameter. On my local repo, I have it return anIPython.display.Image()
object so that the command is clean. You can see this isn't as nice for other libraries.I broke down and created an account and creds for using
py.image.ishow()
, but I only have a free account. In just setting this repo up I exceeded my 100 call limit runningmake
as there's 13 calls per run. It'd be nice to cache or something (or find a way to useoffline
).bokeh
You can export, but I don't know how you render the plot directly, as it returns a path.
altair
The documentation says there's no way to save programmatically. I created a
tmp_plots
dir to save to manually and usedalt_plot-type.png
for the filename.pygal
We can use
render_to_png
, but it returns somecairosvg.svg2png()
call which I can't find. I getNoneType
forvar = p.render_to_png(fname)
.Let me know if you ideas on a good route forward given the above. It would be nice if these web-based libs could just render in an
iframe
/be embedded. This is a lot of hoopla to get images when it's definitely not their native way and they'll end up on the web anyway :)