Verifying the Use of show()? Win XP

I'm sure not making much progress on understanding show(). When used in XP in IDLE or by file execution (click on file name), it seems to tie up the executing program. In IDLE, the shell window stops and one must exit the window.

I'd appreciate it if someone could take any examples from <http://matplotlib.sourceforge.net/index.html> and try to execute them as in the first paragraph to see if they terminate successfully.Let me know what OS used, hopefully XP, and if you used IDLE or file execution. I suspect you will find every example there ends with show(). Try putting a print statement after show() you've done it with the show() the last line.

···

--
"Crime is way down. War is declining. And that's far from the good news." -- Steven Pinker (and other sources) Why is this true, but yet the media says otherwise? The media knows very well how to manipulate us (see limbic, emotion, $$). -- WTW

Version of Python would help too. I'm using 2.5.

···

On 2/9/2010 8:06 AM, Wayne Watson wrote:

I'm sure not making much progress on understanding show(). When used in
XP in IDLE or by file execution (click on file name), it seems to tie up
the executing program. In IDLE, the shell window stops and one must
exit the window.

I'd appreciate it if someone could take any examples from
<http://matplotlib.sourceforge.net/index.html&gt; and try to execute them
as in the first paragraph to see if they terminate successfully.Let me
know what OS used, hopefully XP, and if you used IDLE or file execution.
I suspect you will find every example there ends with show(). Try
putting a print statement after show() you've done it with the show()
the last line.
   
--
"Crime is way down. War is declining. And that's far from the good news." -- Steven Pinker (and other sources) Why is this true, but yet the media says otherwise? The media knows very well how to manipulate us (see limbic, emotion, $$). -- WTW

"show" is meant to start the GUI mainloop, which is usually blocking,
and raise all windows, so the behavior you are reporting is the
intended behavior. When working interactively, as in Idle, you
shouldn't need to use show if you turn interactive mode on.

  http://matplotlib.sourceforge.net/users/shell.html

We recommend using ipython in pylab model when working interactively
because it is designed to make the correct interactive settings and
override "show" to be non-blocking. You can obtain the right results
in matplotlib using Idle if you are careful, but for "just works out
of the box" ipython in pylab mode will be easier.

JDH

···

On Tue, Feb 9, 2010 at 10:06 AM, Wayne Watson <sierra_mtnview@...209...> wrote:

I'm sure not making much progress on understanding show(). When used in
XP in IDLE or by file execution (click on file name), it seems to tie up
the executing program. In IDLE, the shell window stops and one must
exit the window.

I'd appreciate it if someone could take any examples from
<http://matplotlib.sourceforge.net/index.html&gt; and try to execute them
as in the first paragraph to see if they terminate successfully.Let me
know what OS used, hopefully XP, and if you used IDLE or file execution.
I suspect you will find every example there ends with show(). Try
putting a print statement after show() you've done it with the show()
the last line.

Maybe instead of plot.show() you should do something like:

plot.draw()
raw_input('Press ENTER to exit')

Personally, I also use IDLE on Windows XP to edit my matplotlib files. However, I never execute in IDLE. I simply double click the file in windows explorer.

-Ben

···

-----Original Message-----
From: Wayne Watson [mailto:sierra_mtnview@…209…]
Sent: Tuesday, February 09, 2010 11:07 AM
To: matplotlib-users@lists.sourceforge.net
Subject: [Matplotlib-users] Verifying the Use of show()? Win XP

I'm sure not making much progress on understanding show(). When used in XP in IDLE or by file execution (click on file name), it seems to tie up the executing program. In IDLE, the shell window stops and one must exit the window.

I'd appreciate it if someone could take any examples from <http://matplotlib.sourceforge.net/index.html> and try to execute them as in the first paragraph to see if they terminate successfully.Let me know what OS used, hopefully XP, and if you used IDLE or file execution.
I suspect you will find every example there ends with show(). Try putting a print statement after show() you've done it with the show() the last line.
--
"Crime is way down. War is declining. And that's far from the good news." -- Steven Pinker (and other sources) Why is this true, but yet the media says otherwise? The media knows very well how to manipulate us (see limbic, emotion, $$). -- WTW

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Thanks for the clarification. I'm really new to this, and do not know of interactive mode. I presume there's a command to turn it off and on, and possibly an example on how to do it. Is this method of operation with show() mentioned anywhere?

