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




Showing 11 results of 11

From: oeolartep <cts...@gm...> - 2006年02月13日 23:37:31
If one try to plot more than nine axes in one figure is necesary to add a
comma between subplot arguments, but this command doesn't work properly. If
, for example, we need to plot twelve images
subplot(4,3,1)
imshow(...)
.
.
.
subplot(4,3,12)
imshow(...) 
all images appear overlapped only on the first block of the array.
--
View this message in context: http://www.nabble.com/matplotlib-0.82-subplot-problem-t1117646.html#a2922054
Sent from the matplotlib - users forum at Nabble.com.
From: Ryan K. <rya...@gm...> - 2006年02月13日 23:32:27
I am having a weird problem zooming in on a graph using
ylim(ymin,ymax). The data is all positive. I am trying to search for
local minimums of a function of one variable. So, I evaluate the
function over a vector and look graphically for local minimums to use
as initial guesses to scipy.optimize.fmin. If I plot all of the data,
it looks like the attached file zoomout.png. But if I try and zoom in
using ylim, I get the rather strange looking plot in zoomin.png. Some
of the data is negative on the plot even though min(yvector)=3D=3D0.0. I
can sort of fixe the problem using masked arrays (zoommasked.png), but
I would like to have vertical lines going up to the masked values -
like would be there if I could just zoom in correctly.
I am using matplotlib cvs from some time last week, scipy 0.4.5.1579,
and numpy 0.9.5.2043 and numerix=3Dnumpy.
What am I going wrong or is this a bug?
Thanks,
Ryan
From: Paul B. <peb...@gm...> - 2006年02月13日 21:59:35
On 2/13/06, manouchk <man...@gm...> wrote:
>
>
> I'd like to know if someone already installed matplotlib on mandriva 2005=
?
> Is
> there any src.rpm? pygtk 2.0 needs to be installed?
I routinely build and then install the CVS version into /usr/local. I'm no=
t
aware of the most recent version being available, but there is an RPM for
python-matplotlib-0.83.2-1mdk in the contrib directory, if you add it to
your package manager. Since I don't use it, I don't know if it requires
pygtk or not.
 -- Paul
--
Paul Barrett, PhD Johns Hopkins University
Assoc. Research Scientist Dept of Physics and Astronomy
Phone: 240-593-0028 Baltimore, MD 21218
From: manouchk <man...@gm...> - 2006年02月13日 21:50:27
Le Lundi 13 F=E9vrier 2006 19:46, manouchk a =E9crit=A0:
> Hi,
>
> I'd like to know if someone already installed matplotlib on mandriva 2005?
> Is there any src.rpm? pygtk 2.0 needs to be installed?
I'm trying to install using checkinstall to keep a only with-rpm-installed=
=20
distribution.
build seems to work=20
then using checkinstall python setup.py install, it fails :
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 Installation results =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
installing data to lib/python2.4/site-packages/matplotlib/mpl-data
running install
running build
running build_py
running build_ext
running install_lib
copying build/lib.linux-i686-2.4/pylab.py -> /usr/lib/python2.4/site-packag=
es
error: /usr/lib/python2.4/site-packages/pylab.py: No such file or directory
**** Installation failed. Aborting package creation.
From: manouchk <man...@gm...> - 2006年02月13日 21:37:54
Hi,
I'd like to know if someone already installed matplotlib on mandriva 2005? Is 
there any src.rpm? pygtk 2.0 needs to be installed?
From: Christopher B. <Chr...@no...> - 2006年02月13日 21:21:10
Graeme O'Keefe wrote:
> I'm using darwinports/python24 whereas the preinstalled environment 
> which includes wxpython is python23.
There are easy installs for python2.4 and wxPython 2.6.1 for python2.4:
http://www.undefined.org/python/
http://www.pythonmac.org/packages/
(or the wxPython download page)
I've built MPL for those versions in the past, I don't have the latest, 
and I haven't figure out eggs yet, but I should some day.
> I'll wait until matplotlib/numpy makes it into darwinports.
Essentially, darwinports is kind of like a Unix within OS-X, so I'd go 
with all darwinports or no darwinports (for Python stuff)
> I'm not particularly wedded to the idea of using py-gtk2, is there any 
> compelling reason to use wxpython over py-gtk2?
It depends on how you are using it. wxPython lets you develop fairly 
native cross platform apps. It also works with the native Mac GUI 
(rather than X11). If you're using MPL stand alone (rather than embedded 
in a larger GUI app), and you're happy with darwinports and X11, then 
there is no advantage.
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
 		
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: John H. <jdh...@ac...> - 2006年02月13日 14:56:10
>>>>> "Luigi" == Luigi Paioro <lu...@la...> writes:
 Luigi> Hi to all! A short question.
 Luigi> How can I do to remove a line from a subplot? I use
 Luigi> add_line(...) in order to add it, but what command have I
 Luigi> to use for remove it?
