Matplotlib-users Digest, Vol 82, Issue 16

You likely need to "show()" the canvas. I usually do this by calling "fig.canvas.show()" before the for loop.
Since you are using a Qt4 backend the canvas used by the figure is a QWidget, the basic component of a Qt4 GUI. I don't know if there is a more matplotlib specific way of doing this, but when dealing with a larger system this is how I do it.

I would also add a sleep ("from time import sleep") of a couple seconds for testing to make sure you are getting through the entire for loop before you can see it.

Please CC in any replies, thanks.

-Dave

···

On 3/11/13 8:58 AM, ndbecker2@...287... wrote:

I want to update a plot in real time. I did some goog search, and saw various
answers. Trouble is, they aren't working.

Here's a typical example:

import matplotlib.pyplot as plt
import numpy as np
fig=plt.figure()
plt.axis([0,1000,0,1])

i=0
x=list()
y=list()

while i <1000:
     temp_y=np.random.random()
     x.append(i)
     y.append(temp_y)
     plt.scatter(i,temp_y)
     i+=1
     plt.draw()

If I run this, it draws nothing.

This is my matplotlibrc:
backend : Qt4Agg
mathtext.fontset: stix

Oops forgot to change the subject line.

···

On 3/11/13 9:34 AM, David Hoese wrote:

You likely need to "show()" the canvas. I usually do this by calling "fig.canvas.show()" before the for loop.
Since you are using a Qt4 backend the canvas used by the figure is a QWidget, the basic component of a Qt4 GUI. I don't know if there is a more matplotlib specific way of doing this, but when dealing with a larger system this is how I do it.

I would also add a sleep ("from time import sleep") of a couple seconds for testing to make sure you are getting through the entire for loop before you can see it.

Please CC in any replies, thanks.

-Dave

On 3/11/13 8:58 AM, ndbecker2@...287... wrote:

I want to update a plot in real time. I did some goog search, and saw various
answers. Trouble is, they aren't working.

Here's a typical example:

import matplotlib.pyplot as plt
import numpy as np
fig=plt.figure()
plt.axis([0,1000,0,1])

i=0
x=list()
y=list()

while i <1000:
     temp_y=np.random.random()
     x.append(i)
     y.append(temp_y)
     plt.scatter(i,temp_y)
     i+=1
     plt.draw()

If I run this, it draws nothing.

This is my matplotlibrc:
backend : Qt4Agg
mathtext.fontset: stix

I added fig.canvas.show(). It still does nothing.

If I add

mpl.use (‘GTK’), now it seems to be doing realtime plotting.

import matplotlib as mpl

import matplotlib.pyplot as plt

plt.ion()

import numpy as np

fig=plt.figure()

plt.axis([0,1000,0,1])

i=0

x=list()

y=list()

fig.canvas.show()

while i <1000:

temp_y=np.random.random()

x.append(i)

y.append(temp_y)

plt.scatter(i,temp_y)

i+=1

plt.draw()

···

On Mon, Mar 11, 2013 at 10:35 AM, David Hoese <dhoese@…287…> wrote:

Oops forgot to change the subject line.

On 3/11/13 9:34 AM, David Hoese wrote:

You likely need to “show()” the canvas. I usually do this by calling “fig.canvas.show()” before the for loop.

Since you are using a Qt4 backend the canvas used by the figure is a QWidget, the basic component of a Qt4 GUI. I don’t know if there is a more matplotlib specific way of doing this, but when dealing with a larger system this is how I do it.

I would also add a sleep (“from time import sleep”) of a couple seconds for testing to make sure you are getting through the entire for loop before you can see it.

Please CC in any replies, thanks.

-Dave

On 3/11/13 8:58 AM, ndbecker2@…287… wrote:

I want to update a plot in real time. I did some goog search, and saw various

answers. Trouble is, they aren’t working.

Here’s a typical example:

import matplotlib.pyplot as plt

import numpy as np

fig=plt.figure()

plt.axis([0,1000,0,1])

i=0

x=list()

y=list()