The unfortunate present use of show() is that it ties up the shell script, where I happened to have written program output. It's handy to put it there, since it's meant to be interactive. The user is keyboard arrowing through images, and statistical data is placed on the shell window. At the same time he sees a plot of data relevant to the image. He needs to close the plot window before going to the next image. I can probably figure out how to kill the plot window when he does that.

My problem with using ipython is that the program I'm modifying is used with IDLE, and people have gotten to use it that way. I had nothing to do with that method of op. I doubt any of the users would be agreeable to using ipython. None of them know Python. The next time the program is released, I may provide it in executable form.

I used matlab five years ago, for about two months. To see if it could help me understand MPL, I fired it up, and it's now working. Perhaps the interactive op is explained there. I take it there is no show() there?

Interesting mention of "non-blocking". In the midst of this dilemma, I started getting socket errors. Using McAffe I found pythonw as blocked. Would that be in anyway associated with the use of show()? I've since changed it to outbound blocking.

...

···

On 2/9/2010 8:18 AM, John Hunter wrote:

On Tue, Feb 9, 2010 at 10:06 AM, Wayne Watson > <sierra_mtnview@...209...> wrote:

the last line.

"show" is meant to start the GUI mainloop, which is usually blocking,
and raise all windows, so the behavior you are reporting is the
intended behavior. When working interactively, as in Idle, you
shouldn't need to use show if you turn interactive mode on.

   http://matplotlib.sourceforge.net/users/shell.html

We recommend using ipython in pylab model when working interactively
because it is designed to make the correct interactive settings and
override "show" to be non-blocking. You can obtain the right results
in matplotlib using Idle if you are careful, but for "just works out
of the box" ipython in pylab mode will be easier.

JDH

--
"Crime is way down. War is declining. And that's far from the good news." -- Steven Pinker (and other sources) Why is this true, but yet the media says otherwise? The media knows very well how to manipulate us (see limbic, emotion, $$). -- WTW

Thanks. I'll consider it. See my post to John Hunter moments ago as to why I "must" use IDLE. Basically, the users are not at all familiar with Python, and historically the us has been that way for 3-4 years.

···

On 2/9/2010 8:20 AM, Ben Axelrod wrote:

Maybe instead of plot.show() you should do something like:

plot.draw()
raw_input('Press ENTER to exit')

Personally, I also use IDLE on Windows XP to edit my matplotlib files. However, I never execute in IDLE. I simply double click the file in windows explorer.

-Ben

-----Original Message-----
From: Wayne Watson [mailto:sierra_mtnview@…209…]
Sent: Tuesday, February 09, 2010 11:07 AM
To: matplotlib-users@lists.sourceforge.net
Subject: [Matplotlib-users] Verifying the Use of show()? Win XP

I'm sure not making much progress on understanding show(). When used in XP in IDLE or by file execution (click on file name), it seems to tie up the executing program. In IDLE, the shell window stops and one must exit the window.

I'd appreciate it if someone could take any examples from<http://matplotlib.sourceforge.net/index.html&gt; and try to execute them as in the first paragraph to see if they terminate successfully.Let me know what OS used, hopefully XP, and if you used IDLE or file execution.
I suspect you will find every example there ends with show(). Try putting a print statement after show() you've done it with the show() the last line.
--
"Crime is way down. War is declining. And that's far from the good news." -- Steven Pinker (and other sources) Why is this true, but yet the media says otherwise? The media knows very well how to manipulate us (see limbic, emotion, $$). -- WTW

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

--
"Crime is way down. War is declining. And that's far from the good news." -- Steven Pinker (and other sources) Why is this true, but yet the media says otherwise? The media knows very well how to manipulate us (see limbic, emotion, $$). -- WTW

Yes, on the documentation link I referred you to.

JDH

···

On Tue, Feb 9, 2010 at 11:36 AM, Wayne Watson <sierra_mtnview@...209...> wrote:

Thanks for the clarification. I'm really new to this, and do not know of
interactive mode. I presume there's a command to turn it off and on, and
possibly an example on how to do it. Is this method of operation with
show() mentioned anywhere?

Thanks. Completely missed it. (P.S. Reply All +corrected mail filter.)

