From: John H. <jdh...@ac...> - 2005-04-04 16:09:01
|
>>>>> "Matt" == Matt Newville <new...@ca...> writes: Matt> I like Darren's and Paul's suggestion (set line properties Matt> once, then have the ticks be a simple list of pen up / pen Matt> down). I believe major and minor ticks would need to have Matt> different properties, but it's still only 2 set of Matt> properties. I understand that this might mean a significant Matt> redesign, but the performance boost might be worth it. I would bet dollars to doughnuts (careful here, Perry still owes me a doughnut!) that almost all of the tick cost comes from laying out the text of the ticks and not in drawing the tick lines themselves -- Arnd posted some hotshot profile of this earlier, but I don't remember the exact results). I agree ticks (and text in general) are too expensive. In my experience, this is usually only starts a problem in animated plots (do you have another use case in mind?). I think we might be able to work around this particular problem by supporting the drawing of only a subset of the artists in the scene. I imagine something like the following is workable. line, = ax.plot(blah) dynamic = (line,) # a list of artists to animate # draws everything but artists in dynamic and caches Axes bbox to bitmap ax.animate_prepare( dynamic) while 1: line.set_data(blah) # blits the axes background cache and renders only the artists in dynamic ax.animate() I'm not opposed to a redesign of the Tick drawing if there are appreciable gains to be had, but my guess is we may get more bang for the buck in special casing the typical text layout (angle=0.0, no mathtext, no unicode) and handling dynamic updates more intelligently. JDH |