while i <1000:

 temp_y=np.random.random()

 x.append(i)

 y.append(temp_y)

 plt.scatter(i,temp_y)

 i+=1

 plt.draw()

If I run this, it draws nothing.

This is my matplotlibrc:

backend : Qt4Agg

mathtext.fontset: stix

Someone may have to correct me, but I think this has to do with the Qt4 event loop and it not being run properly. When you get into real time plotting it can get kind of tricky. In your case (I got the same results). I have made real-time PyQt4 GUIs before and have always used separate QThreads and Qt signals/slots to update the plot. I've never used GTK so I'm not sure why that worked vs Qt, I would think they would use similar principles but matplotlib does some magic behind the scenes sometimes. You can see different results if you comment out the while loop and import the module into your python/ipython interpreter. After doing this you'll see the figure pop up (you don't even need the fig.canvas.show() for this part if interactive mode is on. I went one step further and turned the while loop into a function:

def one_iter(i):
     # Contents of while loop

Calling this in the interpreter shows the figure updating after each call, but running in a loop (even with sleep) won't show any updates until the loop is done. In my opinion you have a few choices that really depend on your programming comfort level:

1. Don't make a real-time plot.
         Do you really need a real-time plot that updates from some external source?
2. Maybe you should look at the matplotlib animation functionality (http://matplotlib.org/api/animation_api.html). I like this tutorial: http://jakevdp.github.com/blog/2012/08/18/matplotlib-animation-tutorial/. This won't get you a real-time GUI exactly, but it can help if what you're doing isn't too complicated. It can also be nice for making videos of plot animations.
3. If you need a GUI with multiple plots and you need for future feature creep, I would research making PyQt4 GUIs, QThreads, Qt signals and slots, and putting matplotlib figures into a PyQt4 GUI. This is complex if you are not familiar with GUI programming and will take a while.

Sorry I couldn't be of more help, but it really depends on what exactly you are doing. Mainly, what do you mean by real-time? Do you really mean animation? Let me know what you come up with, I'm interested.

-Dave

P.S. Why use a while loop? You can do the same thing with:

     for i in range(1000):
         # Do stuff

···

On 3/11/13 10:34 AM, Neal Becker wrote:

I added fig.canvas.show(). It still does nothing.

If I add
mpl.use ('GTK'), now it seems to be doing realtime plotting.

import matplotlib as mpl

import matplotlib.pyplot as plt
plt.ion()
import numpy as np
fig=plt.figure()
plt.axis([0,1000,0,1])

i=0
x=list()
y=list()

fig.canvas.show()
while i <1000:
    temp_y=np.random.random()
    x.append(i)
    y.append(temp_y)
    plt.scatter(i,temp_y)
    i+=1
    plt.draw()

On Mon, Mar 11, 2013 at 10:35 AM, David Hoese <dhoese@...287... > <mailto:dhoese@…287…>> wrote:

    Oops forgot to change the subject line.

    On 3/11/13 9:34 AM, David Hoese wrote:

        You likely need to "show()" the canvas. I usually do this by
        calling "fig.canvas.show()" before the for loop.
        Since you are using a Qt4 backend the canvas used by the
        figure is a QWidget, the basic component of a Qt4 GUI. I don't
        know if there is a more matplotlib specific way of doing this,
        but when dealing with a larger system this is how I do it.

        I would also add a sleep ("from time import sleep") of a
        couple seconds for testing to make sure you are getting
        through the entire for loop before you can see it.

        Please CC in any replies, thanks.

        -Dave

        On 3/11/13 8:58 AM, ndbecker2@...287... > <mailto:ndbecker2@…287…> wrote:

            I want to update a plot in real time. I did some goog
            search, and saw various
            answers. Trouble is, they aren't working.

            Here's a typical example:

            import matplotlib.pyplot as plt
            import numpy as np
            fig=plt.figure()
            plt.axis([0,1000,0,1])

            i=0
            x=list()
            y=list()

            while i <1000:
                 temp_y=np.random.random()
                 x.append(i)
                 y.append(temp_y)
                 plt.scatter(i,temp_y)
                 i+=1
                 plt.draw()

            If I run this, it draws nothing.

            This is my matplotlibrc:
            backend : Qt4Agg
            mathtext.fontset: stix

I go through a compute loop that takes maybe a few seconds per pass, then plot a new point on the graph. Do I have to? No - I thought mpl was supposed to do this and wanted to learn how. If it really doesn’t work I’ll do something else.

I don’t think animation is correct here - I had the impression animation is where my update would be run as a callback, with a main loop that calls me periodically. Could that fit the model I described, where a lengthy computation produces a new value every few/10s of seconds?

···

On Mon, Mar 11, 2013 at 1:55 PM, David Hoese <dhoese@…287…> wrote:

  Someone may have to correct me, but I

think this has to do with the Qt4 event loop and it not being run
properly. When you get into real time plotting it can get kind of
tricky. In your case (I got the same results). I have made
real-time PyQt4 GUIs before and have always used separate QThreads
and Qt signals/slots to update the plot. I’ve never used GTK so
I’m not sure why that worked vs Qt, I would think they would use
similar principles but matplotlib does some magic behind the
scenes sometimes. You can see different results if you comment out
the while loop and import the module into your python/ipython
interpreter. After doing this you’ll see the figure pop up (you
don’t even need the fig.canvas.show() for this part if interactive
mode is on. I went one step further and turned the while loop into
a function:

  def one_iter(i):

      # Contents of while loop



  Calling this in the interpreter shows the figure updating after

each call, but running in a loop (even with sleep) won’t show any
updates until the loop is done. In my opinion you have a few
choices that really depend on your programming comfort level:

  1. Don't make a real-time plot.

          Do you really need a real-time plot that updates from some

external source?

  2. Maybe you should look at the matplotlib animation functionality

(http://matplotlib.org/api/animation_api.html ). I like this
tutorial:
http://jakevdp.github.com/blog/2012/08/18/matplotlib-animation-tutorial/ .
This won’t get you a real-time GUI exactly, but it can help if
what you’re doing isn’t too complicated. It can also be nice for
making videos of plot animations.

  3. If you need a GUI with multiple plots and you need for future

feature creep, I would research making PyQt4 GUIs, QThreads, Qt
signals and slots, and putting matplotlib figures into a PyQt4
GUI. This is complex if you are not familiar with GUI programming
and will take a while.

  Sorry I couldn't be of more help, but it really depends on what

exactly you are doing. Mainly, what do you mean by real-time? Do
you really mean animation? Let me know what you come up with, I’m
interested.

  -Dave



  P.S. Why use a while loop? You can do the same thing with:



      for i in range(1000):

          # Do stuff




  On 3/11/13 10:34 AM, Neal Becker wrote:

I added fig.canvas.show(). It still does nothing.

If I add

      mpl.use ('GTK'), now it seems to be doing realtime

plotting.

import matplotlib as mpl

import matplotlib.pyplot as plt

plt.ion()

import numpy as np

fig=plt.figure()

plt.axis([0,1000,0,1])

i=0

x=list()

y=list()

fig.canvas.show()

while i <1000:

temp_y=np.random.random()

x.append(i)

y.append(temp_y)

plt.scatter(i,temp_y)

i+=1

plt.draw()

      On Mon, Mar 11, 2013 at 10:35 AM, David

Hoese <dhoese@…287…>
wrote:

        Oops

forgot to change the subject line.

        On 3/11/13 9:34 AM, David Hoese wrote:
          You likely need to "show()" the canvas. I usually do this

by calling “fig.canvas.show()” before the for loop.

          Since you are using a Qt4 backend the canvas used by the

figure is a QWidget, the basic component of a Qt4 GUI. I
don’t know if there is a more matplotlib specific way of
doing this, but when dealing with a larger system this is
how I do it.

          I would also add a sleep ("from time import sleep") of a

couple seconds for testing to make sure you are getting
through the entire for loop before you can see it.

          Please CC in any replies, thanks.



          -Dave




            On 3/11/13 8:58 AM, ndbecker2@...287...
            wrote:
              I want to update a plot in real time.  I did some goog

search, and saw various

              answers.  Trouble is, they aren't working.



              Here's a typical example:



              import matplotlib.pyplot as plt

              import numpy as np

              fig=plt.figure()

              plt.axis([0,1000,0,1])



              i=0

              x=list()

              y=list()



              while i <1000:

                   temp_y=np.random.random()

                   x.append(i)

                   y.append(temp_y)

                   plt.scatter(i,temp_y)

                   i+=1

                   plt.draw()



              If I run this, it draws nothing.



              This is my matplotlibrc:

              backend : Qt4Agg

              mathtext.fontset: stix

I agree, I don't think that will work with mpl's animation stuff or at least I wouldn't want to do it that way. I've created GUIs that received data from a weather instrument in real-time. I did method 3 that I mentioned before because I knew the scientists using it were going to want more and more features.

...I FOUND A WAY FOR YOU TO CHEAT:
You can use the Qt "processEvents()" method to have it process drawing/painting operation between the event loop iterations. This method is frowned upon when doing real Qt GUIs, but eh go for it. If you aren't doing anything more serious than watching the output of your processing as it goes then try this:

import matplotlib

matplotlib.use('qt4agg')

import matplotlib as mpl

import matplotlib.pyplot as plt
plt.ion()
import numpy as np
from time import sleep
from PyQt4 import QtGui,QtCore
fig=plt.figure()
plt.axis([0,1000,0,1])

i=0
x=list()
y=list()

while i <1000:
     temp_y=np.random.random()
     x.append(i)
     y.append(temp_y)
     plt.scatter(i,temp_y)
     i+=1
     plt.draw()
     sleep(1)
     QtGui.qApp.processEvents()

Good luck,
Dave

···

On 3/11/13 12:59 PM, Neal Becker wrote:

I go through a compute loop that takes maybe a few seconds per pass, then plot a new point on the graph. Do I have to? No - I thought mpl was supposed to do this and wanted to learn how. If it really doesn't work I'll do something else.

I don't think animation is correct here - I had the impression animation is where my update would be run as a callback, with a main loop that calls me periodically. Could that fit the model I described, where a lengthy computation produces a new value every few/10s of seconds?

On Mon, Mar 11, 2013 at 1:55 PM, David Hoese <dhoese@...287... > <mailto:dhoese@…287…>> wrote:

    Someone may have to correct me, but I think this has to do with
    the Qt4 event loop and it not being run properly. When you get
    into real time plotting it can get kind of tricky. In your case (I
    got the same results). I have made real-time PyQt4 GUIs before and
    have always used separate QThreads and Qt signals/slots to update
    the plot. I've never used GTK so I'm not sure why that worked vs
    Qt, I would think they would use similar principles but matplotlib
    does some magic behind the scenes sometimes. You can see different
    results if you comment out the while loop and import the module
    into your python/ipython interpreter. After doing this you'll see
    the figure pop up (you don't even need the fig.canvas.show() for
    this part if interactive mode is on. I went one step further and
    turned the while loop into a function:

    def one_iter(i):
        # Contents of while loop

    Calling this in the interpreter shows the figure updating after
    each call, but running in a loop (even with sleep) won't show any
    updates until the loop is done. In my opinion you have a few
    choices that really depend on your programming comfort level:

    1. Don't make a real-time plot.
            Do you really need a real-time plot that updates from some
    external source?
    2. Maybe you should look at the matplotlib animation functionality
    (http://matplotlib.org/api/animation_api.html). I like this
    tutorial:
    http://jakevdp.github.com/blog/2012/08/18/matplotlib-animation-tutorial/.
    This won't get you a real-time GUI exactly, but it can help if
    what you're doing isn't too complicated. It can also be nice for
    making videos of plot animations.
    3. If you need a GUI with multiple plots and you need for future
    feature creep, I would research making PyQt4 GUIs, QThreads, Qt
    signals and slots, and putting matplotlib figures into a PyQt4
    GUI. This is complex if you are not familiar with GUI programming
    and will take a while.

    Sorry I couldn't be of more help, but it really depends on what
    exactly you are doing. Mainly, what do you mean by real-time? Do
    you really mean animation? Let me know what you come up with, I'm
    interested.

    -Dave

    P.S. Why use a while loop? You can do the same thing with:

        for i in range(1000):
            # Do stuff

    On 3/11/13 10:34 AM, Neal Becker wrote:

    I added fig.canvas.show(). It still does nothing.

    If I add
    mpl.use ('GTK'), now it seems to be doing realtime plotting.

    import matplotlib as mpl

    import matplotlib.pyplot as plt
    plt.ion()
    import numpy as np
    fig=plt.figure()
    plt.axis([0,1000,0,1])

    i=0
    x=list()
    y=list()

    fig.canvas.show()
    while i <1000:
        temp_y=np.random.random()
        x.append(i)
        y.append(temp_y)
        plt.scatter(i,temp_y)
        i+=1
        plt.draw()

    On Mon, Mar 11, 2013 at 10:35 AM, David Hoese <dhoese@...287... >> <mailto:dhoese@…287…>> wrote:

        Oops forgot to change the subject line.

        On 3/11/13 9:34 AM, David Hoese wrote:

            You likely need to "show()" the canvas. I usually do this
            by calling "fig.canvas.show()" before the for loop.
            Since you are using a Qt4 backend the canvas used by the
            figure is a QWidget, the basic component of a Qt4 GUI. I
            don't know if there is a more matplotlib specific way of
            doing this, but when dealing with a larger system this is
            how I do it.

            I would also add a sleep ("from time import sleep") of a
            couple seconds for testing to make sure you are getting
            through the entire for loop before you can see it.

            Please CC in any replies, thanks.

            -Dave

            On 3/11/13 8:58 AM, ndbecker2@...287... >> <mailto:ndbecker2@…287…> wrote:

                I want to update a plot in real time. I did some
                goog search, and saw various
                answers. Trouble is, they aren't working.

                Here's a typical example:

                import matplotlib.pyplot as plt
                import numpy as np
                fig=plt.figure()
                plt.axis([0,1000,0,1])

                i=0
                x=list()
                y=list()

                while i <1000:
                     temp_y=np.random.random()
                     x.append(i)
                     y.append(temp_y)
                     plt.scatter(i,temp_y)
                     i+=1
                     plt.draw()

                If I run this, it draws nothing.

                This is my matplotlibrc:
                backend : Qt4Agg
                mathtext.fontset: stix

If you are willing to use TkAgg, see the TSPlot class here:
https://econpy.googlecode.com/svn-history/r175/trunk/abm/gridworld/gridworld.py

Alan Isaac

···

On 3/11/2013 1:59 PM, Neal Becker wrote:

I go through a compute loop that takes maybe a few seconds per pass, then plot a new point on the graph.

Dear experts,

Is there a way to get back to the prompt after a plot is made and displayed with out closing the plot?

The objective is to compare to plots or check some aspect about the plot made from the loaded variables. This is the standard behavior of matlab after plotting we get the prompt and we can make another plot if we want to compare 2. I know there is subplot option but it will be of small size if I need to make a spatial map at to time intervals and compare. The detail of my
matplotlib is below

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

I use Ubuntu 12.04 64 bit version

and

In [3]: matplotlib.get_backend()

Out[3]: ‘WXAgg’

In [4]: matplotlib.version

Out[4]: ‘1.2.0’

with best regards,

Sudheer

···

Sudheer Joseph
Indian National Centre for Ocean Information Services
Ministry of Earth Sciences, Govt. of India
POST BOX NO: 21, IDA Jeedeemetla P.O.
Via Pragathi Nagar,Kukatpally, Hyderabad; Pin:5000 55
Tel:+91-40-23886047(O),Fax:+91-40-23895011(O),
Tel:+91-40-23044600®,Tel:+91-40-9440832534(Mobile)
E-mail:sjo.India@…287…;sudheer.joseph@…9…
Web- http://oppamthadathil.tripod.com



.

Hi Sudheer,

Try the interactive mode (http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.ion):

import matplotlib.pyplot as plt

plt.ion()
plt.plot(range(10))
[<matplotlib.lines.Line2D object at 0x1c565d0>]

a figure pops up here and hands you back the python command line

Regards,

···

On 12 March 2013 00:04, Sudheer Joseph <sudheer.joseph@…9…> wrote:

Dear experts,

Is there a way to get back to the prompt after a plot is made and displayed with out closing the plot?

The objective is to compare to plots or check some aspect about the plot made from the loaded variables. This is the standard behavior of matlab after plotting we get the prompt and we can make another plot if we want to compare 2. I know there is subplot option but it will be of small size if I need to make a spatial map at to time intervals and compare. The detail of my
matplotlib is below

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

I use Ubuntu 12.04 64 bit version

and

In [3]: matplotlib.get_backend()

Out[3]: ‘WXAgg’

In [4]: matplotlib.version

Out[4]: ‘1.2.0’

with best regards,

Sudheer


Sudheer Joseph
Indian National Centre for Ocean Information Services
Ministry of Earth Sciences, Govt. of India
POST BOX NO: 21, IDA Jeedeemetla P.O.

Via Pragathi Nagar,Kukatpally, Hyderabad; Pin:5000 55
Tel:+91-40-23886047(O),Fax:+91-40-23895011(O),

Tel:+91-40-23044600(R),Tel:+91-40-9440832534(Mobile)
E-mail:sjo.India@…1972…;sudheer.joseph@…9…

Web- http://oppamthadathil.tripod.com



.


Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester

Wave™: Endpoint Security, Q1 2013 and “remains a good choice” in the

endpoint security space. For insight on selecting the right partner to

tackle endpoint security challenges, access the full report.

http://p.sf.net/sfu/symantec-dev2dev


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Thank you Phil,

But I had tried it earlier after seeing a another mail thread. I get command prompt but no figure pops up.

In [3]: import matplotlib.pyplot as plt

In [4]: plt.ion()

In [5]: plt.plot(range(10))

Out[5]: [<matplotlib.lines.Line2D at
0x410f250>]

In [6]:

Any way out??

with best regards,

Sudheer

···

Sudheer Joseph
Indian National Centre for Ocean Information Services
Ministry of Earth Sciences, Govt. of India
POST BOX NO: 21, IDA Jeedeemetla P.O.
Via
Pragathi Nagar,Kukatpally, Hyderabad; Pin:5000 55
Tel:+91-40-23886047(O),Fax:+91-40-23895011(O),
Tel:+91-40-23044600(R),Tel:+91-40-9440832534(Mobile)
E-mail:sjo.India@…287…;sudheer.joseph@…9…
Web- http://oppamthadathil.tripod.com



From: Phil Elson <pelson.pub@…287…>
To: Sudheer Joseph <sudheer.joseph@…9…>
Cc:matplotlib-users@lists.sourceforge.net” <matplotlib-users@…2569…sourceforge.net>
Sent:
Tuesday, 12 March 2013 3:08 PM
Subject: Re: [Matplotlib-users] matplotlib multiple windows comparison

Hi Sudheer,

Try the interactive mode (http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.ion):

import matplotlib.pyplot as plt

plt.ion()
plt.plot(range(10))
[<matplotlib.lines.Line2D object at 0x1c565d0>]

a figure pops up here and hands you back the python command line

Regards,

On 12 March 2013 00:04, Sudheer Joseph <sudheer.joseph@…9…> wrote:

Dear experts,

Is there a way to get back to the prompt after a plot is made and displayed with out closing the plot?

The objective is to compare to plots or check some aspect about the plot made from the loaded variables. This is the standard behavior of matlab after plotting we get the prompt and we can make another plot if we want to compare 2. I know there is subplot option but it will be of small size if I need to make a spatial map at to time intervals and compare. The detail of my
matplotlib is below

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

I use Ubuntu 12.04 64 bit version

and

In [3]: matplotlib.get_backend()

Out[3]: ‘WXAgg’

In [4]: matplotlib.version

Out[4]: ‘1.2.0’

with best regards,

Sudheer


Sudheer Joseph
Indian National Centre for Ocean Information Services
Ministry of Earth Sciences, Govt. of India
POST BOX NO: 21, IDA Jeedeemetla P.O.

Via Pragathi Nagar,Kukatpally, Hyderabad; Pin:5000 55
Tel:+91-40-23886047(O),Fax:+91-40-23895011(O),

Tel:+91-40-23044600(R),Tel:+91-40-9440832534(Mobile)
E-mail:sjo.India@…287…;sudheer.joseph@…9…

Web- http://oppamthadathil.tripod.com



.


Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester

Wave™: Endpoint Security, Q1 2013 and “remains a good choice” in the

endpoint security space. For insight on selecting the right partner to

tackle endpoint security challenges, access the full report.

http://p.sf.net/sfu/symantec-dev2dev


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

I hadn’t spotted you were using the WxAgg backend too - this looks like the same bug that Brendan reported yesterday.

The easiest solution would be to use another back-end until this is fixed. Do you have ‘TkAgg’ available? I currently do not have a wx installation to hand to try out any workarounds at the moment.

Regards,

···

On 12 March 2013 14:00, Sudheer Joseph <sudheer.joseph@…9…> wrote:

Thank you Phil,

But I had tried it earlier after seeing a another mail thread. I get command prompt but no figure pops up.

In [3]: import matplotlib.pyplot as plt

In [4]: plt.ion()

In [5]: plt.plot(range(10))

Out[5]: [<matplotlib.lines.Line2D at
0x410f250>]

In [6]:

Any way out??

with best regards,

Sudheer


Sudheer Joseph
Indian National Centre for Ocean Information Services
Ministry of Earth Sciences, Govt. of India
POST BOX NO: 21, IDA Jeedeemetla P.O.

Via
Pragathi Nagar,Kukatpally, Hyderabad; Pin:5000 55
Tel:+91-40-23886047(O),Fax:+91-40-23895011(O),

Tel:+91-40-23044600(R),Tel:+91-40-9440832534(Mobile)
E-mail:sjo.India@…1972…;sudheer.joseph@…9…

Web- http://oppamthadathil.tripod.com



From: Phil Elson <pelson.pub@…287…>
To: Sudheer Joseph <sudheer.joseph@…1762…>
Cc:matplotlib-users@lists.sourceforge.net” <matplotlib-users@…2569…sourceforge.net>
Sent:
Tuesday, 12 March 2013 3:08 PM
Subject: Re: [Matplotlib-users] matplotlib multiple windows comparison

Hi Sudheer,

Try the interactive mode (http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.ion):

import matplotlib.pyplot as plt

plt.ion()
plt.plot(range(10))
[<matplotlib.lines.Line2D object at 0x1c565d0>]

a figure pops up here and hands you back the python command line

Regards,

On 12 March 2013 00:04, Sudheer Joseph <sudheer.joseph@…9…> wrote:

Dear experts,

Is there a way to get back to the prompt after a plot is made and displayed with out closing the plot?

The objective is to compare to plots or check some aspect about the plot made from the loaded variables. This is the standard behavior of matlab after plotting we get the prompt and we can make another plot if we want to compare 2. I know there is subplot option but it will be of small size if I need to make a spatial map at to time intervals and compare. The detail of my
matplotlib is below

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

I use Ubuntu 12.04 64 bit version

and

In [3]: matplotlib.get_backend()

Out[3]: ‘WXAgg’

In [4]: matplotlib.version

Out[4]: ‘1.2.0’

with best regards,

Sudheer


Sudheer Joseph
Indian National Centre for Ocean Information Services
Ministry of Earth Sciences, Govt. of India
POST BOX NO: 21, IDA Jeedeemetla P.O.

Via Pragathi Nagar,Kukatpally, Hyderabad; Pin:5000 55
Tel:+91-40-23886047(O),Fax:+91-40-23895011(O),

Tel:+91-40-23044600(R),Tel:+91-40-9440832534(Mobile)
E-mail:sjo.India@…287…;sudheer.joseph@…9…

Web- http://oppamthadathil.tripod.com



.


Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester

Wave™: Endpoint Security, Q1 2013 and “remains a good choice” in the

endpoint security space. For insight on selecting the right partner to

tackle endpoint security challenges, access the full report.

http://p.sf.net/sfu/symantec-dev2dev


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Thank You Phil,

It did it correctly. TkAgg is good with interactive plotting.

with best regards,

Sudheer

···

From: Phil Elson <pelson.pub@…287…>

To: Sudheer Joseph <sudheer.joseph@…9…>
Cc: “matplotlib-users@…1735…sourceforge.net” matplotlib-users@lists.sourceforge.net
Sent: Tuesday, 12 March 2013 7:53 PM
Subject: Re: [Matplotlib-users] matplotlib multiple windows comparison

I hadn’t spotted you were using the WxAgg backend too - this looks like the same bug that Brendan reported yesterday.

The easiest solution would be to use another back-end until this is fixed. Do you have ‘TkAgg’ available? I currently do not have a wx installation to hand to try out any workarounds at the moment.

Regards,

On 12 March 2013 14:00, Sudheer Joseph <sudheer.joseph@…9…> wrote:

Thank you Phil,

But I had tried it earlier after seeing a another mail thread. I get command prompt but no figure pops up.

In [3]: import matplotlib.pyplot as plt

In [4]: plt.ion()

In [5]: plt.plot(range(10))

Out[5]: [<matplotlib.lines.Line2D at
0x410f250>]

In [6]:

Any way out??

with best regards,

Sudheer


Sudheer Joseph
Indian National Centre for Ocean Information Services
Ministry of Earth Sciences, Govt. of India
POST BOX NO: 21, IDA Jeedeemetla P.O.

Via
Pragathi Nagar,Kukatpally, Hyderabad; Pin:5000 55
Tel:+91-40-23886047(O),Fax:+91-40-23895011(O),

Tel:+91-40-23044600(R),Tel:+91-40-9440832534(Mobile)
E-mail:sjo.India@…287…;sudheer.joseph@…9…

Web- http://oppamthadathil.tripod.com



From: Phil Elson <pelson.pub@…287…>
To: Sudheer Joseph <sudheer.joseph@…9…>
Cc: “matplotlib-users@…642…ts.sourceforge.net” matplotlib-users@lists.sourceforge.net
Sent:
Tuesday, 12 March 2013 3:08 PM
Subject: Re: [Matplotlib-users] matplotlib multiple windows comparison

Hi Sudheer,

Try the interactive mode (http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.ion):

import matplotlib.pyplot as plt

plt.ion()
plt.plot(range(10))
[<matplotlib.lines.Line2D object at 0x1c565d0>]

a figure pops up here and hands you back the python command line

Regards,

On 12 March 2013 00:04, Sudheer Joseph <sudheer.joseph@…9…> wrote:

Dear experts,

Is there a way to get back to the prompt after a plot is made and displayed with out closing the plot?

The objective is to compare to plots or check some aspect about the plot made from the loaded variables. This is the standard behavior of matlab after plotting we get the prompt and we can make another plot if we want to compare 2. I know there is subplot option but it will be of small size if I need to make a spatial map at to time intervals and compare. The detail of my
matplotlib is below

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

I use Ubuntu 12.04 64 bit version

and

In [3]: matplotlib.get_backend()

Out[3]: ‘WXAgg’

In [4]: matplotlib.version

Out[4]: ‘1.2.0’

with best regards,

Sudheer


Sudheer Joseph
Indian National Centre for Ocean Information Services
Ministry of Earth Sciences, Govt. of India
POST BOX NO: 21, IDA Jeedeemetla P.O.

Via Pragathi Nagar,Kukatpally, Hyderabad; Pin:5000 55
Tel:+91-40-23886047(O),Fax:+91-40-23895011(O),

Tel:+91-40-23044600(R),Tel:+91-40-9440832534(Mobile)
E-mail:sjo.India@…287…;sudheer.joseph@…9…

Web- http://oppamthadathil.tripod.com



.


Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester

Wave™: Endpoint Security, Q1 2013 and “remains a good choice” in the

endpoint security space. For insight on selecting the right partner to

tackle endpoint security challenges, access the full report.

http://p.sf.net/sfu/symantec-dev2dev


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users