|
From: John H. <jdh...@ac...> - 2004-11-03 22:24:05
|
>>>>> "Jochen" == Jochen Voss <vo...@se...> writes:
Jochen> Hello, why is figure derived from the Artist class? This
Jochen> causes some special casing (figure is the only artist
Jochen> where artist.figure does not point to the figure).
Jochen> The the figure actually used as an Artist somewhere? What
Jochen> would break if it would not be derived from Artist?
In a couple of places - in the call to set_transform in
Figure._set_artist_props and when FigureCanvas calls
figure.draw(renderer). One could write a figure class that was not
derived form Artist, but I don't really see the benefit of changing
it. The Artist hierarchy are basically all the things that implement
draw(renderer). Of course in a dynamically typed language one doesn't
need to derive from Artist to implement draw(renderer), but it seems
conceptually cleaner to do so in this case -- plus I have already done
the Artist hierarchy in graphviz and included it in the users guide
:-)
It might also break some code which is relying on the Artist methods,
eg fig.get_transform (for people who want to add lines, text, etc in
fig coords). I doubt there are many such people, but it is a
possibility.
Jochen> I tried the patch
I didn't test this - did it pass backend_driver?
JDH
|