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



Showing results of 247

1 2 3 .. 10 > >> (Page 1 of 10)
From: Jed F. <jed...@gm...> - 2007年10月31日 22:34:46
I'm trying to generate rose plots (circular histograms) using MPL but
have been unable to find a straight forward way to do it. I want to
take the polar_bar.py example and modify it to use the geographic
rather than the mathematical convention for measuring angles, that is
0 is at the top of the plot and increasing clockwise. It seems like
this should be possible using Transformations but I am at a loss for
how to begin. Any hints would be greatly appreciated.
Thanks,
-- 
Jed Frechette
jdfrechette.alturl.com
From: Eric F. <ef...@ha...> - 2007年10月31日 21:24:43
John,
We actually have the facility for using a log color scale directly, 
including handling out-of-range values, but I confess I am having a 
little trouble with it. I can't pursue it right now, but probably can 
do so this evening. It looks like the problem is a bug, but I am not sure.
Eric
From: Jeff W. <js...@fa...> - 2007年10月31日 20:47:30
John wrote:
> Well, it seems like I'm making progress, but it's stll not the plot 
> I'm hoping to produce. Something seems strange. First, it does create 
> a contourf plot, but I really need to take log(zdata) and use imshow 
> (which seems to handly the INF issue, wheras contourf crashes). On 
> another issue though, once the image is created, when I draw the map 
> components it covers the image entirely.. so I just see coastlines, 
> meridians, etc on a whilte background as if I had never plotted the data.
> 
> Thanks for helping with this! I'm really trying to make a movement 
> with my colleagues away from matlab, but I need to have things 
> operating more smoothly... lately it hasn't been going so well. This 
> is a great product you've made!
John: I think you need to send a self-contained script that triggers 
the error you are seeing. 
-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: John <was...@gm...> - 2007年10月31日 20:32:22
Well, it seems like I'm making progress, but it's stll not the plot I'm
hoping to produce. Something seems strange. First, it does create a contourf
plot, but I really need to take log(zdata) and use imshow (which seems to
handly the INF issue, wheras contourf crashes). On another issue though,
once the image is created, when I draw the map components it covers the
image entirely.. so I just see coastlines, meridians, etc on a whilte
background as if I had never plotted the data.
Thanks for helping with this! I'm really trying to make a movement with my
colleagues away from matlab, but I need to have things operating more
smoothly... lately it hasn't been going so well. This is a great product
you've made!
From: John <was...@gm...> - 2007年10月31日 20:23:31
Hold on, see my errors, trying again....
From: John <was...@gm...> - 2007年10月31日 20:19:58
Shoot, still getting the error discussed above:
ValueError: shape mismatch: objects cannot be broadcast to a single
shapeFile "c:07円_jfb\Programming\Python\mod_flexpart\plotPickle.py", line
30, in <module>
 fp_plot(z);
File "c:07円_jfb\Programming\Python\mod_flexpart\plotflex.py", line 55, in
fp_plot
 cs = m.contourf(x,y,zdat)
File "c:\Python25\Lib\site-packages\matplotlib\toolkits\basemap\basemap.py",
line 2439, in contourf
 mask = NX.logical_or(ma.getmaskarray(data),xymask)
