SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

You can subscribe to this list here.

2003 Jan
Feb
Mar
Apr
May
(3)
Jun
Jul
Aug
(12)
Sep
(12)
Oct
(56)
Nov
(65)
Dec
(37)
2004 Jan
(59)
Feb
(78)
Mar
(153)
Apr
(205)
May
(184)
Jun
(123)
Jul
(171)
Aug
(156)
Sep
(190)
Oct
(120)
Nov
(154)
Dec
(223)
2005 Jan
(184)
Feb
(267)
Mar
(214)
Apr
(286)
May
(320)
Jun
(299)
Jul
(348)
Aug
(283)
Sep
(355)
Oct
(293)
Nov
(232)
Dec
(203)
2006 Jan
(352)
Feb
(358)
Mar
(403)
Apr
(313)
May
(165)
Jun
(281)
Jul
(316)
Aug
(228)
Sep
(279)
Oct
(243)
Nov
(315)
Dec
(345)
2007 Jan
(260)
Feb
(323)
Mar
(340)
Apr
(319)
May
(290)
Jun
(296)
Jul
(221)
Aug
(292)
Sep
(242)
Oct
(248)
Nov
(242)
Dec
(332)
2008 Jan
(312)
Feb
(359)
Mar
(454)
Apr
(287)
May
(340)
Jun
(450)
Jul
(403)
Aug
(324)
Sep
(349)
Oct
(385)
Nov
(363)
Dec
(437)
2009 Jan
(500)
Feb
(301)
Mar
(409)
Apr
(486)
May
(545)
Jun
(391)
Jul
(518)
Aug
(497)
Sep
(492)
Oct
(429)
Nov
(357)
Dec
(310)
2010 Jan
(371)
Feb
(657)
Mar
(519)
Apr
(432)
May
(312)
Jun
(416)
Jul
(477)
Aug
(386)
Sep
(419)
Oct
(435)
Nov
(320)
Dec
(202)
2011 Jan
(321)
Feb
(413)
Mar
(299)
Apr
(215)
May
(284)
Jun
(203)
Jul
(207)
Aug
(314)
Sep
(321)
Oct
(259)
Nov
(347)
Dec
(209)
2012 Jan
(322)
Feb
(414)
Mar
(377)
Apr
(179)
May
(173)
Jun
(234)
Jul
(295)
Aug
(239)
Sep
(276)
Oct
(355)
Nov
(144)
Dec
(108)
2013 Jan
(170)
Feb
(89)
Mar
(204)
Apr
(133)
May
(142)
Jun
(89)
Jul
(160)
Aug
(180)
Sep
(69)
Oct
(136)
Nov
(83)
Dec
(32)
2014 Jan
(71)
Feb
(90)
Mar
(161)
Apr
(117)
May
(78)
Jun
(94)
Jul
(60)
Aug
(83)
Sep
(102)
Oct
(132)
Nov
(154)
Dec
(96)
2015 Jan
(45)
Feb
(138)
Mar
(176)
Apr
(132)
May
(119)
Jun
(124)
Jul
(77)
Aug
(31)
Sep
(34)
Oct
(22)
Nov
(23)
Dec
(9)
2016 Jan
(26)
Feb
(17)
Mar
(10)
Apr
(8)
May
(4)
Jun
(8)
Jul
(6)
Aug
(5)
Sep
(9)
Oct
(4)
Nov
Dec
2017 Jan
(5)
Feb
(7)
Mar
(1)
Apr
(5)
May
Jun
(3)
Jul
(6)
Aug
(1)
Sep
Oct
(2)
Nov
(1)
Dec
2018 Jan
Feb
Mar
Apr
(1)
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2020 Jan
Feb
Mar
Apr
May
(1)
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2025 Jan
(1)
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
S M T W T F S






1
(1)
2
(10)
3
(29)
4
(56)
5
(44)
6
(26)
7
(12)
8
(1)
9
(2)
10
(11)
11
(28)
12
(17)
13
(6)
14
(17)
15
(7)
16
(1)
17
(8)
18
(8)
19
(7)
20
(2)
21
(8)
22
(4)
23
(6)
24
(1)
25
(2)
26
(8)
27
(3)
28
(5)
29
(1)
30
31
(1)





