Forum Archive

Bokeh, Matplotlib or Plotly?

chriswilson

I'm currently learning flask and hoping to make a web app that will pull user-selected data from a MySQL database.

Graphing the data would be great, and I have just discovered Bokeh and Plotly, both of which have Python APIs. I am not familiar (yet) with Matplotlib.

Has anyone any experience of using any of these options (particularly within Flask)?

JonB

matplotlib is fairly easy to work with, especially if you have any experience with matlab.
You get an image out using figure.savefig.

You would likely need to create a new figure for each user or connection.

Webmaster4o

None of the above. Rendering in the back-end is almost always a bad idea. Browsers are built to render content. By rendering images on your server, you're putting unnecessary load on your server, and sacrificing both interactivity and accessibility. Use http://chartjs.org/ instead.

chriswilson

@Webmaster4o Looks great! I'll check it out.

Webmaster4o

@chriswilson The advantage is that with a client-side library, you can do real-time animations, tooltips, and interaction. But you'll have to know a bit of JS to get through it (though JS isn't hard)

chriswilson

@Webmaster4o I'm starting to learn JS now, so hopefully it won't be a problem!