I'm sure not making much progress on understanding show(). When used in
XP in IDLE or by file execution (click on file name), it seems to tie up
the executing program. In IDLE, the shell window stops and one must
     

...

···

On 2/9/2010 8:18 AM, John Hunter wrote:

On Tue, Feb 9, 2010 at 10:06 AM, Wayne Watson > <sierra_mtnview@...209...> wrote:
   http://matplotlib.sourceforge.net/users/shell.html

We recommend using ipython in pylab model when working interactively
because it is designed to make the correct interactive settings and
override "show" to be non-blocking. You can obtain the right results
in matplotlib using Idle if you are careful, but for "just works out
of the box" ipython in pylab mode will be easier.

JDH

--
"Crime is way down. War is declining. And that's far from the good news." -- Steven Pinker (and other sources) Why is this true, but yet the media says otherwise? The media knows very well how to manipulate us (see limbic, emotion, $$). -- WTW

Hi everyone,

This has been brought up before, but not completely addressed. Is it possible to get the text in a Legend to match the rest of the text when using LateX? Here is an example of the problem:

import matplotlib as mpl
mpl.rcParams['text.usetex'] = True
import matplotlib.pyplot as plt

fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot([1,5,2,3]) # random data
plt.figlegend(ax.lines,[r'$\rm{label}$ label'],loc='upper left')
plt.show()

The first word is at least in a roman font, but the font size is wrong. I am using svn revision 8005 with gtkagg backend on linux, and confirm the behavior with 0.99.0 with tkagg on OS X.

Thanks,
Jeff

Jeff,

I send all of my figures through LaTeX and don't have this problem. The only thing I can think of is to check your matplotlibrc file and make sure you've set the legend font to be the same size as the other fonts.

HTH,
-paul h.

···

-----Original Message-----
From: Jeffrey Blackburne [mailto:jeffb@…1165…]
Sent: Wednesday, February 10, 2010 9:45 AM
To: matplotlib-users@lists.sourceforge.net
Subject: [Matplotlib-users] LateX Legend (again)

Hi everyone,

This has been brought up before, but not completely addressed. Is it
possible to get the text in a Legend to match the rest of the text
when using LateX? Here is an example of the problem:

import matplotlib as mpl
mpl.rcParams['text.usetex'] = True
import matplotlib.pyplot as plt

fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot([1,5,2,3]) # random data
plt.figlegend(ax.lines,[r'\\rm\{label\} label'],loc='upper left')
plt.show()

The first word is at least in a roman font, but the font size is
wrong. I am using svn revision 8005 with gtkagg backend on linux, and
confirm the behavior with 0.99.0 with tkagg on OS X.

Thanks,
Jeff

-------------------------------------------------------------------------
-----
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

Ah, I didn't know there was a section of the rc file for legends. Adding

mpl.rcParams['font.family'] = 'serif'
mpl.rcParams['legend.fontsize'] = 'medium'

fixed things right up.

Thanks,
Jeff

···

On Feb 10, 2010, at 1:01 PM, <PHobson@...2850...> wrote:

Jeff,

I send all of my figures through LaTeX and don't have this problem. The only thing I can think of is to check your matplotlibrc file and make sure you've set the legend font to be the same size as the other fonts.

HTH,
-paul h.

-----Original Message-----
From: Jeffrey Blackburne [mailto:jeffb@…1165…]
Sent: Wednesday, February 10, 2010 9:45 AM
To: matplotlib-users@lists.sourceforge.net
Subject: [Matplotlib-users] LateX Legend (again)

Hi everyone,

This has been brought up before, but not completely addressed. Is it
possible to get the text in a Legend to match the rest of the text
when using LateX? Here is an example of the problem:

import matplotlib as mpl
mpl.rcParams['text.usetex'] = True
import matplotlib.pyplot as plt

fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot([1,5,2,3]) # random data
plt.figlegend(ax.lines,[r'\\rm\{label\} label'],loc='upper left')
plt.show()

The first word is at least in a roman font, but the font size is
wrong. I am using svn revision 8005 with gtkagg backend on linux, and
confirm the behavior with 0.99.0 with tkagg on OS X.

Thanks,
Jeff

-------------------------------------------------------------------------
-----
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options