I like Darren's and Paul's suggestion (set line properties
> once, then have the ticks be a simple list of pen up / pen
> down). I believe major and minor ticks would need to have
> different properties, but it's still only 2 set of
> properties. I understand that this might mean a significant
> 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
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
# blits the axes background cache and renders only the artists in dynamic
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.