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





Showing 11 results of 11

From: nicky v. f. <van...@gm...> - 2008年06月11日 21:54:08
Dear all,
I like to include a box and whisker plot as an eps in a latex
document. Does anybody know how to produce such a plot in black and
white, or some suitable gray scale? boxplot() does not accept color as
an argument. I also tried putting the function gray() before and after
boxplo(), but that does not work. Thanks in advance.
bye
Nicky
From: Michael H. <mh...@us...> - 2008年06月11日 21:05:33
John - Thanks for the quick fix. I'm having a separate issue now with 
an EPS file being generated (using savefig() again) that appears to be 
invalid (can't display it in OS X Preview, or convert to PDF with 
ps2pdf). Unfortunately, the code that creates this particular file is 
rather involved, and hard to replicate with one simple script.
If I send the offending EPS file (it's 1.4 MB zipped), is it possible to 
tell from that what the problem is?
The errors from ps2pdf are:
Error: /undefined in --get--
Operand stack:
 true --dict:43/43(ro)(L)-- .notdef
Execution stack:
 %interp_exit .runexec2 --nostringval-- --nostringval-- 
--nostringval-- 2 %stopped_push --nostringval-- 
--nostringval-- --nostringval-- false 1 %stopped_push 1905 
1 3 %oparray_pop 1904 1 3 %oparray_pop --nostringval-- 
1888 1 3 %oparray_pop 1771 1 3 %oparray_pop 
--nostringval-- %errorexec_pop .runexec2 --nostringval-- 
--nostringval-- --nostringval-- 2 %stopped_push 
--nostringval-- %finish_show --nostringval-- --nostringval-- 5 
4 0 --nostringval-- (pdf_text_enum_t) %op_show_continue 
--nostringval--
Dictionary stack:
 --dict:1144/1684(ro)(G)-- --dict:0/20(G)-- --dict:75/200(L)-- 
--dict:61/112(L)-- --dict:20/25(ro)(L)--
Current allocation mode is local
Last OS error: 2
Current file position is 996122
GPL Ghostscript 8.61: Unrecoverable error, exit code 1
--Mike
John Hunter wrote:
> On Wed, Jun 11, 2008 at 10:14 AM, John Hunter <jd...@gm...> wrote:
>
> 
>> Interesting. When I plot it on my screen it looks correct with a *Agg
>> GUI backend. But when I save it (either from the GUI or using
>> savefig) it has the problem you describe. This suggests to me that
>> either some cached information or something is not getting notified of
>> the different default dpi in savefig. I'll look into it. Since PS is
>> dpi independent, it would not affect it.
>> 
>
> Well, my diagnosis wasn't correct, but I fixed the problem. In the
> caching of the text layout, we were not taking into account the
> different renderers in the cache key. Since PS has a nominal dpi
> setting that is ignored by postscript, the differences in dpi were not
> getting picked up in the layout cache. The solution I implemented was
> to simply add the renderer id to the property tuple used for caching.
> Fixed in svn r5470.
>
> JDH
> 
-- 
------------------------------------------------------
Michael Hearne
mh...@us...
(303) 273-8620
USGS National Earthquake Information Center
1711 Illinois St. Golden CO 80401
Senior Software Engineer
Synergetics, Inc.
------------------------------------------------------
From: Joshua L. <dis...@gm...> - 2008年06月11日 18:28:10
You don't have to do everything that I did, but I have libpng and
whatnot installed in /usr/local for other purposes anyway, and I
didn't have a particular need to build a universal binary version of
matplotlib. Furthermore, using GCC 4.2, while forcing one to get rid
of Wno-long-double (an Apple-only thing anyway, and I think it's bad
practice to include assumption of such options in a Makefile), allowed
me to keep -O3 since it does not have that particular bug. So IF you
want to keep the O3 optimisation, then you should install the 4.2
compiler, make sure it gets used, and eliminate the -Wno-long-double
flag from the Makefile. No other changes necessary relative to the
standard instructions. I've filed a bug report with Apple about the
problem with their GCC 4.0.1 in Xcode 3, and as soon as I can get my
bug reporting ability up and running again (login has been wonky
lately), I'm following up with some additional information they asked
for. I'm sorry if I caused some confusion with my personal
preferences.
Josh
On Thu, Jun 5, 2008 at 5:19 PM, Christopher Burns <cb...@be...> wrote:
> Is this really the current solution to building matplotlib on OSX,
> installing a new compiler and hacking the python Makefile?
>
> I was able to build matplotlib 0.91.2 just fine on OSX, sometime
> around March I checked out the truck to fix a bug and discovered I
> couldn't build the svn version. Matplotlib is the only package with a
> dependency on gcc 4.2, all the other packages I build, numpy, scipy,
> ipython, etc... build with gcc 4.0. Why do you have this dependency?
> Is there an easier solution?
>
> I'm reluctant to upgrade to gcc 4.2 and loose the ability to build
> other packages I need.
>
> Chris
>
> On Thu, May 29, 2008 at 4:51 AM, Joshua Lippai <dis...@gm...> wrote:
>> I've consistently been able to build matplotlib on OS X. Just make
>> sure you have all the dependencies installed. Personally, I have lbpng
>> and whatnot installed in /usr/local instead of /usr/X11. I don't know
>> if that'll help. Also, I use the GCC 4.2 that Apple has available for
>> download on developer.apple.com. Then you just change the Makefile in
>> the /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/config/
>> directory to not use Wno-long-double or no-cpp-precomp. I also took
>> out all the ppc arch flags since it was causing some issues there with
>> my versions of libpng and whatnot technically not being universal
>> binaries. If you don't want to build univeral binary versions of your
>> dependencies or use the ones alread provided in /usr/X11 (which are
>> universal I think), you should make Python only build for your
>> architecture, which is what I did.
>>
>> My only issue with matplotlib thusfar seems to be the inability to do
>> the plot3d examples from the scipy website, but I'm told that stuff is
>> officially unsupported anyway.
>>
>> Josh
>>
>
> --
> Christopher Burns
> Computational Infrastructure for Research Labs
> 10 Giannini Hall, UC Berkeley
> phone: 510.643.4014
> http://cirl.berkeley.edu/
>
From: Eric F. <ef...@ha...> - 2008年06月11日 16:52:03
Marshall,
You are right--there is a line of boilerplate that I left out of quiver, 
contour, and contourf. At the very top of each of these methods in 
axes.py there should be the line
 if not self._hold: self.cla()
You can either add the line to your axes.py, or just do the manual pylab 
cla() before each call to quiver in your script.
Eric
Marshall Tappen wrote:
> Hello,
> 
> I'm having problems making quiver respect the hold state of the plot
> For example, running this code:
> 
> from pylab import *
> 
> def quiver_test():
> x,y=mgrid[-10:10,-10:10]
> 
> u=2*x;
> v=2*y;
> hold(False)
> quiver(x,y,u,v,hold=False)
> quiver(x,y,u,u,hold=False)
> draw()
> 
> quiver_test()
> 
> Two sets of quiver plots appear. I'm using the packages from Ubuntu
> Hardy in ipython, but I didn't see anything in the changelog for
> 0.91.3 relating to quiver.
> 
> Any suggestions for fixing this behavior would be greatly appreciated.
> 
> Thanks,
> 
> Marshall
> 
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: John H. <jd...@gm...> - 2008年06月11日 15:36:34
On Wed, Jun 11, 2008 at 10:14 AM, John Hunter <jd...@gm...> wrote:
> Interesting. When I plot it on my screen it looks correct with a *Agg
> GUI backend. But when I save it (either from the GUI or using
> savefig) it has the problem you describe. This suggests to me that
> either some cached information or something is not getting notified of
> the different default dpi in savefig. I'll look into it. Since PS is
> dpi independent, it would not affect it.
Well, my diagnosis wasn't correct, but I fixed the problem. In the
caching of the text layout, we were not taking into account the
different renderers in the cache key. Since PS has a nominal dpi
setting that is ignored by postscript, the differences in dpi were not
getting picked up in the layout cache. The solution I implemented was
to simply add the renderer id to the property tuple used for caching.
Fixed in svn r5470.
JDH
From: Marshall T. <mt...@gm...> - 2008年06月11日 15:29:29
Hello,
I'm having problems making quiver respect the hold state of the plot
For example, running this code:
from pylab import *
def quiver_test():
 x,y=mgrid[-10:10,-10:10]
 u=2*x;
 v=2*y;
 hold(False)
 quiver(x,y,u,v,hold=False)
 quiver(x,y,u,u,hold=False)
 draw()
quiver_test()
Two sets of quiver plots appear. I'm using the packages from Ubuntu
Hardy in ipython, but I didn't see anything in the changelog for
0.91.3 relating to quiver.
Any suggestions as to fixing this behavior would be greatly appreciated.
Thanks,
Marshall
From: John H. <jd...@gm...> - 2008年06月11日 15:14:59
On Mon, Jun 9, 2008 at 3:35 PM, Michael Hearne <mh...@us...> wrote:
> savefig('textplot.eps')
> savefig('textplot.png')
> close(fig)
Interesting. When I plot it on my screen it looks correct with a *Agg
GUI backend. But when I save it (either from the GUI or using
savefig) it has the problem you describe. This suggests to me that
either some cached information or something is not getting notified of
the different default dpi in savefig. I'll look into it. Since PS is
dpi independent, it would not affect it.
Thanks for the reminder.
JDH
From: Michael H. <mh...@us...> - 2008年06月11日 15:05:49
I'm reposting this, as it may have gotten lost in other discussions. I 
think there is possibly a bug in the PNG renderer for TkAgg (which is 
what I think I'm using when I say "matplotlib.use('agg')"), as I get 
different visual results from savefig when saving to EPS and PNG. If 
this isn't a bug, can someone please let me know what I'm doing wrong, 
or point me to a workaround for saving to PNG files?
Thanks,
Mike
-------- Original Message --------
Subject: 	[Matplotlib-users] bounding box functionality with text() 
function
Date: 	2008年6月09日 14:35:24 -0600
From: 	Michael Hearne <mh...@us...>
Reply-To: 	mh...@us...
To: 	MatPlotLib Users <mat...@li...>
I'm having a problem with the bbox keyword to the text() function. The 
code below, for me, results in one postscript file that looks fine, but 
the PNG file has letters outside of the bounding box for most of the 
words I plot.
I'm using matplotlib '0.98pre' on Mac OS X.
import matplotlib
matplotlib.use('agg')
from pylab import *
x = array([6,7,8,9,10])
y = array([6,7,8,9,10])
fig = figure()
plot(x,y,'rx')
hold('on')
fontdict2 = {'fontweight':'light',
 'color': 'k',
 'fontsize':9}
words = ['Hi','Goodbye','What''s this','Aloha','So long, farewell']
for i in range(0,len(x)):
 tx = x[i]
 ty = y[i]
 word = words[i]
 text(tx,ty,word,fontdict2,bbox={'facecolor':'w'})
savefig('textplot.eps')
savefig('textplot.png')
close(fig)
-- 
------------------------------------------------------
Michael Hearne
mh...@us...
(303) 273-8620
USGS National Earthquake Information Center
1711 Illinois St. Golden CO 80401
Senior Software Engineer
Synergetics, Inc.
------------------------------------------------------
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Matplotlib-users mailing list
Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
-- 
------------------------------------------------------
Michael Hearne
mh...@us...
(303) 273-8620
USGS National Earthquake Information Center
1711 Illinois St. Golden CO 80401
Senior Software Engineer
Synergetics, Inc.
------------------------------------------------------
From: Marshall T. <mt...@ee...> - 2008年06月11日 14:04:22
Hello,
I'm having problems making quiver respect the hold state of the plot
For example, running this code:
from pylab import *
def quiver_test():
 x,y=mgrid[-10:10,-10:10]
 u=2*x;
 v=2*y;
 hold(False)
 quiver(x,y,u,v,hold=False)
 quiver(x,y,u,u,hold=False)
 draw()
quiver_test()
Two sets of quiver plots appear. I'm using the packages from Ubuntu
Hardy in ipython, but I didn't see anything in the changelog for
0.91.3 relating to quiver.
Any suggestions for fixing this behavior would be greatly appreciated.
Thanks,
Marshall
From: Scott S. <sin...@uk...> - 2008年06月11日 10:29:53
Here's a response to a similar question a few weeks back:
http://www.nabble.com/Kriging-with-Matplotlib-to17281645.html
I haven't tried using the RandomRealizations package yet, but it looks good and well documented.
Regards,
Scott
>>> Lionel Roubeyrie <lro...@li...> 06/11/08 8:47 AM >>>
Hi Jeff,
Do you have in your bags a similar approch but using kriging? For the moment 
we use R via Rpy to make the computation, but if you know a more pythonic way 
to do so, I'll appreciate :-)
Cordialy
Please find our Email Disclaimer here: http://www.ukzn.ac.za/disclaimer/
From: Lionel R. <lro...@li...> - 2008年06月11日 06:48:03
Hi Jeff,
Do you have in your bags a similar approch but using kriging? For the moment 
we use R via Rpy to make the computation, but if you know a more pythonic way 
to do so, I'll appreciate :-)
Cordialy
Le mardi 10 juin 2008, Jeff Whitaker a écrit :
> Jason Li wrote:
> > Hi Jeff,
> >
> > Thanks for your help in the past. Just wondering if I can ask another
> > question. This is with regard to plotting irregularly spaced geophysical
> > data.
> >
> > I have been happy plotting gridded data away using matplotlib/basemap.
> > Now I want to try irregularly spaced satellite data (swath data), using
> > the confourf function. Basically to replace our IDL program to make
> > plots like this:
> >
> > http://aurapar2u.ecs.nasa.gov/airscal2/Aqua_AIRS_Level1/AIRIBRAD.005/2008
> >/001/AIRS.2008年01月01日.067.L1B.AIRS_Rad.v5.0.0.0.G08003111751.hdf.jpg
> >
> >
> >
> > I have not had much luck yet. In the following example, lat and lon are
> > 2D arrays.
> >
> > map = Basemap(projection='cyl', lon_0=0, ax=ax, llcrnrlon=minLon,
> > llcrnrlat=minLat, urcrnrlon=maxLon, urcrnrlat=maxLat)
> > x, y = map(lon, lat)
> > cs = map.contourf(x, y, obs, levels, cmap=myPrettyCmap)
> >
> > The error message:
> >
> > File
> > "/usr/local//lib/python2.5/site-packages/matplotlib/toolkits/basemap/base
> >map.py", line 2442, in contourf
> > xl = xx.compress(condition).tolist()
> > AttributeError: compress
> >
> >
> > Do you have a good example as how to do this kind of thing?
> >
> > thanks
>
> Jason: contourf expects gridded data. I think you need to use one of
> the approaches outlined in the cookbook entry
>
> http://www.scipy.org/Cookbook/Matplotlib/Gridding_irregularly_spaced_data
>
> to grid your data, then plot it.
>
> If you'd like to send me a sample of the data, I can show you what I mean.
>
> -Jeff
-- 
Lionel Roubeyrie - lro...@li...
Chargé d'études et de maintenance
LIMAIR - la Surveillance de l'Air en Limousin
http://www.limair.asso.fr

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