From: Daniel F. <da...@te...> - 2004-09-24 22:25:05
|
Hi, I'm learning how to use matplotlib and I'm having a problem with show(). I did the simplest example of the Tutorial on the Matplotlib's homepage: from matplotlib.matlab import * plot([1,2,3,4]) show() It works fine, but when I try to run it again (second time on the same session), the plot is not shown. I have another question too: when I run the show() command, my program stops and only continues when I close the plot windows. Is there anyway of show the plot and continues the program with the plot window openned? I'm using matplotlib 0.64.4-1 on a Debian GNU/Linux. Sorry about my poor english. Thanks. Daniel. |
From: Chiara C. <chi...@es...> - 2007-02-01 16:50:06
|
I, I have a problem with showing plot. When I run this code: figure(1) semilogx(data[:,0],data[:,1]) savefig('try.png') show() It save the plot properly, but it doesn't show it. I tried to run it with "--verbose-helpful" and this is the output: matplotlib data path /usr/local/lib/python2.4/site-packages/matplotlib/mpl-data $HOME=/users/caronna CONFIGDIR=/users/caronna/.matplotlib loaded rc file /usr/local/lib/python2.4/site-packages/matplotlib/mpl-data/matplotlibrc matplotlib version 0.87.7 verbose.level helpful interactive is False platform is linux2 numerix numpy 1.0.1 font search path ['/usr/local/lib/python2.4/site-packages/matplotlib/mpl-data'] loaded ttfcache file /users/caronna/.matplotlib/ttffont.cache backend Agg version v2.2 Does anyone know what's the problem? Thanks, Chiara |
From: Russell E. O. <ro...@ce...> - 2007-02-05 20:27:29
|
In article <45C...@es...>, Chiara Caronna <chi...@es...> wrote: > I, > I have a problem with showing plot. When I run this code: > > figure(1) > semilogx(data[:,0],data[:,1]) > savefig('try.png') > show() > > > It save the plot properly, but it doesn't show it. I tried to run it > with "--verbose-helpful" and this is the output: > > > matplotlib data path > /usr/local/lib/python2.4/site-packages/matplotlib/mpl-data > $HOME=/users/caronna > CONFIGDIR=/users/caronna/.matplotlib > loaded rc file > /usr/local/lib/python2.4/site-packages/matplotlib/mpl-data/matplotlibrc > matplotlib version 0.87.7 > verbose.level helpful > interactive is False > platform is linux2 > numerix numpy 1.0.1 > font search path > ['/usr/local/lib/python2.4/site-packages/matplotlib/mpl-data'] > loaded ttfcache file /users/caronna/.matplotlib/ttffont.cache > backend Agg version v2.2 > > Does anyone know what's the problem? I'm not familiar with the "Agg" back end but I suspect it does not support output on a display. Try TkAgg, WXAgg or GTKAgg instead (depending what matplotlib was built to support) e.g. by editing ~/.matplotlib/matplotlibrc -- Russell |
From: John H. <jdh...@ac...> - 2004-09-24 22:49:08
|
>>>>> "Daniel" == Daniel Ferreira <da...@te...> writes: Daniel> Hi, I'm learning how to use matplotlib and I'm having a Daniel> problem with show(). I did the simplest example of the Daniel> Tutorial on the Matplotlib's homepage: Daniel> from matplotlib.matlab import * plot([1,2,3,4]) show() Daniel> It works fine, but when I try to run it again (second time Daniel> on the same session), the plot is not shown. I have Daniel> another question too: when I run the show() command, my Daniel> program stops and only continues when I close the plot Daniel> windows. Is there anyway of show the plot and continues Daniel> the program with the plot window openned? Daniel> I'm using matplotlib 0.64.4-1 on a Debian GNU/Linux. Is this the right version number? I didn't know matplotlib 0.64 was out yet :-) Daniel> Sorry about my poor english. I didn't even notice - it's not that poor! The usage of show is a source of confusion to all new users of matplotlib -- you are not alone. Please see the FAQ http://matplotlib.sf.net/faq.html#SHOW. The main idea is that show is only meant to be used in matplotlib scripts, not interactively from the python shell. If working interactively (type some commands, look at a figure, type some more commands), you need to set interactive to be True in your rc file. Once you have done this (and restarted python) you won't need to call show at all in an interactive session. See also http://matplotlib.sf.net/interactive.html and http://matplotlib.sf.net/.matplotlibrc. I will try and update the tutorial to make this clearer. For interactive work, I also recommend you set your backend to TkAgg in your .matplotlibrc file. Or use ipython with the pylab option - google for matplotlib and ipython. Hope this helps, JDH |