One figure in the user's guide that helps with kind of thing is the
figure in the API chapter that shows the containment hierarchy and
what the attribute names are. So you can see for example that the
Axes class has a lines instance which is a list of Line2D objects.
Thus you can remove any line from the axes just using list methods
 ax.lines.remove(someline)
The only lingering effects of the line after removing it will be that
it's data extent (xmin, xmax), (ymin, ymax) will still be in the axes
data lim, so if you want to clear this you will need to reset the
datalim or manually set the limits, eg ax.set_xlim and ax.set_ylim.
JDH
From: Luigi P. <lu...@la...> - 2006年02月13日 13:02:34
Hi to all!
A short question.
How can I do to remove a line from a subplot? I use add_line(...) in 
order to add it, but what command have I to use for remove it?
Thanks.
Luigi
From: <aur...@fr...> - 2006年02月13日 10:46:39
Dear John,
I finnaly found a solution that works following the suggestion from Charl=
ie Moad
(many thanks !).
Before this, I tried what you suggested (explicitly naming the figure). T=
he
output for 3 cycles is shown bellow in result1. It doesn't change much in=
 the
story, the memory still increases by about 6Mb. I also show the result wh=
en I
uncomment the savefig line (result2) which also shows an increase by abou=
t 0.6
Mb.
If instead of actually closing and opening a figure each time I use gcf (=
without
closing the figure), then, if works fine (result3). Unlike for the first =
two
cases, the memory is freed using the gc.collector (instead of close).
The final code is at the bottom. I still don't uderstand why it doesn't w=
ork by
the first method, but at least it works...
Many thanks,
Cheers,
Aur=E9lien
--------------
RESULT 1:
memory used 331.55 Mb
Building individual images...
building file ...
memory used for image - step1 331.55 Mb
memory used for image - step2 331.55 Mb
memory used for image - step3 331.55 Mb
memory used for image - step4 331.55 Mb	-> created fig
memory used for image - step5 331.55 Mb	-> cleared fig
memory used for image - step6 329.11 Mb	-> built image - imshow
memory used for image - step7 329.20 Mb	-> added colorbar
memory used for image - step8 329.20 Mb	-> turned axis off
memory used for image - step9 336.74 Mb	-> saved fig
memory used for image - step10 336.74 Mb	-> cleared cached text
memory used for image - step11 336.74 Mb	-> cleared image (axes)
memory used for image - step12 336.74 Mb
memory used for image - step13 328.31 Mb	-> closed figure
memory used for image - step14 328.31 Mb	-> called garbage collector
total time =3D 1.84299993515
done
memory used 328.31 Mb
building file ...
memory used for image - step1 328.31 Mb
memory used for image - step2 328.31 Mb
memory used for image - step3 328.31 Mb
memory used for image - step4 342.26 Mb	-> created fig
memory used for image - step5 342.26 Mb	-> cleared fig
memory used for image - step6 339.84 Mb	-> built image - imshow
memory used for image - step7 339.94 Mb	-> added colorbar
memory used for image - step8 339.94 Mb	-> turned axis off
memory used for image - step9 347.50 Mb	-> saved fig
memory used for image - step10 347.50 Mb	-> cleared cached text
memory used for image - step11 347.50 Mb	-> cleared image (axes)
memory used for image - step12 347.50 Mb
memory used for image - step13 333.66 Mb	-> closed figure
memory used for image - step14 333.66 Mb	-> called garbage collector
total time =3D 1.93700003624
done
memory used 333.66 Mb
building file ...
memory used for image - step1 333.66 Mb
memory used for image - step2 333.66 Mb
memory used for image - step3 333.66 Mb
memory used for image - step4 347.81 Mb	-> created fig
memory used for image - step5 347.81 Mb	-> cleared fig
memory used for image - step6 345.40 Mb	-> built image - imshow
memory used for image - step7 345.51 Mb	-> added colorbar
memory used for image - step8 345.51 Mb	-> turned axis off
memory used for image - step9 353.57 Mb	-> saved fig
memory used for image - step10 353.57 Mb	-> cleared cached text
memory used for image - step11 353.57 Mb	-> cleared image (axes)
memory used for image - step12 353.57 Mb
memory used for image - step13 339.73 Mb	-> closed figure
memory used for image - step14 339.73 Mb	-> called garbage collector
total time =3D 1.67200016975
done
--
RESULT 2:
memory used 345.79 Mb
Building individual images...
building file=20
I:/EggShell/ESRF-sc1579-201104/OriginalDataPolarTransform/egg4_8_0500_pol=
ar_mask.png
 ...