Showing 10 results of 10

From: <bre...@un...> - 2007年12月02日 23:38:58
Hello Ray,
There appears to be something wrong with the way "val" is used in the 
first code section (if val==0: val = 0 ?), unless it is modified 
externally somehow?
I would also suggest adding random values or some such to make the test 
data non-periodic, so that it doesn't always look the same.
Best regards,
Brett McSweeney
ray sa <biz...@ya...> 
Sent by: mat...@li...
03/12/2007 09:50 AM
To
mat...@li...
cc
Subject
[Matplotlib-users] continuous plotting..
Hello 
I am trying to use this application to plot a diagram from a log file that 
is always active and storing data. I have written the following and I have 
issues once I touch the figure window it freezes...
from pylab import *
import time
val = 1
while True:
 inData = load('c:\\data.txt')
 x = inData[:,0]
 y = inData[:,1]
 plot(x,y,'o')
 if val == 1:
 show()
 time.sleep(1)
 if val == 0:
 val = 0
 time.sleep(1)
 draw()
I am using the following program to create some dummy data:
import time
import math
def test():
 for i in range(900):
 for rad in sineVal:
 fileData = open('c:\\data.txt','a')
 time.sleep(1) 
 fileData.write('%d' % int(i))
 fileData.write('\t')
 fileData.write('%f' % math.sin(rad))
 fileData.write('\n')
 fileData.close()
 print('*'),
def makeArray():
 tempArray = []
 for i in range(0,360,180):
 tempArray.append(i)
 return tempArray
sineVal = makeArray()
test()
You help and suggestion in the above matter will be most welcomed.
BR /ray
 Never miss a thing. Make Yahoo your homepage. 
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________
-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Matplotlib-users mailing list
Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
UNITED GROUP
This email message is the property of United Group. The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorised. If you are not the intended recipient, you may not disclose, copy or distribute this email, nor take or omit to take any action in reliance on it. United Group accepts no liability for any damage caused by this email or any attachments due to viruses, interference, interception, corruption or unauthorised access.
If you have received this email in error, please notify United Group immediately by email to the sender's email address and delete this document.
From: Eric F. <ef...@ha...> - 2007年12月02日 23:30:53
Ray,
The first problem is that you are calling show() repeatedly, but show() 
should only be called once per script; it is used in non-interactive 
plotting. Now I see that you are trying to prevent that, but the code 
as it came out in your email does not do so--val never gets set to zero.
Note that by default, repeated calls to plot overlay more and more plot 
elements; I don't think this is what you want.
To get ideas, you might look at anim.py and strip_chart_demo.py in the 
examples directory.
Eric
ray sa wrote:
> Hello
> 
> I am trying to use this application to plot a diagram from a log file 
> that is always active and storing data. I have written the following and 
> I have issues once I touch the figure window it freezes...
> 
> from pylab import *
> import time
> val = 1
> 
> while True:
> inData = load('c:\\data.txt')
> x = inData[:,0]
> y = inData[:,1]
> plot(x,y,'o')
> if val == 1:
> show()
> time.sleep(1)
> if val == 0:
> val = 0
> time.sleep(1)
> draw()
> 
> I am using the following program to create some dummy data:
> 
> import time
> import math
> 
> def test():
> for i in range(900):
> for rad in sineVal:
> fileData = open('c:\\data.txt','a')
> time.sleep(1) 
> fileData.write('%d' % int(i))
> fileData.write('\t')
> fileData.write('%f' % math.sin(rad))
> fileData.write('\n')
> fileData.close()
> print('*'),
> 
> def makeArray():
> tempArray = []
> for i in range(0,360,180):
> tempArray.append(i)
> return tempArray
> 
> sineVal = makeArray()
> 
> test()
> 
> You help and suggestion in the above matter will be most welcomed.
> 
From: ray sa <biz...@ya...> - 2007年12月02日 22:51:07
Hello 
I am trying to use this application to plot a diagram from a log file that is always active and storing data. I have written the following and I have issues once I touch the figure window it freezes...
from pylab import *
import time
val = 1
while True:
 inData = load('c:\\data.txt')
 x = inData[:,0]
 y = inData[:,1]
 plot(x,y,'o')
 if val == 1:
 show()
 time.sleep(1)
 if val == 0:
 val = 0
 time.sleep(1)
 draw()
