Is there a way to create a plot and call show() so as not to use the main Qt loop?

In an Qt application I am extending, I display a list of thumbnails, selecting a thumbnail opens a plot window with the source of the thumbnail. I a newbie at all this but did manage to write a simple widget which embedded a matplotlib FigureCanvas. It appears that I also need to code the zoom to rectangle and save view functionality I like in the default plot window. I have no idea if this is easy or hard, so thought it may just be easier be able to reuse the default plotting window. When I show() a plot form within a Qt application I get the following message printed on the console:

QCoreApplication::exec: The event loop is already running

I think I understand the error, obviously the application I calling form control the even loop. I suppose I need to somehow supply a parent window to pylab plot or the show() function. Is there a way to create a plot and show so as not to use the main loop?

Thanks.

Brickle.

···

--

This may help you if I understand your basic problem. I use a lot of
interactive plots. This is an example of the work around to show() that I
use:

import matplotlib.pyplot as plt
plt.ion()
fig = plt.figure(figsize=(10,8))
ax = fig.add_axes([.15,.1,.8,.65])
ax.plot([1,2,3])
ax.set_title('Fisrt Plot')
raw_input('Enter to close and Continue: ')
plt.close(fig)

When I use this method when connecting to the axes I re-draw the figure
after updating using:
fig.canvas.draw()
I hope this was useful

Regards,
Bob

···

--
View this message in context: http://matplotlib.1069221.n5.nabble.com/Is-there-a-way-to-create-a-plot-and-call-show-so-as-not-to-use-the-main-Qt-loop-tp39653p39846.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

2012/11/4 Brickle Macho <bricklemacho@...287...>:

[...] When I show() a plot form within a Qt application I get the
following message printed on the console:

QCoreApplication::exec: The event loop is already running

I think I understand the error, obviously the application I calling form
control the even loop. I suppose I need to somehow supply a parent
window to pylab plot or the show() function. Is there a way to create
a plot and show so as not to use the main loop?

Do not use show() in a GUI application.
If you have a FigureCanvas instance embedded in your app, call its
draw() method.
If you use pyplot.figure() to create a matplotlib window from your
app, call pyplot.draw().

Goyo