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






Showing 12 results of 12

From: John H. <jdh...@ac...> - 2006年12月19日 17:19:44
>>>>> "Lionel" == Lionel Roubeyrie <lro...@li...> writes:
 Lionel> Arg, I hoped that you would not say that :-) Le Mardi 19
It's not too bad, actually:
from pylab import figure, show, nx, cm
from matplotlib.transforms import blend_xy_sep_transform
fig = figure()
ax = fig.add_subplot(111)
X = 100*nx.mlab.randn(256,256)
im = ax.imshow(X, cmap=cm.jet)
cax = fig.colorbar(im)
labels = (100., 'peak1'), (-100, 'peak2')
trans = blend_xy_sep_transform(cax.transAxes, cax.transData)
for y, label in labels:
 cax.text(-0.05, y, label, ha='right', va='center', transform=trans)
show()
From: Lionel R. <lro...@li...> - 2006年12月19日 16:17:18
Arg, I hoped that you would not say that :-)
Le Mardi 19 D=E9cembre 2006 16:39, Jeff Whitaker a =E9crit=A0:
> Lionel Roubeyrie wrote:
> > Hi all,
> > I don't find any doc on this point, then I post my question here: is it
> > possible to set texts with a colorbar, like a legend?
> > You can have a look of what I want here:
> > http://www.limair.asso.fr/previsions2/index.php (just click "OK")
> > thanks
>
> Lionel: I don't think there is any automatic way to do this, but you
> can do it manually with pylab.text
> (http://matplotlib.sourceforge.net/matplotlib.pylab.html#-text).
>
> -Jeff
=2D-=20
Lionel Roubeyrie - lro...@li...
LIMAIR
http://www.limair.asso.fr
Sorry for the previsou post. Tweaking a bit I found that probably the 
problem is not in the visualisation but in cleaning memory.
I use a function to make four plot calling two subfunction.
the plot are called plotrisp and plotlev in everyone of them any tome i 
use a figure I also close it. But if I only use one fuction it do the 
plot. WhenI try to use them to plot no way it stuck in the end.
So I had the same problem while calling multiple plots with multiple 
function
Any help would be appreciated and sorry for the dup post
 nstep=30
Giorgio
From: Jeff W. <js...@fa...> - 2006年12月19日 15:39:49
Lionel Roubeyrie wrote:
> Hi all,
> I don't find any doc on this point, then I post my question here: is it 
> possible to set texts with a colorbar, like a legend?
> You can have a look of what I want here:
> http://www.limair.asso.fr/previsions2/index.php (just click "OK")
> thanks
>
> 
Lionel: I don't think there is any automatic way to do this, but you 
can do it manually with pylab.text 
(http://matplotlib.sourceforge.net/matplotlib.pylab.html#-text).
-Jeff
-- 
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jef...@no...
325 Broadway Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
From: Lionel R. <lro...@li...> - 2006年12月19日 15:07:50
Hi all,
I don't find any doc on this point, then I post my question here: is it 
possible to set texts with a colorbar, like a legend?
You can have a look of what I want here:
http://www.limair.asso.fr/previsions2/index.php (just click "OK")
thanks
-- 
Lionel Roubeyrie - lro...@li...
LIMAIR
http://www.limair.asso.fr
From: Giorgio L. <gio...@ch...> - 2006年12月19日 15:06:53
Attachments: pyreg.py
I've retried reloading the matrices after restaring everything twice and 
it seems to plot. Probably the problem is that the memory is "occupied" 
from previous plots. I noticed also that the possibility to command come 
back to the console only after the last plot is close manually ..any hints
Is there a way to "clean" the memory for a new start.. the command close 
doesn't seem to work ?
Here's the module that make the only previous plot before trying to do 
the meshcountour
From: John H. <jdh...@ac...> - 2006年12月19日 14:59:39
>>>>> "David" == David Cournapeau <da...@ar...> writes:
 David> In make_image, most of the time is taken into to_rgba:
 David> almost half of it is taken in by the take call in the
 David> Colormap.__call__. Almost 200 ms to get colors from the
 David> indexes seems quite a lot (this means 280 cycles / pixel on
 David> average !). I can reproduce this number by using a small
 David> numpy test.
 David> On my laptop (pentium M, 1.2 Ghz), make_image takes almost
 David> 85 % of the time, which seems to imply that this is where
 David> one should focus if one wants to improve the speed,
This may have been lost in the longer thread above, but what
interpolation are you using? You may see a good performance boost by
using interpolation='nearest'. Also, with your clip changes and with
Eric's changes is it still painfully slow for you -- how much have
these changes helped? Of time time spent in make image, how much is
_image.fromarray, ScalarMappable.to_rgba and _image.resize?
From: John H. <jdh...@ac...> - 2006年12月19日 14:51:07
>>>>> "Olivier" == Olivier ATTEIA <Oli...@eg...> writes:
 Olivier> Hello, sorry to bother you but I did not find a reply
 Olivier> elsewhere, I am using matplotlib with python 2.4 and
 Olivier> windows XP and it is a really nice tool. It is inside a
 Olivier> wxapplication. I have a problem because the user can
 Olivier> change the graph settings as he wants and draws several
 Olivier> times contours from 50 by 200 matrices. After some time
 Olivier> the program slows down and the memory is increasing
 Olivier> regularly. I don't understand because I use a command
 Olivier> similar as in matplotlib clear command : collections=[]
 Olivier> between each drawing. I tried in a simpler way : just
 Olivier> start matplotlib(even in tk mode), make a plot(x,y) with
 Olivier> x=randn(100,100). First it takes a lot of memory (more
 Olivier> than 50 Mb). And when you clear hte figure the meory
 Olivier> remains high, or when you set holds(False) and make a
 Olivier> simple plot the first plot disappears but the memory is
 Olivier> still high. Do you have any idea Thanks a lot Sincerely
 Olivier> O. Atteia
Hey Olivier, questions should go to the matplotlib-users mailing
list. I'm forwarding this on. You can subscribe at 
http://sourceforge.net/mailarchive/forum.php?forum_id=33405
JDH
From: Giorgio L. <gio...@ch...> - 2006年12月19日 14:17:16
Hello to all,
I'm finishing to convert a module for linear regression that I used in 
Matlab. It takes an experimental matrix, and a response matrix perform a 
regression and a bit of plot and then give me 3 matrices that I need to 
plot response surface and leverage surface. For plotting leverage and 
response I need to create a kind of grid of point with another program. 
and at this point everything work fine (checked also in comparison with 
matlab). The problems come when I tri to plot it. For a step of 2 (not 
really a grid) it works with 30 steps everything crashes :(
so nste=2 work nstep=30 not
I attach the file that give no problems it's a module with included the 
matrix to be plotted with nstep=2 and also the problematic one. a 
function with the same name of the plot and the matrices that give the 
problems.
Every help would be greatly appreciated because if I fix it I can get 
rid of the regression program in matlab that i generally use really a 
lot in my everyday job
Giorgio
From: Xavier G. <gn...@ob...> - 2006年12月19日 13:16:32
Christopher Barker wrote:
> yardbird wrote:
> =20
>> On Saturday 16 December 2006 19:42, Xavier Gnata wrote:
>> =20
>
> =20
>>> Each time I'm working on C++ codes using vector or valarray, I would
>>> like to be able to plot them.
>>> =20
>
> =20
>> you should really check out the Boost::Python libraries. They allow yo=
u, among=20
>> other things, to expose your C++ container classes as python objects. =
I'm=20
>> using them heavily in my project and I'm very satisfied.
>> =20
>
> What this means is that you'd be using python to drive your C++ code,=20
> rather than using C++ code to drive a python/mpl code. In addition to=20
> Boost::Python, there are some other options to consider:
>
> pyrex, Cxx, SWIG.
>
> The other option is to use your C++ code to drive Python. This can be=20
> done by embedding a python interpreter in your C++ app. See the=20
> odfficial pyhton docs, and lots of other stuff online.
>
> You also might want to check out Elmer:
>
> http://elmer.sourceforge.net/
>
> I've never used it, but it looks pretty cool. It's a tool that provides=
=20
> the infrastructure for calling python from C/C++.
>
> Honestly, though, I'd go with the first approach -- drive your C++ code=
=20
> from Python -- I think that in addition to making it easy to plot=20
> results, etc, you'll be able to write unit tests, etc in python, and=20
> even get a full scripting engine, which could turn out to be very usefu=
l..
>
> -Chris
> =20
Hi,
I do agree that driving C++ from python looks easier thant driving
python from C++.
However, I really would like to inclue python code into my C++ code and
not the opposite (I have special needs so I really have to do that).
I'm going to have a look at embedding python.
Has anyone experience with that?
=20
Xavier
--=20
############################################
Xavier Gnata
CRAL - Observatoire de Lyon
9, avenue Charles Andr=E9
69561 Saint Genis Laval cedex
Phone: +33 4 78 86 85 28
Fax: +33 4 78 86 83 86
E-mail: gn...@ob...
############################################=20
From: Tarek H. <ta...@ho...> - 2006年12月19日 12:52:25
Hi guys,
I'm trying to run the pcolor demo on my own data. I have an image and I 
need to draw the hot colormap on it. Can you advise on how I can do it? 
Sorry I'm not from the computer field so please try to be clear.
Thanks so much in advance,
Regards,
_________________________________________________________________
Think you're a film buff? Play the Movie Mogul quiz and win fantastic 
prizes! http://www.msnmoviemogul.com
From: David C. <da...@ar...> - 2006年12月19日 07:14:13
David Cournapeau wrote:
> Eric Firing wrote:
>> There is a clip function in all three numeric packages, so a native 
>> clip is being used.
>>
>> If numpy.clip is actually slower than your version, that sounds like a 
>> problem with the implementation in numpy. By all logic a single clip 
>> function should either be the same (if it is implemented like yours) 
>> or faster (if it is a single loop in C-code, as I would expect). This 
>> warrants a little more investigation before changing the mpl code. 
>> The best thing would be if you could make a simple standalone numpy 
>> test case profiling both versions and post the results as a question 
>> to the numpy-discussion list. Many such questions in the past have 
>> resulted in big speedups in numpy.
> I am much more familiar with internal numpy code than matplotlib's, so 
> this is much easier for me, too :)
>> One more thought: it is possible that the difference is because myclip 
>> operates on the array in place while clip generates a new array. If 
>> this is the cause of the difference then changing your last line to 
>> "return a.copy()" probably would slow it down to the numpy clip speed 
>> or slower.
> It would be scary if a copy of a 8008x256 array of double took 100 ms... 
> Fortunately, it does not, this does not seem to be the problem.
>
> cheers,
>
> David
Ok, so now, with my clip function, still for a 8000x256 double array: we 
have show() after imshow which takes around 760 ms. 3/5 are in 
make_image, 2/5 in the function blop, which is just an alias I put to 
measure the difference between axes.py:1043(draw) and image.py:173(draw) 
in the function Axis.draw (file axes.py):
 def blop(dsu):
 for zorder, i, a in dsu:
 a.draw(renderer)
 blop(dsu)
In make_image, most of the time is taken into to_rgba: almost half of it 
is taken in by the take call in the Colormap.__call__. Almost 200 ms to 
get colors from the indexes seems quite a lot (this means 280 cycles / 
pixel on average !). I can reproduce this number by using a small numpy 
test.
On my laptop (pentium M, 1.2 Ghz), make_image takes almost 85 % of the 
time, which seems to imply that this is where one should focus if one 
wants to improve the speed,
cheers,
David

Showing 12 results of 12

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