memory used for image - step1 345.79 Mb
memory used for image - step2 345.79 Mb
memory used for image - step3 345.79 Mb
memory used for image - step4 359.92 Mb	-> created fig
memory used for image - step5 359.92 Mb	-> cleared fig
memory used for image - step6 357.51 Mb	-> built image - imshow
memory used for image - step7 357.61 Mb	-> added colorbar
memory used for image - step8 357.61 Mb	-> turned axis off
memory used for image - step9 357.61 Mb	-> saved fig - DISABLED
memory used for image - step10 357.61 Mb	-> cleared cached text
memory used for image - step11 357.61 Mb	-> cleared image (axes)
memory used for image - step12 357.61 Mb
memory used for image - step13 343.77 Mb	-> closed figure
memory used for image - step14 343.77 Mb	-> called garbage collector
total time =3D 1.25
done
memory used 343.77 Mb
building file=20
I:/EggShell/ESRF-sc1579-201104/OriginalDataPolarTransform/egg4_8_0499_pol=
ar_mask.png
 ...
memory used for image - step1 343.77 Mb
memory used for image - step2 343.77 Mb
memory used for image - step3 344.02 Mb
memory used for image - step4 358.22 Mb	-> created fig
memory used for image - step5 358.22 Mb	-> cleared fig
memory used for image - step6 358.28 Mb	-> built image - imshow
memory used for image - step7 358.38 Mb	-> added colorbar
memory used for image - step8 358.38 Mb	-> turned axis off
memory used for image - step9 358.38 Mb	-> saved fig - DISABLED
memory used for image - step10 358.38 Mb	-> cleared cached text
memory used for image - step11 358.38 Mb	-> cleared image (axes)
memory used for image - step12 358.38 Mb
memory used for image - step13 344.54 Mb	-> closed figure
memory used for image - step14 344.54 Mb	-> called garbage collector
total time =3D 0.625
done
memory used 344.54 Mb
building file=20
I:/EggShell/ESRF-sc1579-201104/OriginalDataPolarTransform/egg4_8_0498_pol=
ar_mask.png
 ...
