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



Showing 16 results of 16

From: frank h. <fra...@gm...> - 2005年11月03日 23:11:43
Hello,
I am trying to use matplotlib in a cgi script and I always get an error
the following script is the simplest script that reproduces the error
=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=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
#!/sw/bin/python2.4
from pylab import *
=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=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
and the error is always:
 File "/Library/WebServer/CGI-Executables/ldapstats.py", line 11, in ?
 from matplotlib.ticker import *
 File "/sw/lib/python2.4/site-packages/matplotlib/__init__.py", line 862, =
in ?
 rcParams =3D rc_params()
 File "/sw/lib/python2.4/site-packages/matplotlib/__init__.py", line
810, in rc_params
 fname =3D matplotlib_fname()
 File "/sw/lib/python2.4/site-packages/matplotlib/__init__.py", line
786, in matplotlib_fname
 fname =3D os.path.join(get_configdir(), 'matplotlibrc')
 File "/sw/lib/python2.4/site-packages/matplotlib/__init__.py", line
261, in wrapper
 ret =3D func(*args, **kwargs)
 File "/sw/lib/python2.4/site-packages/matplotlib/__init__.py", line
352, in _get_configdir
 raise RuntimeError("'%s' is not a writable dir; you must set
environment variable HOME to be a writable dir "%h)
RuntimeError: '/Library/WebServer' is not a writable dir; you must set
environment variable HOME to be a writable dir
what am i doing wrong?
any insight is appreciated
thanks,
-frank
From: Chris B. <Chr...@no...> - 2005年11月03日 18:04:06
Robert Kern wrote:
> Since one can have both Numeric and numarray enabled for numerix and
> certainly more than one backend built, the user still has to edit the
> matplotlibrc to specify their choice.
Yes, but I always like the concept of "sensible defaults", which in this 
case, at least something that will work on the users system!
That being said:
> It think that it's a clearer procedure to:
> 
> 1) Edit matplotlibrc to set the intended defaults for the
> installation-wide matplotlibrc.
> 2) python setup.py build install
> 3) Possibly customize a ~/.matplotlib/matplotlibrc for a given user.
Fair enough, let's just make sure that this procedure is well outlined 
in the docs. There are enough questions here making it clear that it's 
not clear from the docs that EVERYONE should at least examine their 
.matplotlibrc when installing.
Another couple thoughts:
1) I'm wondering if there's a way to pre-define different defaults for 
different platforms. For example, I built an OS-X installer that doesn't 
support GTK, but the .matplotlibrc still had GtkAgg as the default. Yes, 
I could have edited the .matplotlib rc in my installer, but I'd have to 
do that each time I built a new one. It would be nice to have something 
in CVS that just worked.
2) Perhaps we could make the processing of matplotlibrc smarter. For 
example: if numarray is specified, but not installed, and Numeric is, 
it could roll over to Numeric. Same thing with back-ends. Of course, 
this kind of breaks the "explicit is better than implicit" rule, but it 
would greatly improve the "It just works" qualities of MPL.
-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: Jeff W. <js...@fa...> - 2005年11月03日 17:50:18
Brian Donovan wrote:
> Dr. Whitaker,
>
> Thank you for helping me with this. My point of confusion is what 
> should nx and ny contain when they are sent into the transform_scalar 
> function:
>
>
Brian: nx and ny define the resolution of the transformed grid - you 
should choose them so that the grid spacing on the transformed grid is 
at least as fine as the original lat/lon grid.
-Jeff
-- 
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/CDC R/CDC1 Email : Jef...@no...
325 Broadway Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
From: Robert K. <rk...@uc...> - 2005年11月03日 17:44:10
Chris Barker wrote:
> Robert Kern wrote:
> 
>> What's the value of the option "numerix" in your matplotlibrc? If you
>> want to use Numeric, then it should look like this:
>>
>> numerix : Numeric # Numeric or numarray
>>
>> For the most part, this is a run-time setting rather than a build-time
>> setting, so it shouldn't be set by setup.py.
> 
> Well, yes and no. setup.py does a nice job of figuring out what is on
> the system, and building an MPL that works with the components that are
> installed. After that, however, it installs a generic .matplotlibrc
> file. Is is just too much of a PITA to have setup.py build a custom
> .matplotlibrc that reflects the just-built matplotlib?
It can be. Customizing the distutils build process is always a very
fragile thing and should be avoided whenever possible.
> Numeric-numarray is one issue, default back end is the other, and I'm
> sure there are others.
Since one can have both Numeric and numarray enabled for numerix and
certainly more than one backend built, the user still has to edit the
matplotlibrc to specify their choice. It think that it's a clearer
procedure to:
1) Edit matplotlibrc to set the intended defaults for the
installation-wide matplotlibrc.
2) python setup.py build install
3) Possibly customize a ~/.matplotlib/matplotlibrc for a given user.
It's clear. It works in every environment. It works for every
customization one might want to do (i.e. for things that can't be
determined at build-time, like the fonts one wants as default).
-- 
Robert Kern
rk...@uc...
"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
 -- Richard Harter