What seems strange, is that after following your instructions:
nx = int((m.xmax-m.xmin)/20000.)+1; ny = int((m.ymax-m.ymin)/20000.)+1
zdat,x,y = m.transform_scalar(Zdat,lons,lats,nx,ny,returnxy=True)
lons, lats = N.meshgrid(lons, lats)
x, y = m(lons, lats) # map is the Basemap instance
cs = m.contourf(x,y,zdat)
The shape of my zdat no longer fits??
>>> print [N.shape(i) for i in [x,y,zdat]]
[(180, 360), (180, 360), (596, 596)]
From: Jeff W. <js...@fa...> - 2007年10月31日 20:09:16
John wrote:
> No, it didn't get cut off, I just decided to move that section forward 
> before the code and forgot to delete that line ;)
> 
> Okay, let's see...
> 
> 1) Yes, I've left them in for the moment since I saw that they will be 
> ignored, and I'm playing with different projections... seems it 
> doesn't hurt.
> 
> 2) Yes, it would appear zdat is an array of 0.0
> 
> 3) With contourf, I get a mismatch... not sure where:
> ValueError: shape mismatch: objects cannot be broadcast to a single shape
> File "c:\Python\mod\plotPickle.py", line 30, in <module>
> fp_plot(z);
> File "c:\Python\mod\plotf.py", line 55, in fp_plot
> m.contourf(lons,lats,Zdat)
> File 
> "c:\Python25\Lib\site-packages\matplotlib\toolkits\basemap\basemap.py", 
> line 2436, in contourf
> xymask = NX.logical_or(NX.greater(x,1.e20),NX.greater(y,1.e20))
> 
> Here is the information about the numpy.arrays I'm using:
> >>> N.shape(lons);N.shape(lats);N.shape(Zdat)
> (360,)
> (180,)
> (180, 360)
> 
> I tried: m.contourf(lons,lats,Zdat.transose()) as well, and receive 
> the same error.
> 
> Thanks again!
Try adding this just before the contourf call
lons, lats = numpy.meshgrid(lons, lats)
x, y = m(lons, lats) # map is the Basemap instance
then use
cs = m.contourf(x,y,zdat)
x,y have to be in map projection coordinates, and they must be 2D.
-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: John <was...@gm...> - 2007年10月31日 19:32:27
Also, I don't know if it's related, but I'm getting this Error / Warning:
UnboundLocalError: local variable 'pylab' referenced before assignment
Traceback:
 File
"c:\Python25\lib\site-packages\matplotlib\toolkits\basemap\basemap.py", line
2232, in imshow
 ax = pylab.gca()
As my script calls the various basemap.py methods(imshow, drawcoastlines,
drawcountries, etc.)
From: John <was...@gm...> - 2007年10月31日 19:18:30
No, it didn't get cut off, I just decided to move that section forward
before the code and forgot to delete that line ;)
Okay, let's see...
1) Yes, I've left them in for the moment since I saw that they will be
ignored, and I'm playing with different projections... seems it doesn't
hurt.
2) Yes, it would appear zdat is an array of 0.0
3) With contourf, I get a mismatch... not sure where:
ValueError: shape mismatch: objects cannot be broadcast to a single shape
File "c:\Python\mod\plotPickle.py", line 30, in <module>
 fp_plot(z);
File "c:\Python\mod\plotf.py", line 55, in fp_plot
 m.contourf(lons,lats,Zdat)
File "c:\Python25\Lib\site-packages\matplotlib\toolkits\basemap\basemap.py",
line 2436, in contourf
 xymask = NX.logical_or(NX.greater(x,1.e20),NX.greater(y,1.e20))