memory used for image - step1 344.54 Mb
memory used for image - step2 344.54 Mb
memory used for image - step3 344.54 Mb
memory used for image - step4 358.74 Mb	-> created fig
memory used for image - step5 358.75 Mb	-> cleared fig
memory used for image - step6 358.81 Mb	-> built image - imshow
memory used for image - step7 358.91 Mb	-> added colorbar
memory used for image - step8 358.91 Mb	-> turned axis off
memory used for image - step9 358.91 Mb	-> saved fig - DISABLED
memory used for image - step10 358.91 Mb	-> cleared cached text
memory used for image - step11 358.91 Mb	-> cleared image (axes)
memory used for image - step12 358.91 Mb
memory used for image - step13 345.06 Mb	-> closed figure
memory used for image - step14 345.06 Mb	-> called garbage collector
total time =3D 0.640000104904
done
--
RESULT 3:
memory used 325.69 Mb
Building individual images...
building file ...
memory used for image - step1 325.69 Mb
memory used for image - step2 325.41 Mb
memory used for image - step3 325.41 Mb
memory used for image - step4 325.41 Mb	-> created fig - gcf
memory used for image - step5 325.41 Mb	-> cleared fig
memory used for image - step6 322.70 Mb	-> built image - imshow
memory used for image - step7 322.61 Mb	-> added colorbar
memory used for image - step8 322.61 Mb	-> turned axis off
memory used for image - step9 330.62 Mb	-> saved fig
memory used for image - step10 330.62 Mb	-> cleared cached text
memory used for image - step11 330.62 Mb	-> cleared image (axes)
memory used for image - step12 330.62 Mb
memory used for image - step13 330.62 Mb	-> closed figure - DISABLED
memory used for image - step14 325.12 Mb	-> called garbage collector
total time =3D 1.28099989891
done
memory used 325.12 Mb
building file ...
memory used for image - step1 325.12 Mb
memory used for image - step2 325.12 Mb
memory used for image - step3 325.12 Mb
memory used for image - step4 325.12 Mb	-> created fig - gcf
memory used for image - step5 325.12 Mb	-> cleared fig
memory used for image - step6 322.65 Mb	-> built image - imshow
memory used for image - step7 322.65 Mb	-> added colorbar
memory used for image - step8 322.65 Mb	-> turned axis off
memory used for image - step9 330.63 Mb	-> saved fig
memory used for image - step10 330.63 Mb	-> cleared cached text
memory used for image - step11 330.63 Mb	-> cleared image (axes)
memory used for image - step12 330.63 Mb
memory used for image - step13 330.63 Mb	-> closed figure - DISABLED
memory used for image - step14 325.13 Mb	-> called garbage collector
total time =3D 1.31299996376
done
memory used 325.13 Mb
building file ...
memory used for image - step1 325.13 Mb
memory used for image - step2 325.13 Mb
memory used for image - step3 325.13 Mb
memory used for image - step4 325.13 Mb	-> created fig - gcf
memory used for image - step5 325.13 Mb	-> cleared fig
memory used for image - step6 322.62 Mb	-> built image - imshow
memory used for image - step7 322.63 Mb	-> added colorbar
memory used for image - step8 322.63 Mb	-> turned axis off
memory used for image - step9 330.64 Mb	-> saved fig
memory used for image - step10 330.64 Mb	-> cleared cached text
memory used for image - step11 330.64 Mb	-> cleared image (axes)
memory used for image - step12 330.64 Mb
memory used for image - step13 330.64 Mb	-> closed figure - DISABLED
memory used for image - step14 325.09 Mb	-> called garbage collector
total time =3D 1.31299996376
done
--
def generateImshow(yarray,
 xscansize,yscansize,
 xscanstep,yscanstep,
 outputfilename,
 initimagesize =3D 10):
 '''Use this function to generate matplotlib images without displaying
them'''
 #
 val =3D float(getMemoryUsage())/1000000
 print 'memory used for image - step1 ','%.2f' % val,' Mb'
 #reshape according to scan
 yarray =3D na.reshape(yarray,(yscansize,-1))
 val =3D float(getMemoryUsage())/1000000
 print 'memory used for image - step2 ','%.2f' % val,' Mb'
 #build image via matplotlib
 ximagesize =3D xscansize*xscanstep
 yimagesize =3D yscansize*yscanstep
 xyimageratio =3D float(ximagesize)/yimagesize
 #print xyimageratio
 if xyimageratio > 1: ximagesize,yimagesize =3D