From: Alexander M. <ale...@co...> - 2005年11月03日 17:39:07
Dr. Kienzle,
Did you get my message before about improving the pcolor function by 
changing the way the "verts" array is created? Although I couldn't get it to 
work on my machine (maybe because I'm not actually re-building it, I'm just 
editing the source file and then exiting and restarting) someone else on the 
mailing list said he didn't have problems. If you can, make those changes 
and report back to me on how wll they work.
Also, is it just the "pcolor" function that is too slow or is the "draw" 
function too slow as well?
-Alex Mont
----- Original Message ----- 
From: "Paul Kienzle" <pki...@ja...>
To: "John Hunter" <jdh...@ni...>
Cc: "Alexander Mont" <ale...@co...>; 
<mat...@li...>
Sent: Thursday, November 03, 2005 11:10 AM
Subject: Re: [Matplotlib-users] Memory leak with pcolor
> On Tue, Nov 01, 2005 at 09:41:35PM -0600, John Hunter wrote:
>> >>>>> "Alexander" == Alexander Mont <ale...@co...> writes:
>>
>> Alexander> Thanks for your advice with installing matplotlib on
>> Alexander> cygwin. I downloaded and installed the windows binaries
>> Alexander> and it worked. Anyway, the reason that I didn't want
>> Alexander> to use binaries in the first place was because I wanted
>> Alexander> to modify the matplotilb source code. But it seems like
>> Alexander> even with the binaries, if I change the source code
>> Alexander> then it will still affect the operation of the program
>> Alexander> when I run it, which is what I want.
>>
>> Alexander> In particular, I am looking to speed up the pcolor()
>> Alexander> function because it runs exceedingly slow with large
>> Alexander> mesh sizes. I believe the reason it is running slow is
>> Alexander> because of a memory leak. When I do the following:
>>
>> Alexander> from pylab import * n=200
>> Alexander> [x,y]=meshgrid(arange(n+1)*1./n,arange(n+1)*1./n)
>> Alexander> z=sin(x**2 + y**2)
>>
>> Alexander> and then do
>>
>> Alexander> pcolor(x,y,z)
>>
>> Alexander> repeatedly, the memory usage increases by about 15 MB
>> Alexander> each time, and it runs progressively slower.each
>>
>> At least with matplotlib CVS (and I don't think it's a CVS vs 0.84
>> issue) the memory consumption is rock solid with your example (see
>> below for my test script). What is your default "hold" setting in rc?
>> If True, you will be overlaying plots and will get the behavior you
>> describe. In the example below, I make sure to "close" the figure
>> each time -- a plain clear with clf should suffice though. My guess
>> is that you are repeatedly calling pcolor with hold : True and are
>> simply overlaying umpteen pcolors (to test for this, print the length
>> of the collections list
>>
>> ax = gca()
>> print len(ax.collections)
>>
>> if this length is growing, you've found your problem. A simple
>>
>> pcolor(x,y,z,hold=False)
>>
>> should suffice.
>>
>> You can also change the default hold setting in your config file
>> http://matplotlib.sf.net/matplotlibrc
>>
>> JDH
>
> I can confirm that memory leaks indeed are not a problem with a CVS build
> on Debian. I can't seem to restore the pre-built Debian stable 0.82 so
> I haven't tested it.
>
> However, the problem is still that pcolor is too slow to use it
> interactively on a plot with a half-dozen 200x608 warped grids, even
> with shading='flat' and no antialiasing.
>
> Would you consider accepting a 'structured grid' as a primitive patch
> type? What consequence will this have for your various backends?
> Presumably someone will want triangular meshes as well if they are
> doing serious FEM work.
>
> I created a prototype app using OpenGL and quad strips. The performance
> with this is acceptable, but I need a lot more 2D graphing features.
> I would much rather make an existing product better than rewrite from
> scratch.
>
> In my particular case the grid warping function can be expressed
> analytically. Is it reasonable to consider warping a 2D image directly
> using an AGG filter function? Could this be embedded in an existing
> matplotlib graph, above some objects and below others?
>
> Thanks in advance,
>
> Paul Kienzle
> pki...@ni...
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App Server. 
> Download
> it for free - -and be entered to win a 42" plasma tv or your very own
> Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
From: Chris B. <Chr...@no...> - 2005年11月03日 17:11:08
Robert Kern wrote:
> What's the value of the option "numerix" in your matplotlibrc? If you
> want to use Numeric, then it should look like this:
> 
> numerix : Numeric # Numeric or numarray
> 
> For the most part, this is a run-time setting rather than a build-time
> setting, so it shouldn't be set by setup.py.
Well, yes and no. setup.py does a nice job of figuring out what is on 
the system, and building an MPL that works with the components that are 
installed. After that, however, it installs a generic .matplotlibrc 
file. Is is just too much of a PITA to have setup.py build a custom 
.matplotlibrc that reflects the just-built matplotlib?
Numeric-numarray is one issue, default back end is the other, and I'm 
sure there are others.
For that matter, it would be nice if some of the defaults were better 
tuned for platform: gtk is not the best choice for OS-X for example. 
speaking of which, how is the Cocoa back-end doing?
-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: Brian D. <do...@mi...> - 2005年11月03日 17:06:54
Dr. Whitaker,
 Thank you for helping me with this. My point of confusion is what 
should nx and ny contain when they are sent into the transform_scalar 
function:
>> xydata = m.transform_scalar(latlondata,lons,lats,nx,ny)
Thanks,
Brian
On Nov 2, 2005, at 9:32 PM, Jeff Whitaker wrote:
> Jeff Whitaker wrote:
>> Brian Donovan wrote:
>>> basemap folks,
>>>
>>> I'm trying to understand how the transform_scalar function 
>>> works. What are the units of the native projection grid and how 
>>> are they determined? I'm trying to scale a scalar data field and 
>>> overlay it on the map. Does the location of the origin matter 
>>> when I do this? To be clear here's what I'm trying to do.
>>>
>>> 1) I have a Numeric array with a scalar field
>>> 2) I want to overlay this onto a map projection
>>> 3) The data is slightly larger than the map area (in terms of 
>>> latitude and longitude)
>>> 4) From the examples it seams like transform_scalar and then 
>>> imshow can be used to show the data
>>> 5) I can't seem to use transform_scalar properly
>>>
>>> Thanks is advance,
>>>
>>> Brian
>> Brian: I'm going to assume your data (latlondata) is on a 
>> latitude/longitude grid with latitudes lats and longitude lons, 
>> and you have created a Basemap instance for your projection 
>> regrion (m). Then, to create a nx by ny grid to overlay on the 
>> map, all you need is
>>
>> xydata = m.transform_scalar(latlondata,lons,lats,nx,ny)
>>
>> you can then overlay xydata on the map with
>>
>> im = x.imshow(xydata, cm.jet)
>>
>> You only need to do this to plot the data with imshow - with 
>> pcolor or contourf you can plot the data on the original lat/lon 
>> grid using
>>
>> x,y = m(lons,lons)
>>
>> cs = m.contourf(x,y,latlondata,20,cmap=cm.jet)
>>
>> or
>>
>> im = m.pcolor(x,y,latlondata,shading='flat',cmap=cm.jet)
>>
>> HTH,
>>
>> -Jeff
>>
>>
> Brian:
>
> One correction -
>
> lons and lats are 1-d arrays describing the lat/lon grid, so 
> instead of
>
> x,y = m(lons,lats)
>
> you'll need
>
> lons, lats = pylab.meshgrid(lons, lats)
> x, y = m(lons, lats)
>
> -Jeff
>
> -- 
> Jeffrey S. Whitaker Phone : (303)497-6313
> Meteorologist FAX : (303)497-6449
> NOAA/OAR/CDC R/CDC1 Email : Jef...@no...
> 325 Broadway Office : Skaggs Research Cntr 1D-124
> Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
From: Paul K. <pki...@ja...> - 2005年11月03日 16:10:59
On Tue, Nov 01, 2005 at 09:41:35PM -0600, John Hunter wrote:
> >>>>> "Alexander" == Alexander Mont <ale...@co...> writes:
> 
> Alexander> Thanks for your advice with installing matplotlib on
> Alexander> cygwin. I downloaded and installed the windows binaries
> Alexander> and it worked. Anyway, the reason that I didn't want
> Alexander> to use binaries in the first place was because I wanted
> Alexander> to modify the matplotilb source code. But it seems like
> Alexander> even with the binaries, if I change the source code
> Alexander> then it will still affect the operation of the program
> Alexander> when I run it, which is what I want.
> 
> Alexander> In particular, I am looking to speed up the pcolor()
> Alexander> function because it runs exceedingly slow with large
> Alexander> mesh sizes. I believe the reason it is running slow is
> Alexander> because of a memory leak. When I do the following:
> 
> Alexander> from pylab import * n=200
> Alexander> [x,y]=meshgrid(arange(n+1)*1./n,arange(n+1)*1./n)
> Alexander> z=sin(x**2 + y**2)
> 
> Alexander> and then do
> 
> Alexander> pcolor(x,y,z)
> 
> Alexander> repeatedly, the memory usage increases by about 15 MB
> Alexander> each time, and it runs progressively slower.each
> 
> At least with matplotlib CVS (and I don't think it's a CVS vs 0.84
> issue) the memory consumption is rock solid with your example (see
> below for my test script). What is your default "hold" setting in rc?
> If True, you will be overlaying plots and will get the behavior you
> describe. In the example below, I make sure to "close" the figure
> each time -- a plain clear with clf should suffice though. My guess
> is that you are repeatedly calling pcolor with hold : True and are
> simply overlaying umpteen pcolors (to test for this, print the length
> of the collections list
> 
> ax = gca()
> print len(ax.collections)
> 
> if this length is growing, you've found your problem. A simple
> 
> pcolor(x,y,z,hold=False)
> 
> should suffice.
> 
> You can also change the default hold setting in your config file
> http://matplotlib.sf.net/matplotlibrc
> 
> JDH
I can confirm that memory leaks indeed are not a problem with a CVS build
on Debian. I can't seem to restore the pre-built Debian stable 0.82 so 
I haven't tested it.
However, the problem is still that pcolor is too slow to use it
interactively on a plot with a half-dozen 200x608 warped grids, even
with shading='flat' and no antialiasing.
Would you consider accepting a 'structured grid' as a primitive patch
type? What consequence will this have for your various backends?
Presumably someone will want triangular meshes as well if they are
doing serious FEM work.
I created a prototype app using OpenGL and quad strips. The performance
with this is acceptable, but I need a lot more 2D graphing features.
I would much rather make an existing product better than rewrite from 
scratch.
In my particular case the grid warping function can be expressed
analytically. Is it reasonable to consider warping a 2D image directly
using an AGG filter function? Could this be embedded in an existing
matplotlib graph, above some objects and below others?
Thanks in advance,
Paul Kienzle
pki...@ni...
From: Chris F. <fon...@gm...> - 2005年11月03日 14:56:27
On 11/3/05, Chris Fonnesbeck <fon...@gm...> wrote:
>
> I'm not sure why it should be looking for numarray when it doesnt
> exist. Doesnt the setup.py file set this up?
Please ignore. I discovered .matplotlibrc ...
--
Chris Fonnesbeck
Atlanta, GA
From: Jouni K S. <jk...@ik...> - 2005年11月03日 08:26:42
Attachments: boxplot.patch
Noel Faux <noe...@me...> writes:
> I'm wanting to boxplot two
> distributions with diff number of observations. 
I wanted to do something similar, and it seems that the current
boxplot implementation doesn't quite allow it, but it is easy to
modify. I'm attaching a patch that allows you to set the position and
width of each box (as in Matlab's boxplot), so if you set hold(True),
you can call boxplot multiple times with different positions.
It's not perfect: it forces the limits and ticks of the last boxplot
on the axes, so you have to set the limits and ticks manually after
doing all the plots. I tried to fix this problem by extending the
limits and adding to the ticks instead of replacing them if holdStatus
is true, but then I got extra ticks at 0.0, 0.2, ..., 1.0; I guess
these are automatically generated when the figure is initialized, and
I don't know how to tell the difference between a just-initialized
figure and one where the user has set the ticks.
-- 
Jouni K Seppänen
From: Randewijk P-J <pjr...@su...> - 2005年11月03日 07:48:56
Dear Jiri,
from the matplotlibrc file:
...
font.serif : New Century Schoolbook, Century Schoolbook L,
Utopia, ITC Bookman, Bookman, Bitstream Vera Serif, Nimbus Roman No9 L,
Times New Roman, Times, Palatino, Charter, serif
font.sans-serif : Lucida Grande, Verdana, Geneva, Lucida, Bitstream
Vera Sans, Arial, Helvetica, sans-serif
font.cursive : Apple Chancery, Textile, Zapf Chancery, Sand,
cursive
font.fantasy : Comic Sans MS, Chicago, Charcoal, Impact, Western,
fantasy
font.monospace : Andale Mono, Bitstream Vera Sans Mono, Nimbus Mono
L, Courier New, Courier, Fixed, Terminal, monospace
font.latex.package : type1cm # This must be an available LaTeX font
#package, like 'times' or 'pslatex' ; only applies if text.usetex is set
### TEXT
# text properties used by text.Text. See
# http://matplotlib.sourceforge.net/matplotlib.text.html for more
# information on text properties
text.color : black
text.usetex : False # use tex/latex for all text handling. See
http://matplotlib.sf.net/matplotlib.texmanager.html
text.tex.engine : latex # tex is faster, but latex is required to
use special font packages
...
Ok, so let's try: 'Time'
Alternatively,=20
set:
font.latex.package : times # This must be an available LaTeX font
text.usetex : True # use tex/latex for all text handling. See
http://matplotlib.sf.net/matplotlib.texmanager.html
text.tex.engine : latex # tex is faster, but latex is required to
use special font packages
PS: Remember to "flush" ...\.matplotlib\tex.cache between font changes
Hope it works,
Regards,
Peter-Jan
> -----Original Message-----
> From: Jiri Polcar [mailto:po...@ph...]=20
> Sent: 03 November 2005 09:29
> To: Randewijk P-J <pjr...@su...>
> Subject: Re: [Matplotlib-users] Times-Roman Font
>=20
>=20
> On Wed, Nov 02, 2005 at 12:39:40PM +0200, Randewijk P-J=20
> <pjr...@su...> wrote:
> > Try: 'Times New Roman'
> >=20
>=20
> It does not work.
>=20
> --
> JP
>=20
>=20
>=20
> > > -----Original Message-----
> > > From: mat...@li...
> > > [mailto:mat...@li...] On=20
> > > Behalf Of Jiri Polcar
> > > Sent: 02 November 2005 12:34
> > > To: Mailinglist matplotlib-user
> > > Subject: [Matplotlib-users] Times-Roman Font
> > >=20
> > >=20
> > > Good day,
> > >=20
> > > is possible to use Times-Roman font in my plots? I try to use
> > >=20
> > > rc('font', family=3D'times-roman')
> > >=20
> > > but it is not working.
> > >=20
> > > --
> > > JP
>=20
From: Robert K. <rk...@uc...> - 2005年11月03日 06:22:15
Chris Fonnesbeck wrote:
> I was under the impression that you could use matplotlib with either
> Numeric or numarray. I do not have numarray anywhere on my system, yet
> after installing Numeric and matplotlib, I get the following:
> File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/numerix/__init__.py",
> line 48, in ?
> from numarray import *
> ImportError: No module named numarray
> 
> I'm not sure why it should be looking for numarray when it doesnt
> exist. Doesnt the setup.py file set this up?
What's the value of the option "numerix" in your matplotlibrc? If you
want to use Numeric, then it should look like this:
numerix : Numeric # Numeric or numarray
For the most part, this is a run-time setting rather than a build-time
setting, so it shouldn't be set by setup.py.
-- 
Robert Kern
rk...@uc...
"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
 -- Richard Harter
From: Chris F. <fon...@gm...> - 2005年11月03日 06:08:04
I was under the impression that you could use matplotlib with either
Numeric or numarray. I do not have numarray anywhere on my system, yet
after installing Numeric and matplotlib, I get the following:
>>> import pylab
Traceback (most recent call last):
 File "<stdin>", line 1, in ?
 File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/sit=
e-packages/pylab.py",
line 1, in ?
 from matplotlib.pylab import *
 File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/sit=
e-packages/matplotlib/pylab.py",
line 194, in ?
 import cm
 File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/sit=
e-packages/matplotlib/cm.py",
line 5, in ?
 import colors
 File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/sit=
e-packages/matplotlib/colors.py",
line 33, in ?
 from numerix import array, arange, take, put, Float, Int, where, \
 File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/sit=
e-packages/matplotlib/numerix/__init__.py",
line 48, in ?
 from numarray import *
ImportError: No module named numarray
I'm not sure why it should be looking for numarray when it doesnt
exist. Doesnt the setup.py file set this up?
--
Chris Fonnesbeck
Atlanta, GA
From: Jeff W. <js...@fa...> - 2005年11月03日 02:33:34
Jeff Whitaker wrote:
> Brian Donovan wrote:
>> basemap folks,
>>
>> I'm trying to understand how the transform_scalar function works. 
>> What are the units of the native projection grid and how are they 
>> determined? I'm trying to scale a scalar data field and overlay it on 
>> the map. Does the location of the origin matter when I do this? To be 
>> clear here's what I'm trying to do.
>>
>> 1) I have a Numeric array with a scalar field
>> 2) I want to overlay this onto a map projection
>> 3) The data is slightly larger than the map area (in terms of 
>> latitude and longitude)
>> 4) From the examples it seams like transform_scalar and then imshow 
>> can be used to show the data
>> 5) I can't seem to use transform_scalar properly
>>
>> Thanks is advance,
>>
>> Brian
> Brian: I'm going to assume your data (latlondata) is on a 
> latitude/longitude grid with latitudes lats and longitude lons, and 
> you have created a Basemap instance for your projection regrion (m). 
> Then, to create a nx by ny grid to overlay on the map, all you need is
>
> xydata = m.transform_scalar(latlondata,lons,lats,nx,ny)
>
> you can then overlay xydata on the map with
>
> im = x.imshow(xydata, cm.jet)
>
> You only need to do this to plot the data with imshow - with pcolor or 
> contourf you can plot the data on the original lat/lon grid using
>
> x,y = m(lons,lons)
>
> cs = m.contourf(x,y,latlondata,20,cmap=cm.jet)
>
> or
>
> im = m.pcolor(x,y,latlondata,shading='flat',cmap=cm.jet)
>
> HTH,
>
> -Jeff
>
>
Brian:
One correction -
lons and lats are 1-d arrays describing the lat/lon grid, so instead of
x,y = m(lons,lats)
you'll need
lons, lats = pylab.meshgrid(lons, lats)
x, y = m(lons, lats)
-Jeff
-- 
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/CDC R/CDC1 Email : Jef...@no...
325 Broadway Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
From: Jeff W. <js...@fa...> - 2005年11月03日 02:25:48
Brian Donovan wrote:
> basemap folks,
>
> I'm trying to understand how the transform_scalar function works. 
> What are the units of the native projection grid and how are they 
> determined? I'm trying to scale a scalar data field and overlay it on 
> the map. Does the location of the origin matter when I do this? To be 
> clear here's what I'm trying to do.
>
> 1) I have a Numeric array with a scalar field
> 2) I want to overlay this onto a map projection
> 3) The data is slightly larger than the map area (in terms of latitude 
> and longitude)
> 4) From the examples it seams like transform_scalar and then imshow 
> can be used to show the data
> 5) I can't seem to use transform_scalar properly
>
> Thanks is advance,
>
> Brian
Brian: I'm going to assume your data (latlondata) is on a 
latitude/longitude grid with latitudes lats and longitude lons, and you 
have created a Basemap instance for your projection regrion (m). Then, 
to create a nx by ny grid to overlay on the map, all you need is
xydata = m.transform_scalar(latlondata,lons,lats,nx,ny)
you can then overlay xydata on the map with
im = x.imshow(xydata, cm.jet)
You only need to do this to plot the data with imshow - with pcolor or 
contourf you can plot the data on the original lat/lon grid using
x,y = m(lons,lons)
cs = m.contourf(x,y,latlondata,20,cmap=cm.jet)
or
im = m.pcolor(x,y,latlondata,shading='flat',cmap=cm.jet)
HTH,
-Jeff
-- 
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/CDC R/CDC1 Email : Jef...@no...
325 Broadway Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
From: Brian D. <do...@mi...> - 2005年11月03日 00:21:46
basemap folks,
 I'm trying to understand how the transform_scalar function works. 
What are the units of the native projection grid and how are they 
determined? I'm trying to scale a scalar data field and overlay it on 
the map. Does the location of the origin matter when I do this? To be 
clear here's what I'm trying to do.
1) I have a Numeric array with a scalar field
2) I want to overlay this onto a map projection
3) The data is slightly larger than the map area (in terms of 
latitude and longitude)
4) From the examples it seams like transform_scalar and then imshow 
can be used to show the data
5) I can't seem to use transform_scalar properly
Thanks is advance,
Brian
--
Brian Donovan
Research Assistant
ERC for Collaborative Adaptive Sensing of the Atmosphere
University of Massachusetts
do...@mi...
http://www.casa.umass.edu
AIM: donovanatmirsl
Skype: bcdonovan

Showing 16 results of 16

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