How to handle different Figures, created from different instances

Hallo,

I'm quite new to matplotlib and have a problem, I was searching a solution
for the whole day :frowning:

The thing is, I want to show different Figures at different states of my
main application.

So it is not possible for me, to perform the standard procedure, that may
looks like:

<code>
figure(1)
plot(bla)
figure(2)
plot(bla2)
show()
</code>

I have a method, in a class, that should be responsible for drawing a Figure
and its content; looks like that:

<code>
def drawFigure(self, el):
聽聽聽聽聽聽聽聽figure(self.__figure)
聽聽聽聽聽聽聽聽title(self.__headline)
聽聽聽聽聽聽聽
聽聽聽聽聽聽聽聽plot( el.getXValues(), el.getYValues(),str(el.getColor())+
str(el.getLineStyle())+str(el.getMarkerStyle()) )
聽聽聽聽聽聽聽聽show()

</code>

This method exists in several instances of that class, that are created at
different times

Let I run it this way, the 1st Figure window appears. When this method is
called a 2nd time, not 'Figure 2' appears, a window named 'Tk' appears.
It is safe that the figure(f) method gets a uniquie number at every time the
method is called.

I also tried to let all this run in separate threads, using python Threads,
but there was no success.

Please, can anybody tell me, if there is a solution, to call the show()
method more than one time,while my main script is running?

The reason why I want to have it this way is, that between different states,
some time is elapsing. In this time the user shall have the possibility to
watch the figures, and zoom and pan and so on. When the next state is
reached, the next Figure window shall appear, while the others are kept on
the screen.

Thanks, very much.

Regards,

Thomas

路路路

--
View this message in context: http://www.nabble.com/How-to-handle-different-Figures%2C-created-from-different-instances-tp17127297p17127297.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

To do this right, you will probably need to write a tk application and
embed matplotlib in it, rather than try to use pylab. See the
embedding_in_tk*.py examples at http://matplotlib.sf.net/examples/.
There is also a tutorial on working with the matplotlib artist API at
http://matplotlib.sf.net/pycon

  http://matplotlib.sourceforge.net/pycon/artist_api_tut.pdf

There are a couple of other FAQs that are relevant

  http://matplotlib.sf.net/faq.html#OO
  http://matplotlib.sf.net/faq.html#SHOW

JDH

路路路

On Thu, May 8, 2008 at 10:10 AM, dertom <twx1@...2007...> wrote:

Please, can anybody tell me, if there is a solution, to call the show()
method more than one time,while my main script is running?

Hallo,

thank you for this huge amount of input.
I think, that is what I needed.

Have a nice weekend.

Regards..

Thomas

John Hunter-4 wrote:

路路路

On Thu, May 8, 2008 at 10:10 AM, dertom <twx1@...2007...> wrote:

Please, can anybody tell me, if there is a solution, to call the show()
method more than one time,while my main script is running?

To do this right, you will probably need to write a tk application and
embed matplotlib in it, rather than try to use pylab. See the
embedding_in_tk*.py examples at http://matplotlib.sf.net/examples/.
There is also a tutorial on working with the matplotlib artist API at
http://matplotlib.sf.net/pycon

  http://matplotlib.sourceforge.net/pycon/artist_api_tut.pdf

There are a couple of other FAQs that are relevant

  http://matplotlib.sf.net/faq.html#OO
  http://matplotlib.sf.net/faq.html#SHOW

JDH

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

--
View this message in context: http://www.nabble.com/How-to-handle-different-Figures%2C-created-from-different-instances-tp17127297p17153058.html
Sent from the matplotlib - users mailing list archive at Nabble.com.