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
(12)
2
(15)
3
(4)
4
5
(1)
6
(13)
7
(8)
8
(16)
9
(10)
10
(6)
11
(11)
12
(20)
13
(8)
14
(12)
15
(10)
16
(12)
17
(6)
18
(7)
19
(18)
20
(5)
21
(9)
22
23
(6)
24
(3)
25
26
(2)
27
(26)
28
(11)
29
(9)
30
(21)

Showing 13 results of 13

From: Robert H. <he...@ta...> - 2006年06月06日 23:09:02
+1 for removing pcolor_classic.
On Jun 6, 2006, at 1:49 PM, Eric Firing wrote:
> In the spirit of cleaning up and simplifying mpl, I would like to know
> whether anyone is still using pcolor_classic, and if so, why? Does it
> have any advantages over pcolor or pcolormesh?
>
> Thanks.
>
> Eric
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
-----
Rob Hetland, Assistant Professor
Dept of Oceanography, Texas A&M University
p: 979-458-0096, f: 979-845-6331
e: he...@ta..., w: http://pong.tamu.edu
From: Clovis G. <cl...@pe...> - 2006年06月06日 19:41:46
This is a previously reported problem, related to:
a) closing figures (garbage collection)
b) memory usage issues (and memory leaks, which depend on the selected 
backend)
I adapted the script just provided by John Hunter to show memory usage 
at each new figure:
import sys
import pylab
import os
import time
report_filename = 'memory_report_in_%s.txt' % pylab.matplotlib.get_backend()
fid = file(report_filename,'wt')
fid.write('Date/time of test = %s\n' % time.asctime())
fid.write('OS version = %s\n' % os.sys.version)
fid.write('OS platform = %s\n' % os.sys.platform)
fid.write('Matplotlib version = %s\n' % pylab.matplotlib.__version__)
fid.write('Matplotlib revision = %s\n' % pylab.matplotlib.__revision__)
fid.write('Matplotlib backend = %s\n' % pylab.matplotlib.get_backend())
 
pylab.ion()
a=pylab.arange(0,10)
def report_memory():
 ### Attention: the path to the pslist utility should be adjusted 
according to installation!
 if os.sys.platform == 'win32':
 ps_exe_filename = os.path.join(os.getcwd(),'pslist.exe') 
#Build ps filename
 a = os.popen('%s -m python' % ps_exe_filename).readlines() 
#Build and execute command
 b = a[8]
 c = b.split()
 return int(c[3])
 else:
 print 'Sorry, you have to adapt the command for your OS!'
 return 0
while 1:
 fig = pylab.figure()
 ax = fig.add_subplot(111)
 x, y = pylab.nx.mlab.rand(2,30)
 ax.plot(x,y,'o')
 fig.canvas.draw()
 memory_usage=report_memory()
 k = raw_input("Current memory usage %d [kBytes]. Press any key to 
continue, q to quit: " % memory_usage)
 fid.write('%8d [kBytes]\n' % memory_usage)
 if k.lower().startswith('q'):
 fid.close()
 sys.exit()
 pylab.close()
show()
Results using TKAgg are given below:
Date/time of test = Tue Jun 06 16:32:02 2006
OS version = 2.4.3 (#69, Apr 11 2006, 15:32:42) [MSC v.1310 32 
bit (Intel)]
OS platform = win32
Matplotlib version = 0.87
Matplotlib revision = $Revision: 1.122 $
Matplotlib backend = TkAgg
 21484 [kBytes]
 23688 [kBytes]
 25824 [kBytes]
 27952 [kBytes]
 30176 [kBytes]
 32300 [kBytes]
 34436 [kBytes]
 36660 [kBytes]
 38780 [kBytes] ....
Results using GTKAgg are much better (given below):
Date/time of test = Tue Jun 06 16:32:37 2006
OS version = 2.4.3 (#69, Apr 11 2006, 15:32:42) [MSC v.1310 32 
bit (Intel)]
OS platform = win32
Matplotlib version = 0.87
Matplotlib revision = $Revision: 1.122 $
Matplotlib backend = GTKAgg
 29920 [kBytes]
 32896 [kBytes]
 34212 [kBytes]
 34240 [kBytes]
 34340 [kBytes]
 34456 [kBytes]
 34548 [kBytes]
 34580 [kBytes]
 34680 [kBytes]
 34776 [kBytes]
 34804 [kBytes]
 34912 [kBytes]
 35008 [kBytes]
 35104 [kBytes]
 35140 [kBytes]
 35244 [kBytes]
 35336 [kBytes]
 35392 [kBytes]
 34364 [kBytes]...
As suggested by Hunter some time ago, TkAgg is leaking (under Win32). If 
TkAgg is placed as the "default" backend for
Win32 users, maybe this problem should deserve some attention.
With GTKAgg (and also some other backends tested) everything seems to be 
fine!
Regards,
Clovis
From: Eric F. <ef...@ha...> - 2006年06月06日 18:50:06
In the spirit of cleaning up and simplifying mpl, I would like to know 
whether anyone is still using pcolor_classic, and if so, why? Does it 
have any advantages over pcolor or pcolormesh?
Thanks.
Eric
From: massimo s. <mas...@un...> - 2006年06月06日 18:21:56
Attachments: massimo.sandal.vcf
Hi,
I'm trying to do a simple linear least squares fit of some data in an 
application.
The relevant code runs about as follows, following closely the example 
found on http://mail.python.org/pipermail/python-list/2006-March/331693.html
---------
import matplotlib.numerix as nx
contact_x_points=nx.array(x_points[left_bound:right_bound])
contact_y_points=nx.array(y_points[left_bound:right_bound])
A=nx.ones((len(contact_x_points),2))
A[:,0]=contact_x_points 
result=nx.linear_algebra.linear_least_squares(A,contact_y_points)
---------
...but when I run, it crashes with:
File "hooke.py", line 202, in find_contact_point
 result=nx.linear_algebra.linear_least_squares(A,contact_y_points)
 File "/usr/lib/python2.3/site-packages/Numeric/LinearAlgebra.py", 
line 416, in linear_least_squares
 nlvl = max( 0, int( math.log( float(min( m,n ))/2. ) ) + 1 )
OverflowError: math range error
I also tried using scipy:
-----------
import scipy as sp
contact_x_points=sp.array(x_points[left_bound:right_bound])
contact_y_points=sp.array(y_points[left_bound:right_bound])
A=sp.ones((len(contact_x_points),2))
A[:,0]=contact_x_points result=sp.linalg.lstsq(A,contact_y_points)
-------------
... with another error:
array_from_pyobj:intent(hide) must have defined dimensions.
rank=1 dimensions=[ 0 ]
Traceback:
[...]
File "hooke.py", line 202, in find_contact_point
 result=sp.linalg.lstsq(A, contact_y_points)
 File "/usr/lib/python2.3/site-packages/scipy/linalg/basic.py", line 
344, in lstsq
 overwrite_b = overwrite_b)
flapack.error: failed in converting hidden `s' of flapack.dgelss to 
C/Fortran array
In my .matplotlibrc the numerix backend is Numeric.
I'm on Debian Sarge; MPL version is 0.82 ; Scipy is 0.3.2
It must be noticed that I fail to declare
A=nx.ones((len.contact_x_points),2),dtype=float)
as the example should seem to require, because it gives me another error:
TypeError: ones() got an unexpected keyword argument 'dtype'
...so if this is the problem, please tell me how to correctly pass the 
dtype argument.
Since I'm quite a scipy/numeric newbie I guess there could be some 
obvious blunder and/or more correct way of obtaining my fit, and I'd be 
thankful to anyone pointing me at the solution...
Thanks,
Massimo
-- 
Massimo Sandal
University of Bologna
Department of Biochemistry "G.Moruzzi"
snail mail:
Via Irnerio 48, 40126 Bologna, Italy
email:
mas...@un...
tel: +39-051-2094388
fax: +39-051-2094387
From: JUAN E. F. B. <jua...@ho...> - 2006年06月06日 17:55:42
Hi you all
I am coding a GUI application python/matplotlib/basemap based on. I have 
imported NavigationToolbar as follows:
from matplotlib.backends.backend_gtk import NavigationToolbar2GTK as 
NavigationToolbar
This shows the following five buttons:
1.- Reset Original View
2.- Back to Previous View
3.- Forward to Next View
4.- Pan Axes
5.- Zoom to Rectangle
6.- Save the Figure
I am really interested on buttons number 1, 4, 5 and 6 only. Is it possible 
to suppress the other buttons from tha toolbar??? how??. The second issue is 
i would like to change toolbar tooltips from english to spanish which is my 
mother tonge...
I would like to know wether this customizing options are possible...
Thanks for your answers in advance....
Regards.-
From: John H. <jdh...@ac...> - 2006年06月06日 12:03:24
>>>>> "Steve" == Steve Schmerler <el...@gm...> writes:
 Steve> leau2001 wrote:
 >> I made some figure in a loop and i want to close after the
 >> figure show.
 >> 
 Steve> Not absolutely sure what you mean, but to produce some
 Steve> plots and save them in a loop I do
 Steve> f = figure() for i in range(..): plot(...) savefig(...)
 Steve> f.clf() # clear figure for re-use close(f)
Often times what people are looking for is they want to the figure to
pop up on the screen, look at it, have it close, and move on. One way
to achieve this is to run mpl in interactive mode
 http://matplotlib.sf.net/interactive.html
and then insert a time.sleep or call 
 input("Press any key for next figure: ")
If this is what you are doing, threading becomes important. This is
discussed on the web page linked above, and your best bet is to either
use the tkagg backend or better yet, use ipython in -pylab mode.
Something like
import sys
from pylab import figure, close, show, nx, ion
ion()
while 1:
 fig = figure()
 ax = fig.add_subplot(111)
 x, y = nx.mlab.rand(2,30)
 ax.plot(x,y,'o')
 fig.canvas.draw()
 k = raw_input("press any key to continue, q to quit: ")
 if k.lower().startswith('q'): 
 sys.exit()
 close()
show()
From: Alan G I. <ai...@am...> - 2006年06月06日 11:41:39
On 2006年6月06日, apparently wrote:=20
> I made some figure in a loop and i want to close after the figure show.=
=20
Are you using TkAgg?
Then it should have a close button.
Use it.
By using show() you entered the Tkinter mainloop,
so you cannot close it from the console.
(Or so I believe.)
Cheers,
Alan Isaac
From: Steve S. <el...@gm...> - 2006年06月06日 11:17:10
leau2001 wrote:
> I made some figure in a loop and i want to close after the figure show.
> 
Not absolutely sure what you mean, but to produce some plots and save
them in a loop I do
f = figure()
for i in range(..):
	plot(...)
	savefig(...)
	f.clf() # clear figure for re-use
close(f)
cheers,
steve
-- 
Random number generation is the art of producing pure gibberish as
quickly as possible.
From: Stefan v. d. W. <st...@su...> - 2006年06月06日 11:10:58
On Tue, Jun 06, 2006 at 12:32:00PM +0200, Stefan van der Walt wrote:
> In current SVN, line 1164 of text.py (__init__ of TextWithDash) refers
> to "renderer" which is not defined. This breaks almost any
> operation.
Eek! Local changes in my repository. Please disregard the previous
message.
*blush*
St=E9fan
From: Stefan v. d. W. <st...@su...> - 2006年06月06日 10:42:10
Hi,
In current SVN, line 1164 of text.py (__init__ of TextWithDash) refers
to "renderer" which is not defined. This breaks almost any operation.
Regards
St=E9fan
From: leau2001 <lea...@fr...> - 2006年06月06日 07:26:53
I made some figure in a loop and i want to close after the figure show.
thx
lo
From: Russell E. O. <ro...@ce...> - 2006年06月06日 02:51:18
In article 
<638...@ma...>,
 "Charlie Moad" <cw...@gm...> wrote:
> On 6/2/06, Russell E. Owen <ro...@ce...> 
> wrote:
> > I'm using matplotlib in an application I distribute. For Windows and Mac
> > users I distribute a frozen application which includes python,
> > matplotlib, etc. and I'm wondering how best to include the matplotlib
> > data files.
> >
> > matplotlib searches for its data files in __init__._get_data_path. It
> > seems to search shared locations first, then locations that would be
> > relevant to a frozen application. Is that safe? I worry that if a user
> > of my app has their own version of matplotlib (possibly a very different
> > version than I've included) then the data files might be different.
> >
> > If this really is an issue, then what to do?
> 
> The only way you could have conflicting data sources is if
> MATPLOTLIBDATA is defined in your environment. 
> of setting that I am inclined to think they might know what to do in
> case of an error. If that env var is not set, then mpl looks inside
> the its module. Different installs will not see the others. We
> finally have a special case for frozen installations. It has
> primarily been made for py2exe, in which you should have a folder
> called 'matplotlibdata' in your app's bundle.
OK, thanks. I had not realized that so few dirs were searched on Windows 
as compared to unix/MacOS X, but you're right. So although the test for 
frozen windows versions comes last, there's not much to collide with 
before that.
> > For Mac I can put the data files deep in the app in
> > Contents/Frameworks/Python.Framework/2.4/share/matplotlib, which is the
> > second location looked at (after environment variable MATPLOTLIBDATA).
> 
> The second location should be:
> ....Frameworks/Python.Framework/2.4/lib/python2.4/matplotlib/mpl-data
> 
> Are you using an old version of matplotlib?
I guess it's a bit old. 0.82. I need something built for MacOS X 10.3.9 
so my bundled app runs on that.
Thanks for the heads up on the changed path. Maybe I'll remember to fix 
my bundling code when I upgrade matplotlib.
> > For Windows, there doesn't seem any way out. The Windows frozen test is
> > dead last.
> 
> You can remove the MATPLOTLIBDATA env var from os.environ in your code.
Great idea. I'll do that. Thanks!
> In my experience with distributing apps with matplotlib, I have known
> in advanced the packages I want to use. For example, if I know I am
> going to bundle Tkinter and numpy, then I make sure I have the
> following before using any matplotlib commands.
> 
> import matplotlib
> matplotlib.use('TkAgg')
> matplotlib.rcParams['numerix'] = 'numpy'
Thanks for the tip. I knew about the first one, but not the second!
-- Russell
From: leau2001 <lea...@fr...> - 2006年06月06日 02:21:10
Hi, i try to use the plot_date function and i have some problems, is
anybody can help me
My program :
First to show it's ok to run if i just used the only plot function
> from pylab import *
> import marshal
> import time
> import string
>
> lst_date=[]
> points=[]
> belos=[['2', '2', '2', '2', '2', '2', '2', '54', '125', '169', '224', 
> '245', '245', '245', '325', '325', '325', '453', '486', '521', '521', 
> '521', '8596', '9566', '9848', '10064'], [1148378715.6400001, 
> 1148379045.312, 1148379057.7179999, 1148379069.375, 1148379331.921, 
> 1148390222.3280001, 1148390265.2650001, 1148396382.562, 
> 1148464116.609, 1148481671.6559999, 1148534908.2520001, 
> 1148551483.8299999, 1148573370.8770001, 1148589279.517, 
> 1148625453.8429999, 1148640384.5150001, 1148659451.25, 1148709552.921, 
> 1148740419.375, 1148799935.5780001, 1148827804.0, 1148886086.109, 
> 1148915795.984, 1148972914.8429999, 1149001049.671, 
> 1149053926.7650001], ['2:349:7', '2:349:7', '2:349:7', '2:349:7', 
> '2:349:7', '2:349:7', '2:349:7', '3:56:5', '3:56:5', '3:56:5', '3:56:5']]
>
> point=belos[0]
> dt_date=belos[1]
>
>
> for j in dt_date:
> date=time.ctime(j)
> lst_date.append(date)
>
> print lst_date
>
>
> for i in point:
> a=int(i)
> points.append(a)
> 
> print belos
> print point
> print len(point)
> print len(lst_date)
> #plot (date, point, 'ro')
> #show()
>
> #plot_date(dt_date, points, '', xdate=True, ydate=False)
> plot(dt_date, points, '',)
> #savefig('secondfig.png')
> show()
The i try with the plot_date function and i got on error:
> Traceback (most recent call last):
> File "C:\Python24\uni_22\belos_stat.py", line 32, in -toplevel-
> plot_date(dt_date, points, '', xdate=True, ydate=False)
> File "C:\Python24\Lib\site-packages\matplotlib\pylab.py", line 2039, 
> in plot_date
> ret = gca().plot_date(*args, **kwargs)
> File "C:\Python24\Lib\site-packages\matplotlib\axes.py", line 2830, 
> in plot_date
> self.autoscale_view()
> File "C:\Python24\Lib\site-packages\matplotlib\axes.py", line 815, 
> in autoscale_view
> self.set_xlim(locator.autoscale())
> File "C:\Python24\Lib\site-packages\matplotlib\dates.py", line 537, 
> in autoscale
> dmin, dmax = self.datalim_to_dt()
> File "C:\Python24\Lib\site-packages\matplotlib\dates.py", line 403, 
> in datalim_to_dt
> return num2date(dmin, self.tz), num2date(dmax, self.tz)
> File "C:\Python24\Lib\site-packages\matplotlib\dates.py", line 205, 
> in num2date
> if not iterable(x): return _from_ordinalf(x, tz)
> File "C:\Python24\Lib\site-packages\matplotlib\dates.py", line 154, 
> in _from_ordinalf
> dt = datetime.datetime.fromordinal(ix)
> ValueError: year is out of range
i want the x axis show me the date on this format : Tue May 23 12:05:15
2006', 'Tue May 23 12:10:45 2006', 'Tue May 23 12:10:57 2006 etc...
Thx for answer
-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Matplotlib-users mailing list
Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Showing 13 results of 13

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 によって変換されたページ (->オリジナル) /