Showing the plot in the specific location

How can I show my plot figure in the specific location or part of an
application , I am using pylab.

···

--
View this message in context: http://www.nabble.com/Showing-the-plot-in-the-specific-location-tp15545079p15545079.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

What kind of application are you writing -- are you using a GUI
toolkit like Tkinter? We need more details please. It is not very
clear from your question what you want to do, or what the current
problem is.

If indeed you are writing a GUI applicaiton, you will need to follow
the examples/embedding_in_your_gui_toolkit*.py examples in the
matplotlib src distribution rather than pylab.

JDH

···

On Feb 18, 2008 7:07 AM, sa6113 <s.payandeh@...287...> wrote:

How can I show my plot figure in the specific location or part of an
application , I am using pylab.

I am writting an application that evaluate curve fit and draw its plot in a
GUI , I want to draw or show the plot on the GUI not on the pop up window,
but I don't want to save the figure in first step , user just enter an order
for the curve fit and see their plots on the main window (GUI) .
How can I use pylab for this purpose , does it return and QImage object for
exm. ?

sa6113 wrote:

···

How can I show my plot figure in the specific location or part of an
application , I am using pylab.

--
View this message in context: http://www.nabble.com/Showing-the-plot-in-the-specific-location-tp15545079p15553192.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

I am writting an application that evaluate curve fit and draw its plot in a
GUI , I want to draw or show the plot on the GUI not on the pop up window,
but I don't want to save the figure in first step , user just enter an order
for the curve fit and see their plots on the main window (GUI) .
How can I use pylab for this purpose , does it return and QImage object for
exm. ?

sa6113 wrote:

···

How can I show my plot figure in the specific location or part of an
application , I am using pylab.

--
View this message in context: http://www.nabble.com/Showing-the-plot-in-the-specific-location-tp15545079p15560493.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

I believe John already told you this: do NOT use pylab.

See <URL:http://matplotlib.sourceforge.net/leftwich_tut.txt>
and the other resources that have been posted on this list.

Cheers,
Alan Isaac

···

On Mon, 18 Feb 2008, apparently wrote:

I am writting an application that evaluate curve fit and
draw its plot in a GUI , I want to draw or show the plot
on the GUI not on the pop up window, but I don't want to
save the figure in first step , user just enter an order
for the curve fit and see their plots on the main window
(GUI) . How can I use pylab for this purpose , does it
return and QImage object for exm. ?

In addition to the tutorial Alan pointed out to you, take a look at

http://matplotlib.sourceforge.net/examples/embedding_in_qt.py
http://matplotlib.sourceforge.net/examples/embedding_in_qt4.py

and

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

JDH

···

On Feb 19, 2008 3:32 AM, sa6113 <s.payandeh@...287...> wrote:

I am writting an application that evaluate curve fit and draw its plot in a
GUI , I want to draw or show the plot on the GUI not on the pop up window,
but I don't want to save the figure in first step , user just enter an order
for the curve fit and see their plots on the main window (GUI) .
How can I use pylab for this purpose , does it return and QImage object for
exm. ?

I could return the output object of the plot as image file , would you please
tell me how I have to convert image to QImage in order to use it in my GUI ?

sa6113 wrote:

···

How can I show my plot figure in the specific location or part of an
application , I am using pylab.

--
View this message in context: http://www.nabble.com/Showing-the-plot-in-the-specific-location-tp15545079p15648399.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

I could, but this is a very poor way to do it. First, you would not
be able to interact with your figure (pan, zoom, etc). 2nd, you would
be using qimage to rescale your plot with the embedded window size an
this would be far inferior to having matplotlib draw into the
requested size. The right way to use this is to follow the example of
http://matplotlib.sourceforge.net/examples/embedding_in_qt4.py

JDH

···

On Fri, Feb 22, 2008 at 11:04 PM, sa6113 <s.payandeh@...287...> wrote:

I could return the output object of the plot as image file , would you please
tell me how I have to convert image to QImage in order to use it in my GUI ?

Yes, please follow the example John pointed out. The qt4agg backend already
provides a widget that you can embed in your program, an example is in
embedding_in_qt4.py, it does the conversion to a QImage already, you dont
need to reimplement it.

···

On Saturday 23 February 2008 10:49:25 am John Hunter wrote:

On Fri, Feb 22, 2008 at 11:04 PM, sa6113 <s.payandeh@...287...> wrote:
> I could return the output object of the plot as image file , would you
> please tell me how I have to convert image to QImage in order to use it
> in my GUI ?

I could, but this is a very poor way to do it. First, you would not
be able to interact with your figure (pan, zoom, etc). 2nd, you would
be using qimage to rescale your plot with the embedded window size an
this would be far inferior to having matplotlib draw into the
requested size. The right way to use this is to follow the example of
http://matplotlib.sourceforge.net/examples/embedding_in_qt4.py