Qt backend

The real reason that I am working on Cairo and matplotlib is

    > that I want a portable way to display output from ATT's
    > graphviz. From my quick look through matplotlib's code, it
    > looks like this may be hard to do. So, if I continue this
    > project, I'll also be asking how to render ploygons,
    > ellipses, and text. Do you think that matplotlib is a good
    > fit given my requirements?

Without commenting on goodness of fit, I'll add that matplotlib has
fundamental elements for polygons (matplotlib.patches.Polygon) and
text (matplotlib.text.Text) and it would be straightforward to add a
dedicated ellipse class (currently we just use polygons for ellipses)
and Ted also has an interest in creating an ellipse class for scale
free renderering, eg in the postscript backend.


I've been doing some profiling using
'hotshotmain.py simple_plot.py -dAgg >/tmp/hs-out 2>&1'
(with the Tools/scripts/hotshotmain.py script from the Python src

I looked at the output and noticed that the pytz module takes up a fair
amount of the time. Which is a bit unexpected for simple_plot.py which
does not have any dates!
I commented out the 'dates' imports in pylab.py and axes.py and
performance increased 13%. It seemed strange for an import to have such
a large effect, but when I looked at dates.py I saw that it executes
code - it calls timezone() 9 times - a function which does further
imports which read in a lot of data.
If I restore the 'dates' imports and just comment out the 9 timezone()
calls in dates.py the speedup is 11% and it saves around 3,000 function

I suggest
- for optional modules (like dates), only import them when they are
required (when the plot actually has a date)
- for all modules try to minimise the amount of code that will execute
upon import, especially function calls.

What do you think?