initimagesize,initimagesize*xyimageratio
 else: ximagesize,yimagesize =3D initimagesize*xyimageratio,initimages=
ize
 val =3D float(getMemoryUsage())/1000000
 print 'memory used for image - step3 ','%.2f' % val,' Mb'
 #fig1 =3D pylab.figure(figsize=3D(ximagesize,yimagesize),dpi=3D100)
 #fig1 =3D pylab.figure(1,figsize=3D(ximagesize,yimagesize),dpi=3D100)
 fig1 =3D pylab.gcf()
 fig1.set_figsize_inches((ximagesize,yimagesize))
 fig1.set_dpi(100)
 val =3D float(getMemoryUsage())/1000000
 print 'memory used for image - step4 ','%.2f' % val,' Mb'
 fig1.clear()
 val =3D float(getMemoryUsage())/1000000
 print 'memory used for image - step5 ','%.2f' % val,' Mb'
 #pylab.title('blahblah')
 im1 =3D pylab.imshow(yarray,
 origin=3D'lower',
 #interpolation=3D'nearest', #i.e. pixel
 interpolation=3D'bicubic', #i.e. smooth
 #vmin=3Dminvalue,
 #vmax=3Dmaxvalue,
 cmap =3D pylab.cm.bone,
 )
 val =3D float(getMemoryUsage())/1000000
 print 'memory used for image - step6 ','%.2f' % val,' Mb'
 colbar1 =3D pylab.colorbar()
 val =3D float(getMemoryUsage())/1000000
 print 'memory used for image - step7 ','%.2f' % val,' Mb'
 #pylab.bone()
 pylab.axis('off')
 val =3D float(getMemoryUsage())/1000000
 print 'memory used for image - step8 ','%.2f' % val,' Mb'
 #save figure
 pylab.savefig(outputfilename)
 val =3D float(getMemoryUsage())/1000000
 print 'memory used for image - step9 ','%.2f' % val,' Mb'
 mpl.text.Text.cached =3D {}
 val =3D float(getMemoryUsage())/1000000
 print 'memory used for image - step10 ','%.2f' % val,' Mb'
 pylab.cla()
 val =3D float(getMemoryUsage())/1000000
 print 'memory used for image - step11 ','%.2f' % val,' Mb'
 del im1,colbar1 #doesn't bring anything
 val =3D float(getMemoryUsage())/1000000
 print 'memory used for image - step12 ','%.2f' % val,' Mb'
 #pylab.close(fig1)
 #pylab.close(1)
 val =3D float(getMemoryUsage())/1000000
 print 'memory used for image - step13 ','%.2f' % val,' Mb'
 #pylab.close('all')
 gc.collect()
 val =3D float(getMemoryUsage())/1000000
 print 'memory used for image - step14 ','%.2f' % val,' Mb'