Here is the information about the numpy.arrays I'm using:
>>> N.shape(lons);N.shape(lats);N.shape(Zdat)
(360,)
(180,)
(180, 360)
I tried: m.contourf(lons,lats,Zdat.transose()) as well, and receive the same
error.
Thanks again!
From: David H. <dav...@gm...> - 2007年10月31日 18:04:48
I'd like to thank all those who participated in fixing this bug. It's much
appreciated.
David
2007年10月29日, John Hunter <jd...@gm...>:
>
> On 10/29/07, Michael Droettboom <md...@st...> wrote:
>
> > I submitted a fix for this in matplotlib SVN r4047. Freetype takes a
> > FT_LOAD_FORCE_AUTOHINT flag to force it to bypass the patented bytecode
> > hinter at runtime (even if it was compiled in). This appears to fix the
> > problem, and doesn't force people to recompile their freetype -- they
> > should now get identical results regardless.
>
> Andrew Straw and I taught a workshop at the Claremont Colleges this
> weekend and I was running mpl from svn. When I brought up the 1st
> figure in ipython -pylab mode running GTKAgg, the fonts were totally
> whacked (see attached) and I was reminded of why they call it "the
> bleeding edge". Fortunately, it only affected the first draw of an
> ipython session. For example, a figure resize, which triggers the
> draw, made the problem go away, and subsequent figures were fine.
> Odd. I just updated from svn and it looks like the problem is gone on
> that machine, so I hope this was the source of the problem (the
> workshop machine was running open-suse)
>
> In [2]: !uname -a
> Linux ns3 2.6.18.8-0.5-bigsmp #1 SMP Fri Jun 22 12:17:53 UTC 2007 i686
> i686 i386 GNU/Linux
>
> In other news, TkAgg is segfaulting in that environment, but I haven't
> had time to track it down since I was busy preparing the course
> material.
>
> JDH
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
>
From: Jeff W. <js...@fa...> - 2007年10月31日 16:53:30
John wrote:
> Jeff,
> 
> Thanks for the quick reply, below is my plotting code. Here are the 
> answers to your question about my arrray:
>
> >>> type(Zdat); type(zdat)
> <type 'numpy.ndarray'>
> <type 'numpy.ndarray'>
> >>> shape(Zdat); shape(zdat)
> (180, 360)
> (596, 596)
> >>> shape(lons); shape(x)
> (360,)
> (596, 596)
> >>> shape(lats); shape(y)
> (180,)
> (596, 596)
> 
> I would like to use contourf, but ultimately I want to plot the 
> log(zdat), and since my data have so many null or zero values, I can't 
> get that to work with contourf, whereas imshow seems to handle it.
> 
> Thanks!!
>
> 
>
> PLOTTING FUNCTION HERE:
>
> def fp_plot(datain):
> from matplotlib.toolkits.basemap import Basemap, shiftgrid
> 
> Zdat=datain;
> n,m=N.shape(Zdat)
> lons=N.array([i-179.5 for i in range(m)])
> lats=N.array([i-89.5 for i in range(n)])
> print "The array is bounded: %s : %s lat, %s : %s lon " % 
> (N.min(lats),N.max(lats),N.min(lons),N.max(lons))
> # Set up basmap.
> m = 
> Basemap(llcrnrlon=-180.,llcrnrlat=-90.,urcrnrlon=180.,urcrnrlat= 90.0,\
> rsphere=(6378137.00,6356752.3142),\
> resolution='l',area_thresh=1000.,projection='npstere',\
> lat_1=80.,lon_0=0., boundinglat=40.)
> # transform to nx x ny regularly spaced native projection grid
> nx = int((m.xmax-m.xmin)/20000.)+1; ny = int((m.ymax-m.ymin)/20000.)+1
> zdat,x,y = m.transform_scalar(Zdat,lons,lats,nx,ny,returnxy=True)
> # create the figure.
> fig=figure(figsize=(12,8))
> # add an axes, leaving room for colorbar on the right.
> ax = fig.add_axes([0.1,0.1,0.7,0.7])
>
> # plot image over map with imshow. Want to use this, but no 
> success yet.
> anorm=normalize(.015*N.max(zdat),0.95*N.max(zdat));
> # Draw flexpart output
> m.imshow(x,y,zdat)
> 
> # Draw map components
> m.drawcoastlines()
> m.drawcountries()
> m.drawstates()
> meridians=arange(-170.,180.,20.)
> m.drawmeridians(meridians,labels=[1,1,0,0])
> paralles=arange(-85.,85.,5.)
> m.drawparallels(paralles, labels=[0,0,0,1]); show();
>
> Now, to answer your question, Zdat, or datain is a numpy array with 
> the following characteristics:
>
> 
>
> 
>
John: Looks like some of your message got cut off. Just a few comments 
so far:
1) you don't need the llcrnrlat,llcrnrlon,urcrnrlat,urcrnrlon args when 
creating a Basemap instance with projection='npstere'. They should just 
be ignored though, so I don't think this is the problem.
2) what exactly happens when you run this script? Do you just get an 
array of zeros for zdat?
3) what happens when you use contourf? It should work just as well as 
imshow, and would save you the extra interpolation step. pcolor is 
another option that would not require interpolation.
-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: John <was...@gm...> - 2007年10月31日 16:48:44
Jeff,
Thanks for the quick reply, below is my plotting code. Here are the answers
to your question about my arrray:
>>> type(Zdat); type(zdat)
<type 'numpy.ndarray'>
<type 'numpy.ndarray'>
>>> shape(Zdat); shape(zdat)
(180, 360)
(596, 596)
>>> shape(lons); shape(x)
(360,)
(596, 596)
>>> shape(lats); shape(y)
(180,)
(596, 596)
I would like to use contourf, but ultimately I want to plot the log(zdat),
and since my data have so many null or zero values, I can't get that to work
with contourf, whereas imshow seems to handle it.
Thanks!!
PLOTTING FUNCTION HERE:
def fp_plot(datain):
 from matplotlib.toolkits.basemap import Basemap, shiftgrid
 Zdat=datain;
 n,m=N.shape(Zdat)
 lons=N.array([i-179.5 for i in range(m)])
 lats=N.array([i-89.5 for i in range(n)])
 print "The array is bounded: %s : %s lat, %s : %s lon " % (N.min(lats),
N.max(lats),N.min(lons),N.max(lons))
 # Set up basmap.
 m = Basemap(llcrnrlon=-180.,llcrnrlat=-90.,urcrnrlon=180.,urcrnrlat=90.0
,\
 rsphere=(6378137.00,6356752.3142),\
 resolution='l',area_thresh=1000.,projection='npstere',\
 lat_1=80.,lon_0=0., boundinglat=40.)
 # transform to nx x ny regularly spaced native projection grid
 nx = int((m.xmax-m.xmin)/20000.)+1; ny = int((m.ymax-m.ymin)/20000.)+1
 zdat,x,y = m.transform_scalar(Zdat,lons,lats,nx,ny,returnxy=True)
 # create the figure.
 fig=figure(figsize=(12,8))
 # add an axes, leaving room for colorbar on the right.
 ax = fig.add_axes([0.1,0.1,0.7,0.7])
 # plot image over map with imshow. Want to use this, but no success yet.
 anorm=normalize(.015*N.max(zdat),0.95*N.max(zdat));
 # Draw flexpart output
 m.imshow(x,y,zdat)
 # Draw map components
 m.drawcoastlines()
 m.drawcountries()
 m.drawstates()
 meridians=arange(-170.,180.,20.)
 m.drawmeridians(meridians,labels=[1,1,0,0])
 paralles=arange(-85.,85.,5.)
 m.drawparallels(paralles, labels=[0,0,0,1]); show();