I am using the following program to create some dummy data:
import time
import math
def test():
 for i in range(900):
 for rad in sineVal:
 fileData = open('c:\\data.txt','a')
 time.sleep(1) 
 fileData.write('%d' % int(i))
 fileData.write('\t')
 fileData.write('%f' % math.sin(rad))
 fileData.write('\n')
 fileData.close()
 print('*'),
def makeArray():
 tempArray = []
 for i in range(0,360,180):
 tempArray.append(i)
 return tempArray
sineVal = makeArray()
test()
You help and suggestion in the above matter will be most welcomed.
BR /ray
 
---------------------------------
Never miss a thing. Make Yahoo your homepage.
From: Fernando P. <fpe...@gm...> - 2007年12月02日 22:30:48
On Dec 2, 2007 2:07 PM, Yongtao Cui <cui...@gm...> wrote:
> Could anyone give me some help?
No help here, just providing a data point for the devs. Under linux, with
In [5]: wx.__version__
Out[5]: '2.8.4.0'
In [6]: matplotlib.__version__
Out[6]: '0.91.1'
I ran test(100) several times, no error.
Cheers,
f
From: Yongtao C. <cui...@gm...> - 2007年12月02日 21:15:49
Below is the minimum code with the right indent
import pylab
def test(n):
 for i in range(n):
 f=pylab.figure(1)
 f.clf()
 a=f.add_axes([0.2, 0.2, 0.6, 0.6])
 a.plot([1,2,3,4,5], 'ro')
On Dec 2, 2007 4:07 PM, Yongtao Cui <cui...@gm...> wrote:
> Hi,
>
> I got the following error when clearing and plotting on the same
> figure for many times. I found the following minimum code to reproduce
> this error. I am using matplotlib-0.91.1 and wxpython2.8 on windows
> xp. In the matplotlibrc file, I changed the backend to WXAgg and
> interactive to True.
>
> import pylab
> def test(n):
> for i in range(n):
> f=pylab.figure(1)
> f.clf()
> a=f.add_axes([0.2, 0.2, 0.6, 0.6])
> a.plot([1,2,3,4,5], 'ro')
>
>
> The error only happens for a large n. For example, test(10) works
> fine, but test(50) will cause the error. Also runing test(10) for a
> few times will also cause the error.
>
> Could anyone give me some help?
>
> Thanks.
>
> The following is the error message:
>
> Traceback (most recent call last):
> File "<input>", line 1, in <module>
> File "<input>", line 3, in test
> File "C:\Python25\Lib\site-packages\matplotlib\pyplot.py", line 191, in figure
> File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_wx.py",
> line 1227, in draw_if_interactive
> File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_wxagg.py",
> line 61, in draw
> File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_agg.py",
> line 380, in draw
> File "C:\Python25\Lib\site-packages\matplotlib\figure.py", line 612, in draw
> File "C:\Python25\Lib\site-packages\matplotlib\axes.py", line 1344, in draw
> File "C:\Python25\Lib\site-packages\matplotlib\axis.py", line 596, in draw
> File "C:\Python25\Lib\site-packages\matplotlib\axis.py", line 170, in draw
> File "C:\Python25\Lib\site-packages\matplotlib\text.py", line 775, in draw
> File "C:\Python25\Lib\site-packages\matplotlib\text.py", line 317, in draw
> File "C:\Python25\Lib\site-packages\matplotlib\text.py", line 195,
> in _get_layout
> File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_agg.py",
> line 234, in get_text_width_height_descent
> File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_agg.py",
> line 301, in _get_agg_font
> RuntimeError: Could not open facefile
> C:\Python25\lib\site-packages\matplotlib\mpl-data\fonts\ttf\Vera.ttf;
> Cannot_Open_Resource
>
From: Yongtao C. <cui...@gm...> - 2007年12月02日 21:08:03
Hi,
I got the following error when clearing and plotting on the same
figure for many times. I found the following minimum code to reproduce
this error. I am using matplotlib-0.91.1 and wxpython2.8 on windows
xp. In the matplotlibrc file, I changed the backend to WXAgg and
interactive to True.
import pylab
def test(n):
 for i in range(n):
 f=pylab.figure(1)
 f.clf()
 a=f.add_axes([0.2, 0.2, 0.6, 0.6])
 a.plot([1,2,3,4,5], 'ro')
