guillaume ranquet wrote: >> On Mon, May 18, 2009 at 10:23 AM, guillaume ranquet <granq...@wyplay.com> >> wrote: >>>> I'm trying to get approx 4k points plotted into 5 subplots which I would >>>> like interactive (ie: ability to zoom/pan ...). >>>> there's nothing special except that the subplots share axe x. >>>> >>>> >>>> It gets some seconds (3 to 5) on a p4 dual core @ 3Ghz to pan/zoom. It >>>> seems utterly slow to me: what do you think? normal "rate" or flawed code? >>>> I tried using various backend, embedding it into qt4 ... nothing helped >>>> much. >>>> >>>> the code is quite fat atm (500 lines or so). I'll try to cut through the >>>> code to get an example in a few lines if it's said my code is flawed and >>>> the plotting rate should be way faster! >> Instead of starting with your cod,e start from scratch and see if you >> can reproduce the problem. If not, figure out what is different and >> work your way up. Here is some test code -- note that Eric Firing >> made a contribution on the svn trunk that significantly speeds up this >> use case: >> >> import numpy as np >> import matplotlib.pyplot as plt >> fig = plt.figure() >> Nplots = 5 >> Npoints = 5000 >> for i in range(Nplots): >> if i==0: >> ax = ax1 = fig.add_subplot(Nplots,1,i+1) >> else: >> ax = fig.add_subplot(Nplots,1,i+1, sharex=ax1) >> >> ax.plot(np.random.rand(Npoints)) >> >> ax.set_xlim(100, 200) >> plt.show() > > > I think I put a finger on what breaks the performance, thx to your > snippet of code. > I forgot to mention that I'm using some axvlines here and there (500 per > subplot).
(That's quite a lot...) > it goes from slow to _unacceptably_ slow with the axvlines. > Yes, it is generating a lot of draw events. > I'm using the axvlines to mark some events that I need to know about in > order to have an explanation of the variations of the curves. > any advice on what to use to replace those? Possibilities include a LineCollection, or a single line with markers. I suspect a single line with masked points used to break it up into vertical segments would also work, although I don't know how fast it would be. The markers approach would be fastest, I suspect. Eric > ---- > This message contains confidential information and may contain information > that is legally privileged. If you have received this message by mistake, > please immediately notify us and delete the original message. Thank you. > > Ce message contient des informations confidentielles. S'il vous est parvenu > par erreur, merci de bien vouloir nous en aviser par retour, de n'en faire > aucun usage et de n'en garder aucune copie. > ---- > > ------------------------------------------------------------------------------ > Crystal Reports - New Free Runtime and 30 Day Trial > Check out the new simplified licensing option that enables > unlimited royalty-free distribution of the report engine > for externally facing server and web deployment. > http://p.sf.net/sfu/businessobjects > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users