Now, to answer your question, Zdat, or datain is a numpy array with the
following characteristics:
From: Jeff W. <js...@fa...> - 2007年10月31日 16:25:54
John wrote:
> Can anyone explain this??
> 
> >>> N.max(Zdat) #this is numpy.max function
> 1302.73592859
> >>> zdat,x,y = 
> m.transform_scalar(Zdat,lons,lats,nx,ny,returnxy=True,order=0)
> >>> N.max (zdat)
> 0.0
> >>>
> 
> In this case, Zdat is my original array sent to my plotting function. 
> It seems to lose all it's data when I run transform_scalar. I've tried 
> it with order=1 as well, with the same result. Am I missing something?
> 
> I'm having a really hard time getting basemap to work using either 
> imshow or contourf. Any help would be greatly appreciated.
> 
> Thanks!
John: I'll need more info about the Zdat array. It should be a 2-D 
array on a lat/lon grid whose longitudes (the 2nd dimension) are given 
by the 1-d array lons, and whose latitudes (the first dimension) are 
given by the 1-d array lats. lats and lons should be given in degrees. 
transform_scalar should then return an array of shape (ny,nx) on a 
regular grid in map projection coordinates.
Note that to use contourf you don't have to use transform_scalar, you 
can just plot the data on the original lat/lon grid.
Below is the transform_scalar docstring for reference:
 def 