The error only happens for a large n. For example, test(10) works
fine, but test(50) will cause the error. Also runing test(10) for a
few times will also cause the error.
Could anyone give me some help?
Thanks.
The following is the error message:
Traceback (most recent call last):
 File "<input>", line 1, in <module>
 File "<input>", line 3, in test
 File "C:\Python25\Lib\site-packages\matplotlib\pyplot.py", line 191, in figure
 File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_wx.py",
line 1227, in draw_if_interactive
 File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_wxagg.py",
line 61, in draw
 File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_agg.py",
line 380, in draw
 File "C:\Python25\Lib\site-packages\matplotlib\figure.py", line 612, in draw
 File "C:\Python25\Lib\site-packages\matplotlib\axes.py", line 1344, in draw
 File "C:\Python25\Lib\site-packages\matplotlib\axis.py", line 596, in draw
 File "C:\Python25\Lib\site-packages\matplotlib\axis.py", line 170, in draw
 File "C:\Python25\Lib\site-packages\matplotlib\text.py", line 775, in draw
 File "C:\Python25\Lib\site-packages\matplotlib\text.py", line 317, in draw
 File "C:\Python25\Lib\site-packages\matplotlib\text.py", line 195,
in _get_layout
 File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_agg.py",
line 234, in get_text_width_height_descent
 File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_agg.py",
line 301, in _get_agg_font
RuntimeError: Could not open facefile
C:\Python25\lib\site-packages\matplotlib\mpl-data\fonts\ttf\Vera.ttf;
Cannot_Open_Resource
From: hjc520070 <jia...@16...> - 2007年12月02日 11:55:05
Xavier Gnata wrote:
>=20
> Hi,
>=20
> Quoting matplotlib/__init__.py :
>=20
> def checkdep_ghostscript():
> try:
> if sys.platform =3D=3D 'win32':
> command =3D 'gswin32c -v'
> else:
> command =3D 'gs -v'
> stdin, stdout =3D os.popen4(command)
> line =3D stdout.readlines()[0]
> v =3D line.split()[2]
> vtest =3D '.'.join(v.split('.')[:2]) # deal with version numbers=
=20
> like '7.07.1'
> float(vtest)
> return vtest
> except (IndexError, ValueError):
> return None
>=20
> It fails on debian sid because 'gs -v' returns "GPL Ghostscript SVN=20
> PRE-RELEASE 8.61 (2007年08月02日)\n"
>=20
> Anyway, the parser will be ugly because it has to deal with version=20
> numbers like '7.07.1'.
> Should I propose a trivial patch to get thinks working on debian sid ?
>=20
> Xavier
> ps :Why is there no standard way (like -v or --version) on *unix to get=
=20
> the version *number*?? Only the version number. Why :(
>=20
> --=20
> ############################################
> Xavier Gnata
> CRAL - Observatoire de Lyon
> 9, avenue Charles Andr=C3=A9
> 69561 Saint Genis Laval cedex
> Phone: +33 4 78 86 85 28
> Fax: +33 4 78 86 83 86
> E-mail: gn...@ob...
> ############################################=20
>=20
>=20
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>=20
>=20
Yeah , I did face the same problem . My code is following:=20
There seems to be something wrong in "ax.imshow(im)", I can't get the answe=
r
, Can sb help me .=20
The error message"ValueError: need more than 0 values to unpack"
Thank you .
# -*- coding:gb2312 -*-=20
import wx
from pylab import *
from matplotlib.backends.backend_wx import FigureCanvasWx
from matplotlib.figure import Figure
from matplotlib.axes import *
from numpy import *
#-------------------------------------------------------------
x=3Darray(range(0,100))
y=3Darray(range(0,100))
z=3Drand(100,100)
figure(1)
im=3Dimshow(z, interpolation=3D'bilinear', origin=3D'lower',cmap=3Dcm.gray,
extent=3D(0,100,0,100))
levels =3D arange(0.3, 0.4, 0.9)
contour(x,y,z,levels,origin=3D'lower',linewidths=3D2,extent=3D(0,100,0,100)=
)
fig=3Dfigure(2)
ax =3D fig.add_subplot(111)
ax.imshow(im)
ax.set_xlim(0,3)
ax.set_ylim(0,2)
show()
--=20
View this message in context: http://www.nabble.com/matplotlib-__init__.py-=
%3A-gs-version-parsing-problem-tf4821980.html#a14114656
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Brian O. <bri...@gm...> - 2007年12月02日 07:04:56
Hi All,
I'm running into the following error when I try to run any of the matplotlib
examples:
$ python anim.py
Traceback (most recent call last):
 File "anim.py", line 19, in <module>
 import pylab as p
 File "C:\Python25\Lib\site-packages\pylab.py", line 1, in <module>
 from matplotlib.pylab import *
 File "C:\Python25\Lib\site-packages\matplotlib\pylab.py", line 206, in
<module>
 from matplotlib.numerix import npyma as ma
 File "C:\Python25\Lib\site-packages\matplotlib\numerix\__init__.py", line
20, in <module>
 from matplotlib import rcParams, verbose
ImportError: cannot import name rcParams
I'm using the latest versions of matplotlib and numpy, ActivePython 2.5 (all
for Windows XP). Any help would be appreciated.
Regards,
Brian.
From: hjc520070 <jia...@16...> - 2007年12月02日 01:47:34
The following run well . But I just want to make the image, with the x and y
as axis and z as the image value ,show on the figure. In the pylab , we can
just give a command "imshow" ,But here , I fail to do it , I have try
ax.imshow() again and again ,but fail. Can sb give me some advice . Thank
you . 
import matplotlib 
matplotlib.use("WXAgg") 
matplotlib.interactive(True) 
from matplotlib.backends.backend_wx import FigureCanvasWx 
from matplotlib.figure import Figure 
from matplotlib.axes import * 
from numpy import * 
import wx 
from pylab import * 
 
