1

mpld3 is great to convert very quickly a matplotlib figure to an interactive HTML file, just one line of code is required:

  mpld3.save_html(fig,filename)

While bokeh requires rewriting the figure code with bokeh commands. However, mpld3 does not provide the very useful and basic tool "save" in addition to zoom and pan.

Has someone found a simple way of adding this tool?

pcu
  • 1,204
  • 11
  • 27
Arthur
  • 261
  • 3
  • 8
  • >the very useful and basic tool "save" in addition to zoom and pan. What do you mean by that? Look at [some examples](http://mpld3.github.io/examples/custom_plugin.html) of mpld3, they have zoom and pan (Down to the left is this). – Lucas Jan 09 '17 at 20:55
  • yes they have pan and zoom but no save option. I am talking about a save icon, like in bokeh or plotly – Arthur Jan 10 '17 at 21:41
  • I do not think I have that mpl3d. It occurs to me that you can use [BeautifulSoup](https://www.crummy.com/software/BeautifulSoup/bs4/doc/) to get the svg, and/or use something like [this](http://stackoverflow.com/a/6599172/5420829) to convert it to PNG. – Lucas Jan 10 '17 at 22:22
  • Thanks, but I would like just a simple tool so I can share an html file with non-coders, they can play with the interactive plot and then save it. But it seems like the answer is no. – Arthur Jan 11 '17 at 23:29

0 Answers0