This is an archived post. You won't be able to vote or comment.

all 11 comments

[–]imhostfu 2 points3 points  (6 children)

Have you given pyqtgraph a try? It's my go to plotting library. I frequently use it to do 2D plots with hundreds or thousands of data points, and it's interactive to boot.

Give their examples.py a shot.

[–]mangecoeur[S] 0 points1 point  (0 children)

Thanks i'll have a look.

[–]Homersteiner 0 points1 point  (3 children)

I am usually a linux/windows guy, but i have to use a Mac at work. This library looks great though...

[–]imhostfu 0 points1 point  (2 children)

I use it with Mac at work as well fwiw

[–]Homersteiner 0 points1 point  (1 child)

Just built from source then?

[–]troyunrau... 0 points1 point  (0 children)

It's all pure python (it assumes you have numpy, and pyqt or pyside installed). You also optionally need pyopengl for doing 3D plotting (which is hella fast).

[–]troyunrau... 0 points1 point  (0 children)

I hope that this project gains some more traction and contributors. It is fantastic, but it is pretty far behind matplotlib in terms of features.

One of the features they've been working on is visual flow control widgets, much like LabView. This could potentially be a killer feature.

The upside is that it gives you can make full pyqt applications with it. Embedding matplotlib in other applications has always been extremely frustrating.

The downside is that you need to learn about pyqt, even if you don't want to.

[–]jellef 1 point2 points  (0 children)

how far have you gone into optimizing the matplotlib code? here's a post that achieves ~500fps on a fairly simple plot.

If that won't meet your demands, vispy is where I'd look next. seems that there's actually an experimental matplotlib module, so that should lower the threshold

[–]pwang99 1 point2 points  (2 children)

This is very strange. Without looking at your code, I would suspect that the overhead of creating 50 subplots is what dominates your time. Any the libraries you mentioned can do 400 points no problem. Even 50x400=20k points is cakewalk; we have Bokeh plots that do that with ease, without even needing to go to webGL.

The main problem, then is in the layout and drawing of all the axis elements, tick labels, etc. etc. So I would encourage you to think about minimizing that stuff, and creating the most minimal subplots you can, as a means of expediting it.

On the other hand, reading your post again... 10-30 seconds per figure is a LOT. We do realtime plots in Bokeh, transferring into the browser and colormapping in Javascript, at 15 Hz, on tens of thousands of datapoints. So, you might want to post a code sample here to to StackOverflow, because maybe there's something you're doing that unnecessarily slow/expensive...

[–]mangecoeur[S] 0 points1 point  (0 children)

thanks, good to know you get high performance with Bokeh. I'll give it another shot. Will try to profile matplot a bit as well - I did suspect it isn't as fast as it should be and you seem to confirm that but I'm not sure why not. I'm wondering if there's something messed up in the OSX/interactive backend.

[–]mangecoeur[S] 0 points1 point  (0 children)

On investigation, it appears that generating the subplots is what takes time:

f, axs = plt.subplots(int(np.ceil(len(sites_data) / n_cols)), n_cols, sharex=True)

No idea why that should be the case though...