#--------------------------------------------------- 
class DynamicPlot(): 
 def __init__(self,Frame): 
 delta = 0.025 
 x = arange(-3.0, 3.0, delta) 
 y = arange(-2.0, 2.0, delta) 
 X, Y = meshgrid(x, y) 
 Z1 = bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0) 
 Z2 = bivariate_normal(X, Y, 1.5, 0.5, 1, 1) 
 Z = 10.0 * (Z2 - Z1) 
 levels = arange(-1.2, 1.6, 0.2) 
 self.fig = Figure((8,8), 75) 
 self.canvas = FigureCanvasWx(Frame, -1, self.fig) 
 ax=self.fig.add_axes([0.1,0.1,0.8,0.8]) 
 
ax.contour(X,Y,Z,levels,origin='lower',linewidths=2,extent=(-3,3,-2,2)) 
app = wx.PySimpleApp() 
f=wx.Frame(None,size=(600,600)) 
f.Show(True) 
DynamicPlot(f) 
app.MainLoop()
-- 
View this message in context: http://www.nabble.com/How-to-show-matplotlib.image---tf4930297.html#a14111799
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: twentypoundtrout <twe...@ya...> - 2007年12月02日 01:08:02
Hi. I installed matplotlib and get the following when I import pylab:
In [8]: import pylab
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
C:\Documents and Settings\luke\Desktop\<ipython console> in <module>()
C:\Python25\Lib\site-packages\pylab.py in <module>()
----> 1 from matplotlib.pylab import *
 2 import matplotlib.pylab
 3 __doc__ = matplotlib.pylab.__doc__
C:\Python25\Lib\site-packages\matplotlib\pylab.py in <module>()
 204 # replace the present numpy.ma implementation in a future
 205 # numpy release.
--> 206 from matplotlib.numerix import npyma as ma
 207
 208 from matplotlib import mpl # pulls in most modules
C:\Python25\Lib\site-packages\matplotlib\numerix\__init__.py in <module>()
 18
 19 import sys, os, struct
---> 20 from matplotlib import rcParams, verbose
 21
 22 which = None, None
ImportError: cannot import name rcParams
Any ideas? I searched and found one hit, but no solution...
-- 
View this message in context: http://www.nabble.com/rcparams-problem-with-pylab-tf4930220.html#a14111560
Sent from the matplotlib - users mailing list archive at Nabble.com.

Showing 10 results of 10

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /