problems returning to main program after ploting a figure

Hi,
I am using matplotlib to create a figure in a pythonCard script that looks
like this
    
def on_button_mouseClick(self, event):
        import matplotlib.pyplot as plt
        
        plt.figure(1)
        for point in list:
            plt.plot([x],[y],'bo')
        plt.title('Water balance %10s' % Gew_Name[0])
        plt.xlabel('Station in km')
        plt.ylabel('Flux in L/s')
        plt.show()
        
        plt.clf()
        
My problem is that the program will not continue after that. I tried to look
for commands to delete the figure but clf() was all I found. I am working
with windows xp and the idle shell. To close idle is the only thing that
helps. I intended to produce some more figures after the script has
calculated balances for a stream network. As you might have noticed, I am
not a python expert so please excuse my humpy description of the problem.
Thanks,
Florian

···

--
View this message in context: http://www.nabble.com/problems-returning-to-main-program-after-ploting-a-figure-tp21292503p21292503.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

It looks like you are trying to use pyplot is an embedded GUI and you
might be better off trying to "embed" mpl in the GUI following the
examples at

  http://matplotlib.sourceforge.net/examples/user_interfaces/index.html

See also:

http://matplotlib.sourceforge.net/faq/usage_faq.html#matplotlib-pylab-and-pyplot-how-are-they-related
http://matplotlib.sourceforge.net/faq/howto_faq.html#use-show
http://matplotlib.sourceforge.net/faq/installing_faq.html#id1

JDH

···

On Mon, Jan 5, 2009 at 9:00 AM, flo_wer <werner@...2436...> wrote:

Hi,
I am using matplotlib to create a figure in a pythonCard script that looks
like this

def on_button_mouseClick(self, event):
       import matplotlib.pyplot as plt

       plt.figure(1)
       for point in list:
           plt.plot([x],[y],'bo')
       plt.title('Water balance %10s' % Gew_Name[0])
       plt.xlabel('Station in km')
       plt.ylabel('Flux in L/s')
       plt.show()

       plt.clf()

My problem is that the program will not continue after that. I tried to look
for commands to delete the figure but clf() was all I found. I am working
with windows xp and the idle shell. To close idle is the only thing that
helps. I intended to produce some more figures after the script has
calculated balances for a stream network. As you might have noticed, I am
not a python expert so please excuse my humpy description of the problem.

It looks like you are trying to use pyplot is an embedded GUI and you
might be better off trying to "embed" mpl in the GUI following the
examples at...

You were right about that. Thanks for the refererences. it helped a lot. The
code is a bit longer now and contains parts from the examples that are hard
for me to fully understand, but it works!!

Florian

···

--
View this message in context: http://www.nabble.com/problems-returning-to-main-program-after-ploting-a-figure-tp21292503p21294467.html
Sent from the matplotlib - users mailing list archive at Nabble.com.