-------------------------
Selon John Hunter <jdh...@ac...>:
> >>>>> "aurelien" =3D=3D aurelien gourrier <aur...@fr...> w=
rites:
>
> aurelien> Dear all, I posted a message two days ago mentionning
> aurelien> memory problems while saving a large number of images,
> aurelien> which I guess was not so clear... I've worked a bit on
> aurelien> it and I think the questions seem clearer to me now. I
> aurelien> have paid particular attention to the threads in the
> aurelien> user mailing list dealing with memory problems.
>
> What happens if you explicitly name the figure (ef figure(1))
>
> for i in range(indEnd):
>
> figure(1)
> subplot(221)
> plot(ind, xx)
>
> subplot(222)
> X =3D rand(50,50)
>
> imshow(X)
> subplot(223)
> scatter(rand(50), rand(50))
> subplot(224)
> pcolor(10*rand(50,50))
>
> savefig('tmp%d' % i, dpi =3D 75)
> close(1)
>
> See also the FAQ http://matplotlib.sourceforge.net/faq.html#LEAKS
> which shows the canonical way to make multiple plots to prevent leaks,
> namely, pairing a close with each figure creation?
>
> I'm not sure why you are seeing a problem right now, but my memory
> leak test script memleak_hawaii3.py does not appear to be leaking
>
> #!/usr/bin/env python
>
> import os, sys, time
> import matplotlib
> #matplotlib.interactive(True)
> #matplotlib.use('Cairo')
> matplotlib.use('Agg')
> from pylab import *
>
>
> def report_memory(i):
> pid =3D os.getpid()
> a2 =3D os.popen('ps -p %d -o rss,sz' % pid).readlines()
> print i, ' ', a2[1],
> return int(a2[1].split()[1])
>
>
>
> # take a memory snapshot on indStart and compare it with indEnd
>
> indStart, indEnd =3D 30, 201
> for i in range(indEnd):
>
> figure(1); clf()
>
> subplot(221)
> t1 =3D arange(0.0, 2.0, 0.01)
> y =3D sin(2*pi*t1)
> plot(t1,y,'-')
> plot(t1, rand(len(t1)), 's', hold=3DTrue)
>
>
> subplot(222)
> X =3D rand(50,50)
>
> imshow(X)
> subplot(223)
> scatter(rand(50), rand(50), s=3D100*rand(50), c=3Drand(50))
> subplot(224)
> pcolor(10*rand(50,50))
> savefig('tmp%d' % i, dpi =3D 75)
> close(1)
>
> val =3D report_memory(i)
> if i=3D=3DindStart: start =3D val # wait a few cycles for memory us=
age to
> stabilize
>
> end =3D val
> print 'Average memory consumed per loop: %1.4fk bytes\n' %
> ((end-start)/float(indEnd-indStart))
>
>
From: Graeme O'K. <gra...@pe...> - 2006年02月13日 05:40:34
thanks Charlie,
I'm using darwinports/python24 whereas the preinstalled environment 
which includes wxpython is python23.
I have only been able to find a scipy egg for python24, so at the 
moment, I am going to use scipy/numpy with matplotlib/Numeric.
I'll wait until matplotlib/numpy makes it into darwinports.
I'm not particularly wedded to the idea of using py-gtk2, is there 
any compelling reason to use wxpython over py-gtk2?
regards,
Graeme
On 10/02/2006, at 11:10 PM, Charlie Moad wrote:
> Wxpython comes preinstalled on 10.4 as does Tkinter. I am pretty
> sure that the eggs that Chris has posted in addition to mine link
> against those. You would probably need a custom build for
> darwinports to play nice. I can't test any of this, so I may not be
> much more help. Also, I have never tried gtkagg on osx since there is
> no native gtk2 toolkit. I am sure it would work fine with
> fink/darwinports gtk2 though under X11.app.
>
> On 2/9/06, Graeme O'Keefe <gra...@pe...> wrote:
>> Hi Charlie,
>>
>> I'm a bit new to the whole 'egg' thing.
>>
>> I retrieved the egg from Chris Fonnesbeck's homepage:
>> http://homepage.mac.com/fonnesbeck/mac/
>>
>> Anyway, the matplotlib data files issue is resolved, I have a copy of
>> mpl-data in my ~/.matplotlib directory now. It is picked up as 
>> default.
>>
>> I tried your egg, unfortunately, I've not been able to get wxWindows
>> installed via darwinports.
>> I tried TkAgg, problems as well (libJPEG conflict), so I look to have
>> a stuffed setup from darwinports.
>>
>> Do you have a GTKAgg backend you could add the egg?
>>
>> regards,
>>
>> Graeme
>>
>> On 09/02/2006, at 11:14 PM, Charlie Moad wrote:
>>
>>> On 2/8/06, Graeme O'Keefe <gra...@pe...> 
>>> wrote:
>>>> I'm trying to migrate from numarray to numpy.
>>>>
>>>> By and large it is reasonably painless, substituting itemsize for
>>>> itemsize()
>>>> and numarray.mlab.squeeze/tri with numpy.squeeze/tri are all I have
>>>> encountered so far.
>>>>
>>>> However, I have not been able to get the numpy distribution of
>>>> matplotlib
>>>> working on OS-X
>>>>
>>>> The matplotlib egg is installed to:
>>>> /Library/Frameworks/Python.framework/Versions/Current/lib/
>>>> python2.4/site-packages/matplotlib-0.86.2cvs-py2.4-macosx-10.4-
>>>> ppc.egg
>>>> where I also have installed:
>>>> numarray-1.5.1-py2.4-macosx-10.4-ppc.egg
>>>> numpy-0.9.5.2053-py2.4-macosx-10.4-ppc.egg
>>>> scipy-0.4.5.1597-py2.4-macosx-10.4-ppc.egg
>>>>
>>>>
>>>> then
>>>> % python
>>>>>>> import pylab
>>>> Traceback (most recent call last):
>>>> File "<stdin>", line 1, in ?
>>>> File
>>>> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/
>>>> site-packages/matplotlib-0.86.2cvs-py2.4-macosx-10.4-ppc.egg/
>>>> pylab.py",
>>>> line 1, in ?
>>>> from matplotlib.pylab import *
>>>> File
>>>> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/
>>>> site-packages/matplotlib-0.86.2cvs-py2.4-macosx-10.4-ppc.egg/
>>>> matplotlib/__init__.py",
>>>> line 744, in ?
>>>> defaultParams = {
>>>> File
>>>> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/
>>>> site-packages/matplotlib-0.86.2cvs-py2.4-macosx-10.4-ppc.egg/
>>>> matplotlib/__init__.py",
>>>> line 273, in wrapper
>>>> ret = func(*args, **kwargs)
>>>> File
>>>> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/
>>>> site-packages/matplotlib-0.86.2cvs-py2.4-macosx-10.4-ppc.egg/
>>>> matplotlib/__init__.py",
>>>> line 434, in _get_data_path
>>>> raise RuntimeError('Could not find the matplotlib data files')
>>>> RuntimeError: Could not find the matplotlib data files
>>>>
>>>> BTW, are there eggs for freetype/py-gtk etc. I've been using
>>>> darwinports
>>>> till now.
>>>
>>> Did you build and install the egg yourself, or did you download it
>>> from somewhere? Freetype won't have an egg since it is not a python
>>> library. In my tests I was able to add libpng and libfreetype 
>>> static
>>> libraries to the matplotlib egg and it worked fine. If you want, 
>>> you
>>> can try eggs I have posted for 0.86:
>>> http://euclid.uits.iupui.edu/~cmoad/mpleggs/ . The matplotlib 
>>> one has
>>> the static libs added, so I would be interested to know if it works
>>> for you. I can update these as well if you would like.
>>>
>>> - Charlie
>>>
>>
>>
>
From: Eric F. <ef...@ha...> - 2006年02月13日 01:22:27
Potential testers:
CVS mpl now has a new demo (examples/collections.py) that illustrates 
two minor new capabilities:
1) The axes.add_collection() method accepts a new boolean kwarg, 
"autolim"; if True, then a subsequent call to axes.autoscale_view will 
take into account the data in the collection.
2) LineCollection can now be called with kwargs
 "offsets=(xo,yo), transOffset=None"
to facilitate making waterfall plots or stagger plots--that is, a set of 
sequentially offset curves.
The demo may also be useful in illustrating some basic ways of using 
line and polygon collections; this is not entirely obvious from the 
docstrings. (I have tried to improve some of the docstrings also.)
The changes were prompted by Chris Barker's earlier message with a demo 
script, which showed me how to use the two transforms involved in these 
types of collections.
Eric

Showing 11 results of 11

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