transform_scalar(self,datin,lons,lats,nx,ny,returnxy=False,checkbounds=False,order=1,masked=False):
 """
 interpolate a scalar field (datin) from a lat/lon grid with longitudes =
 lons and latitudes = lats to a (ny,nx) native map projection grid.
 Typically used to transform data to map projection coordinates
 so it can be plotted on the map with imshow.
 lons, lats must be rank-1 arrays containing longitudes and latitudes
 (in degrees) of datin grid in increasing order
 (i.e. from dateline eastward, and South Pole northward).
 For non-cylindrical projections (those other than
 cylindrical equidistant, mercator and miller)
 lons must fit within range -180 to 180.
 if returnxy=True, the x and y values of the native map projection grid
 are also returned.
 If checkbounds=True, values of lons and lats are checked to see that
 they lie within the map projection region. Default is False.
 If checkbounds=False, points outside map projection region will
 be clipped to values on the boundary if masked=False. If masked=True,
 the return value will be a masked array with those points masked.
 The order keyword can be 0 for nearest-neighbor interpolation,
 or 1 for bilinear interpolation (default 1)."""
-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: Jose Gomez-D. <jgo...@gm...> - 2007年10月31日 15:58:26
Hi,
Some colleagues have sent some plots which they generated using IDL
(boo!!! hiss!! :D), and they look quite dissimilar to my matplotlib
ones. I would like to mimic their layout as much as possible, which so
far is a success. The only problem is that I don't know what font to
use. In IDL, I believe it is called "Roman" (there's an smudged
example here: <http://www.astro.ufl.edu/~warner/IDL5220/HW4w.jpg>).
Does anyone know a suitable alternative?
Thanks!
Jose
From: John <was...@gm...> - 2007年10月31日 15:37:10
Can anyone explain this??
>>> N.max(Zdat) #this is numpy.max function
1302.73592859
>>> zdat,x,y = m.transform_scalar
(Zdat,lons,lats,nx,ny,returnxy=True,order=0)
>>> N.max(zdat)
0.0
>>>
In this case, Zdat is my original array sent to my plotting function. It
seems to lose all it's data when I run transform_scalar. I've tried it with
order=1 as well, with the same result. Am I missing something?
I'm having a really hard time getting basemap to work using either imshow or
contourf. Any help would be greatly appreciated.
Thanks!
From: Steve S. <el...@gm...> - 2007年10月31日 14:53:36
I installed svn r4071. `svn info <working copy>` and
`svnversion <working copy>` report the correct rev number. But
$ ipython -pylab
In [1]: matplotlib.__version__
Out[1]: '0.90.1'
In [2]: matplotlib.__revision__
Out[2]: '$Revision: 3975 $'
If I'm right, this is because in matplotlib/__init__.py:
__revision__ = '$Revision: 3975 $'
which is the last rev where *this file* changed. Shouldn't
matplotlib.__revision__ report the latest global revision number?
Like that:
import subprocess as su
p = su.Popen('svnversion <path/to/working copy>',
 shell=True, stdin=su.PIPE, stdout=su.PIPE)
revnr = p.stdout.read().strip()
print revnr
-- 
cheers,
steve
I love deadlines. I like the whooshing sound they make as they fly by. --
Douglas Adams
From: John H. <jd...@gm...> - 2007年10月31日 13:21:41
On 10/31/07, Mark Bakker <ma...@gm...> wrote:
> This works fine, as apparantly colors='r' is interpreted as a sequence.
> This does not work, however:
>
> ax.add_collection( LineCollection( [[(0,0),(1,1)]], colors='r', linewidths=2
> ) )
> draw()
>
> Now I get an error: TypeError: CXX: type error. That's not too helpful.
This is fixed in svn -- now collection properties should work with a
scalar or iterable so if you find more problems, let us know.
JDH
From: John <was...@gm...> - 2007年10月31日 12:36:42
That is one solution, but perhaps I should have asked about a solution for
contourf as well. It would be preferable to be able to use a logarithmic
colormap rather than translating the variable.
From: Mark B. <ma...@gm...> - 2007年10月31日 12:19:32
Hello -
I got confused about specifying colors and linewidths for LineCollections.
I think it would be helpful if the docstrings explicitly state that they
should be sequences.
I know, they do in some way, but it i
Maybe we should even check this on input, as the error message you get when
you don't do that is confusing.
Let me explain:
from pylab import *
from matplotlib.collections import LineCollection
ax = subplot(111)
ax.add_collection( LineCollection( [[(0,0),(1,1)]], colors='r' ) )
draw()
This works fine, as apparantly colors='r' is interpreted as a sequence.
This does not work, however:
ax.add_collection( LineCollection( [[(0,0),(1,1)]], colors='r', linewidths=2
) )
draw()
Now I get an error: TypeError: CXX: type error. That's not too helpful.
What does work is
ax.add_collection( LineCollection( [[(0,0),(1,1)]], colors='r',
linewidths=[2] ) )
draw()
Maybe the confusing part is that just specifying colors='r' works.
Thanks,
Mark
ps. I do all the draws as I am in interactive mode.
From: sunzen w. <su...@gm...> - 2007年10月31日 03:18:00
The question is: how to enable panning/zooming operation to be constrained
to the x axis or y axis?
The Tutorial says,
[about Pam Mode] If you press 'x' or 'y' while panning, the motion will be
contrained to the x or y axis, respectively
[about Zoom Mode] You can use the modifier keys 'x', 'y' or 'CONTROL' to
constrain the zoom to the x axes, the y axes, or aspect ratio preserve,
respectively.
I find it really works for some examples, such as stock_demo.py.
However, it currently can't work on my canvas.
Is there any special setting so as to enable the functionality?
Thanks for your guidance in advance.
-- 
sunzen
<<freedom & enjoyment>>
From: sunzen w. <su...@gm...> - 2007年10月31日 03:05:09
Just for information, i change from broken_barh to just barh, so as to
easily set picker property. It satisfies my needs now.
Just for exploration, does anyone know how to implement it by using
broken_barh()?
On 10/26/07, sunzen w. <su...@gm...> wrote:
>
> Hi Gurus,
> (I'm sorry for sending the above unfinished one)
> I'm new to matplotlib programming, and get puzzled about designing
> picking handler for broken_barh by the OO interface.
> Could you give me any guidance? Any your help will be appreciated.
>
>
> --
sunzen
<<freedom & enjoyment>>
From: Eric F. <ef...@ha...> - 2007年10月31日 02:47:21
washakie wrote:
> Hello,
> 
> I'm trying to find a way to use imshow or contourf with a logarithmic
> colormap. Searching the threads I've found a few queries about this before,
> but not a solution. Any suggestions?
> 
> Thanks!
Maybe I am not understanding correctly, but could you simply plot the 
log of your variable?
Eric
From: washakie <was...@gm...> - 2007年10月30日 22:49:35
Hello,
I'm trying to find a way to use imshow or contourf with a logarithmic
colormap. Searching the threads I've found a few queries about this before,
but not a solution. Any suggestions?
Thanks!
-- 
View this message in context: http://www.nabble.com/contourf---imshow-logarithmic-colormap-tf4721777.html#a13499467
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Eric F. <ef...@ha...> - 2007年10月30日 20:35:54
Martinho MA wrote:
> hello, I have a problem quiver:
> In my code there is:
> 
> fill(...)
> quiver(..)
> 
> but the arrows stay under the fill !! If I would like it, with a bit of 
> logic, I would wrote:
> 
> quiver(...)
> fill(...)
q = quiver(...)
q.set_zorder(10)
This will ensure the arrows are drawn on top of everything else.
> 
> Any help?
> By the way, how to make an extra arrow to be used as a scale, with some 
> text anotation?
In the examples directory, see quiver_demo.py. It includes the 
quiverkey command, which is designed for exactly this.
Eric
From: Martinho MA <mm...@ua...> - 2007年10月30日 18:17:20
hello, I have a problem quiver:
In my code there is:
fill(...)
quiver(..)
but the arrows stay under the fill !! If I would like it, with a bit of 
logic, I would wrote:
quiver(...)
fill(...)
Any help?
By the way, how to make an extra arrow to be used as a scale, with some 
text anotation?
Thanks
MM
1 message has been excluded from this view by a project administrator.

Showing results of 247

1 2 3 .. 10 > >> (Page 1 of 10)
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 によって変換されたページ (->オリジナル) /