Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Matplotlib: interactive plot on a web server

I'm currently using Open Flash Chart 2 on my django website, but I find it insufficiently customizable. (It's great when you want the usual barcharts, piecharts, but what about homemade shapes...). Although it's open source, I don't feel like diving in the Flex code.

I'm thinking a lot about matplotlib but the documentation is rather poor on web application developpment.

Does anybody uses matplotlib in his web app? I would appreciate links on those web sites to figure out what can be achieved. Thanks

like image 796
Mermoz Avatar asked Jul 28 '10 16:07

Mermoz


People also ask

Which library create interactive plot that can be embedded in Web browser?

mpld3 brings together Python's core plotting library matplotlib and the popular JavaScript charting library D3 to create browser-friendly visualizations. You can make a plot in matplotlib, add interactive functionality with plugins that utilize both Python and JavaScript, and then render it with D3.

How do I insert a Python graph into an HTML website?

Three steps are required to integrate a Python graph into an HTML Web site: generate the graph either in Plot.ly or Altair. save the graph as an HTML page. manipulate the generated HTML.


2 Answers

If you're looking for flash-like interactivity in a web application, matplotlib probably isn't what you're looking for. It's fine for rendering a static image to serve out in a web app, though. (and is amazingly flexible)

However, there's been a lot of recent development on making matplotlib more oriented toward web interactivity. Take a look at the new HTML5/Canvas backend. http://code.google.com/p/mplh5canvas/ It's not quite finished yet, but it's worth playing around with, anyway.

like image 72
Joe Kington Avatar answered Sep 30 '22 20:09

Joe Kington


You can use MPLD3 to export your existing matplotlib stuff to browser.
Matplotlib itself is very powerful, albeit, I agree the documentation is not very extensive.
I've learned it just by trying stuff out and finding examples on the net.
'matplotlib example X' where X is somewhat about what you are trying to plot find suprising amount of code on the net.

like image 39
Cyryl Płotnicki Avatar answered Sep 30 '22 18:09

Cyryl Płotnicki