|
From: John H. <jdh...@ac...> - 2005-06-15 14:04:32
|
>>>>> "Philippe" == Philippe Collet <phi...@ho...> writes:
Philippe> Hi list, I'm under windows XP SP2 using python 2.3.5,
Philippe> matplotlib 0.80 and pygtk 2.6.0. I'm trying to program
Philippe> a viewer of data using matplotlib. I want to be able to
Philippe> save end reuse current graphic context (figure, title,
There is some tutorial information on using OO mpl at
http://matplotlib.sourceforge.net/faq.html#OO
Philippe> axes, labels...). I decided to explore the matplotlib
Philippe> code. But I'm not sure how i can get the current
Philippe> figure.
Exploring the code is always a good way to start, as is reading the
class documentation for the classes you are working with, eg,
http://matplotlib.sourceforge.net/classdocs.html
Note that the concept of "the current figure" does not exist in the OO
API -- this is a pylab construct. You create a figure with
fig = Figure(args...)
and then it is your responsibility to save it and use it where you
want, eg in as a class variable
self.fig = Figure(args...)
Philippe> I want to be able to save the current graphic context,
Philippe> draw a figure, then reload other data and add them to
Philippe> the current figure already drawn.
Philippe> Has anyone done that before? John, can you explain me
Philippe> how to proceed?
This sounds eminently doable -- try writing some example code and if
you get stuck post the code and a description of what you are trying
to do and we can help out.
JDH
|