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



Showing results of 38

1 2 > >> (Page 1 of 2)
From: John H. <jd...@gm...> - 2008年12月16日 23:21:31
On Tue, Dec 16, 2008 at 3:17 PM, Christopher Barker
<Chr...@no...> wrote:
>> > python myfile.py -dPS
>
> same error -- why does it need to use png at all with PS?
Chris,
Thanks for all the tests. The image module uses _png. Even the
vector backends need raster images. We could move the import into the
method when it is actually called, since we actually embed the images
directly into the ps and do not go via png.
>> Could you also test the mpkg zip file -- I am curious if that shows
>> the same png problems for you.
>
> same errors as the egg.
>
> Can you test on PPC?
I do have an old, clunky OSX 10.3 machine at home. A little afraid to
go there :-(
>
> I recently had a problem with a wxPython extension -- it build Universal,
> but only worked on Intel. It turns out that the wxPython binaries were
> compiled differently on PPC and Intel -- using an older version of gcc on
> PPC (for 10.3 compatibility maybe?). Anyway, it was a mess, but we fixed it
> by compiling the extension separately with a bunch of different flags, then
> lipo-ing the two binaries together.
>
> Could anything funky like that be going on here?
Could be -- you can check the Makefile to get a look at the flags I am
using and let me know if you have any suggestions
http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/release/osx/Makefile?view=markup
JDH
From: John H. <jd...@gm...> - 2008年12月16日 22:56:51
On Tue, Dec 16, 2008 at 3:59 PM, John Hunter <jd...@gm...> wrote:
> Just a quick comment -- the symbol _png_destroy_read_struct is not
> defined in the png sources I am using (png_destroy_read_struct is).
> Thus it looks like a C++ name mangling issue, probably introduced when
> the mpl c++ includes and links against the code. Just throwing this
> out there in case anyone has advice on special flags to use when
> building "universal" binaries to prevent name mangling issues.
I *may*, repeat *may*, have had a breakthrough here. It appears that
setting the universal flags on the make line is not enough -- they
must actually be exported (as Charlie's original notes indicate).
Please try again with the new OS X binaries at
https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=278194&release_id=646644
I didn't do any clever renaming of the egg this time -- just focusing
on the png name manging error.
Fingers crossed,
JDH
From: John H. <jd...@gm...> - 2008年12月16日 22:56:14
On Tue, Dec 16, 2008 at 2:25 PM, John Hunter <jd...@gm...> wrote:
dlopen(/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5.1-py2.5.egg/matplotlib/_png.so,
>> 2): Symbol not found: _png_destroy_read_struct
>> Referenced from:
>
>
> Well, at least we have a *different* bug to focus on. I'll try and
> reproduce this somewhere.... I wonder if this is backend dependent
> (eg you are using a backend that also links png and something is
> getting confused). Could you try running ::
Just a quick comment -- the symbol _png_destroy_read_struct is not
defined in the png sources I am using (png_destroy_read_struct is).
Thus it looks like a C++ name mangling issue, probably introduced when
the mpl c++ includes and links against the code. Just throwing this
out there in case anyone has advice on special flags to use when
building "universal" binaries to prevent name mangling issues.
JDH
From: Jae-Joon L. <lee...@gm...> - 2008年12月16日 22:50:30
On Tue, Dec 16, 2008 at 4:02 PM, Jouni K. Seppänen <jk...@ik...> wrote:
> "Jae-Joon Lee" <lee...@gm...> writes:
>
>> So, Lebostein and j, if you know how to check out using svn, can you
>> give a try either the svn trunk or the maintenance branch? I'm
>> attaching the patch just in case.
>
> On the svn trunk, the demo examples/api/legend_demo.py now fails at
> "leg.get_texts()" with "AttributeError: 'Legend' object has no attribute
> 'texts'". Calling show() seems to fix the legend so that get_texts
> works, so I suspect that the bug is related to the _init_legend_box call
> that your patch removes.
>
> --
> Jouni K. Seppänen
> http://www.iki.fi/jks
>
I also see the problem.
And, yes, this is related with _init_legend_box. As the paddings and
such need to be determined at drawing time, I moved this into the
draw() method.
The fix may involve some rearrangement of the code.
I'll work on it.
Thanks,
-JJ
>
> ------------------------------------------------------------------------------
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
> The future of the web can't happen without you. Join us at MIX09 to help
> pave the way to the Next Web now. Learn more and register at
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: R. A. <ra...@gm...> - 2008年12月16日 22:39:04
Hi Michael,
I may be completely off my rocker here, but I think that you can define the
range of Z values that the ramp should be applied to with the Normalize
function.
cmap = matplotlib.colors.LinearSegmentedColormap('my_colormap',cdict,256)
norm = mpl.colors.Normalize(vmin=.0, vmax=1.0)
I'm only guessing though, because at this point I only change vmin and vmax
to alter the colorbar labels.
Roger
--
On Tue, Dec 16, 2008 at 1:15 PM, Michael Hearne <mh...@us...> wrote:
> I'm trying to replicate the color-mapping behavior of the GMT package with
> matplotlib/basemap and the imshow() function, and have run into a problem.
>
> Using GMT you can assign colors to ranges of Z values, so that (for
> example), Z values between 0 and 50 are given a color interpolated between
> (0,0,255) (blue) and (255,0,0) (red). There have been various versions of
> a function called gmtColorMap() posted to this list. I did some experiments
> today, and as far as I can tell, this function only reads the _color_ part
> of a GMT .cpt file, ignoring the Z values to which those color ranges are
> assigned. This isn't a problem as long as you have a linear color scale.
> However, if you have (as in my case) a color scale assigned to non-linear
> ranges of values, it becomes a problem.
>
> Is there a way with imshow() to assign ranges of colors to specific ranges
> of Z values?
>
> As a test, I created the attached python script, which reads in the
> attached .cpt file.
>
> For those of you not aware of the GMT color palette file format, in each
> row you define two end points for your Z values, and two corresponding RGB
> triplets. In my simplified example, I have defined 8 ranges, and assigned a
> single color to each range. For example, the first two lines in my color
> palette file looks like this:
>
> 00000 255 255 255 00005 255 255 255
> 00005 255 255 000 00050 255 255 000
>
> which can be interpreted to mean that any values between 0 and 5 (filled in
> with zeros to make the columns line up), should be colored white.
> Similarly, any values between 5 and 50 should be colored yellow.
>
>
>
>
>
>
>
>
> #!/usr/bin/python
>
> from matplotlib.colors import LinearSegmentedColormap,Normalize
> from pylab import *
>
> def gmtColormap(fileName):
> import colorsys
> import numpy as N
> try:
> f = open(fileName)
> except:
> print "file ",fileName, "not found"
> return None
>
> lines = f.readlines()
> f.close()
>
> x = []
> r = []
> g = []
> b = []
> colorModel = "RGB"
> for l in lines:
> ls = l.split()
> if l[0] == "#":
> if ls[-1] == "HSV":
> colorModel = "HSV"
> continue
> else:
> continue
> if ls[0] == "B" or ls[0] == "F" or ls[0] == "N":
> pass
> else:
> x.append(float(ls[0]))
> r.append(float(ls[1]))
> g.append(float(ls[2]))
> b.append(float(ls[3]))
> xtemp = float(ls[4])
> rtemp = float(ls[5])
> gtemp = float(ls[6])
> btemp = float(ls[7])
>
> x.append(xtemp)
> r.append(rtemp)
> g.append(gtemp)
> b.append(btemp)
>
> nTable = len(r)
> x = N.array( x , N.float32)
> r = N.array( r , N.float32)
> g = N.array( g , N.float32)
> b = N.array( b , N.float32)
> if colorModel == "HSV":
> for i in range(r.shape[0]):
> rr,gg,bb = colorsys.hsv_to_rgb(r[i]/360.,g[i],b[i])
> r[i] = rr ; g[i] = gg ; b[i] = bb
> if colorModel == "HSV":
> for i in range(r.shape[0]):
> rr,gg,bb = colorsys.hsv_to_rgb(r[i]/360.,g[i],b[i])
> r[i] = rr ; g[i] = gg ; b[i] = bb
> if colorModel == "RGB":
> r = r/255.
> g = g/255.
> b = b/255.
> xNorm = (x - x[0])/(x[-1] - x[0])
>
> red = []
> blue = []
> green = []
> for i in range(len(x)):
> red.append([xNorm[i],r[i],r[i]])
> green.append([xNorm[i],g[i],g[i]])
> blue.append([xNorm[i],b[i],b[i]])
> colorDict = {"red":red, "green":green, "blue":blue}
> return (colorDict)
>
> colormap = 'popcpt.cpt'
> cdict = gmtColormap(colormap)
> palette = LinearSegmentedColormap('my_colormap',cdict)
>
> f = figure()
> data = array([[2,2,2,2,2],
> [25,25,25,25,25],
> [75,75,75,75,75],
> [250,250,250,250,250],
> [750,750,750,750,750],
> [2500,2500,2500,2500,2500],
> [7500,7500,7500,7500,7500],
> [25000,25000,25000,25000,25000]])
> imshow(data,cmap=palette)
> #draw grid lines around all the cells
> nrows,ncols = data.shape
> for row in range(0,nrows):
> plot([0,ncols],[row,row],'k')
> for col in range(0,ncols):
> plot([col,col],[0,nrows],'k')
> axis([0,ncols-1,0,nrows])
> colorbar()
> savefig('output.png')
> close('all')
>
>
> ------------------------------------------------------------------------------
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
> The future of the web can't happen without you. Join us at MIX09 to help
> pave the way to the Next Web now. Learn more and register at
>
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Christopher B. <Chr...@no...> - 2008年12月16日 21:16:54
Another note:
I was wrong, if I easy_install the egg without the -macosx from scratch, 
it fails with:
Searching for matplotlib-0.98.5.1-py2.5
Reading http://pypi.python.org/simple/matplotlib-0.98.5.1-py2.5/
Couldn't find index page for 'matplotlib-0.98.5.1-py2.5' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
No local packages or download links found for matplotlib-0.98.5.1-py2.5
error: Could not find suitable distribution for 
Requirement.parse('matplotlib-0.98.5.1-py2.5')
But now I just ran:
easy_install matplotlib-0.98.5.1-py2.5-macosx.egg
and it worked just fine -- this is weird!
> > python myfile.py -dAgg
ImportError: 
dlopen(/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5.1-py2.5-macosx.egg/matplotlib/_png.so, 
2): Symbol not found: _png_destroy_read_struct
 Referenced from: 
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5.1-py2.5-macosx.egg/matplotlib/_png.so
 Expected in: dynamic lookup
> > python myfile.py -dTkAgg
same error
> > python myfile.py -dWXAgg
same error
> > python myfile.py -dPS
same error -- why does it need to use png at all with PS?
 > Could you also test the mpkg zip file -- I am curious if that shows
 > the same png problems for you.
same errors as the egg.
Can you test on PPC?
I recently had a problem with a wxPython extension -- it build 
Universal, but only worked on Intel. It turns out that the wxPython 
binaries were compiled differently on PPC and Intel -- using an older 
version of gcc on PPC (for 10.3 compatibility maybe?). Anyway, it was a 
mess, but we fixed it by compiling the extension separately with a bunch 
of different flags, then lipo-ing the two binaries together.
Could anything funky like that be going on here?
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: Michael H. <mh...@us...> - 2008年12月16日 21:15:26
Attachments: popcpt.cpt colortest.py
I'm trying to replicate the color-mapping behavior of the GMT package 
with matplotlib/basemap and the imshow() function, and have run into a 
problem.
Using GMT you can assign colors to ranges of Z values, so that (for 
example), Z values between 0 and 50 are given a color interpolated 
between (0,0,255) (blue) and (255,0,0) (red). There have been various 
versions of a function called gmtColorMap() posted to this list. I did 
some experiments today, and as far as I can tell, this function only 
reads the _color_ part of a GMT .cpt file, ignoring the Z values to 
which those color ranges are assigned. This isn't a problem as long as 
you have a linear color scale. However, if you have (as in my case) a 
color scale assigned to non-linear ranges of values, it becomes a problem.
Is there a way with imshow() to assign ranges of colors to specific 
ranges of Z values?
As a test, I created the attached python script, which reads in the 
attached .cpt file.
For those of you not aware of the GMT color palette file format, in each 
row you define two end points for your Z values, and two corresponding 
RGB triplets. In my simplified example, I have defined 8 ranges, and 
assigned a single color to each range. For example, the first two lines 
in my color palette file looks like this:
00000 255 255 255 00005 255 255 255
00005 255 255 000 00050 255 255 000
which can be interpreted to mean that any values between 0 and 5 (filled 
in with zeros to make the columns line up), should be colored white. 
Similarly, any values between 5 and 50 should be colored yellow.
From: Jouni K. S. <jk...@ik...> - 2008年12月16日 21:12:33
Jörgen Stenarson
<jor...@bo...> writes:
> __date__ = '$Date: 2008年12月15日 21:46:00 +0100 (må, 15 dec 2008) $'
> Does anyone know how I can force svn and tortoise svn to not include the 
> last part with the weekday? I'm not sure if svn always uses utf-8 if 
> that is the case then we could just add the encoding specification and 
> everything will work. 
Does "LC_ALL=C svn update" work for you?
The bug report http://subversion.tigris.org/issues/show_bug.cgi?id=2332
implies that it always uses UTF-8, so putting an encoding cookie in the
file might be the easiest solution.
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: Jouni K. S. <jk...@ik...> - 2008年12月16日 21:02:31
"Jae-Joon Lee" <lee...@gm...> writes:
> So, Lebostein and j, if you know how to check out using svn, can you
> give a try either the svn trunk or the maintenance branch? I'm
> attaching the patch just in case.
On the svn trunk, the demo examples/api/legend_demo.py now fails at
"leg.get_texts()" with "AttributeError: 'Legend' object has no attribute
'texts'". Calling show() seems to fix the legend so that get_texts
works, so I suspect that the bug is related to the _init_legend_box call
that your patch removes.
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: John H. <jd...@gm...> - 2008年12月16日 20:42:19
On Tue, Dec 16, 2008 at 2:17 PM, Christopher Barker
<Chr...@no...> wrote:
> However, once installed, I tried to run it, and got libpng issues --
> aaarrgg!:
Could you also test the mpkg zip file -- I am curious if that shows
the same png problems for you.
JDH
From: John H. <jd...@gm...> - 2008年12月16日 20:31:25
On Tue, Dec 16, 2008 at 2:20 PM, Michael Oevermann
<mic...@tu...> wrote:
> That's exactly what I was looking for! But how do I get the new feature
> into my
> matplotlib version?
Either wait for the next release and use the workaround for now, or
install from svn. See
 http://matplotlib.sourceforge.net/faq/installing_faq.html#install-from-svn
Nightly builds are on the list of things to do, but we have bigger
fish to fry at the moment. What platform are you on?
From: John H. <jd...@gm...> - 2008年12月16日 20:29:45
On Tue, Dec 16, 2008 at 2:17 PM, Christopher Barker
<Chr...@no...> wrote:
> "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5.1-py2.5.egg/matplotlib/image.py",
> line 19, in <module>
> from matplotlib import _png
> ImportError:
> dlopen(/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5.1-py2.5.egg/matplotlib/_png.so,
> 2): Symbol not found: _png_destroy_read_struct
> Referenced from:
Well, at least we have a *different* bug to focus on. I'll try and
reproduce this somewhere.... I wonder if this is backend dependent
(eg you are using a backend that also links png and something is
getting confused). Could you try running ::
 import matplotlib.pyplot as plt
 plt.plot([1,2,3])
 plt.show()
with
 > python myfile.py -dAgg
 > python myfile.py -dTkAgg
 > python myfile.py -dWXAgg
 > python myfile.py -dPS
and let me know what you find.
JDH
HDG
From: John H. <jd...@gm...> - 2008年12月16日 20:23:12
On Tue, Dec 16, 2008 at 2:13 PM, Michael Hearne <mh...@us...> wrote:
> John - I get the same error at the end. I've been able to build the package
> from the tarball successfully. Output follows:
No, this is not the same. In the original post you had
 error: lib/matplotlib/mpl-data/matplotlib.conf.template
which was breaking the install (I think). This is the bug I fixed.
The CleanUpFile exceptions are annoying but mostly harmless, and I
have a post to distutils.sig about them.
Let me know if you have information otherwise.
JDH
From: Michael O. <mic...@tu...> - 2008年12月16日 20:21:08
That's exactly what I was looking for! But how do I get the new feature 
into my
matplotlib version?
Michael
John Hunter schrieb:
> On Tue, Dec 16, 2008 at 10:30 AM, John Hunter <jd...@gm...> wrote:
>
> 
>>> using in favour of matplotlib). Plotting the data twice- the first time
>>> without
>>> symbol showing every data point and the second time onlywith the symbol
>>> and some skip in the data - doesn't help as I now get two entities in
>>> the legend.
>>> 
>> There is a way to do this, but it is not terribly elegant. The tricky
>> part is to get the legend right::
>> 
>
> I just added a new line property called "markevery" to support
> subsampling markers. Included below is the docstring and nosetest
> which should clearly indicate usage:
>
> def set_markevery(self, every):
> """
> Set the markevery property to subsample the plot when using
> markers. Eg if ``markevery=5``, every 5-th marker will be
> plotted. *every* can be
>
> None
> Every point will be plotted
>
> an integer N
> Every N-th marker will be plotted starting with marker 0
>
> A length-2 tuple of integers
> every=(start, N) will start at point start and plot every
> N-th marker
>
>
> ACCEPTS: None | integer | (startind, stride)
>
> """
>
>
> def test_markevery():
> x, y = np.random.rand(2, 100)
>
> # check marker only plot
> fig = plt.figure()
> ax = fig.add_subplot(111)
> ax.plot(x, y, 'o')
> ax.plot(x, y, 'd', markevery=None)
> ax.plot(x, y, 's', markevery=10)
> ax.plot(x, y, '+', markevery=(5, 20))
> fig.canvas.draw()
> plt.close(fig)
>
> # check line/marker combos
> fig = plt.figure()
> ax = fig.add_subplot(111)
> ax.plot(x, y, '-o')
> ax.plot(x, y, '-d', markevery=None)
> ax.plot(x, y, '-s', markevery=10)
> ax.plot(x, y, '-+', markevery=(5, 20))
> fig.canvas.draw()
> plt.close(fig)
>
> 
From: Christopher B. <Chr...@no...> - 2008年12月16日 20:16:36
John Hunter wrote:
> I've posted new eggs and a binary mpkg installer for OS X and a new
> tarball. I've tried your egg renaming trick. Let me know how it
> goes.
well, when I tried:
easy_install matplotlib-0.98.5.1-py2.5-macosx.egg
it again did the sillyness of installing it, then going and downloading 
the source.
However, I took the "macosx" off the name, and it worked fine:
easy_install matplotlib-0.98.5.1-py2.5.egg
But then it's a bit hard for users to know that it's an OS-X egg! Maybe 
it could be put on the download site as:
easy_install matplotlib-0.98.5.1-py2.5-macosx.egg.zip
and unpack it to one with the shorter name. (even though *.egg files are 
already zipped!
Perhaps we need to figure out what the heck is wrong with easy_install 
instead! (Not I want to dig into that code!)
However, once installed, I tried to run it, and got libpng issues -- 
aaarrgg!:
 >>> import matplotlib
 >>> matplotlib.__version__
'0.98.5.1'
 >>> import pylab
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File 
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5.1-py2.5.egg/pylab.py", 
line 1, in <module>
 from matplotlib.pylab import *
 File 
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5.1-py2.5.egg/matplotlib/pylab.py", 
line 206, in <module>
 from matplotlib import mpl # pulls in most modules
 File 
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5.1-py2.5.egg/matplotlib/mpl.py", 
line 3, in <module>
 from matplotlib import axes
 File 
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5.1-py2.5.egg/matplotlib/axes.py", 
line 18, in <module>
 import matplotlib.image as mimage
 File 
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5.1-py2.5.egg/matplotlib/image.py", 
line 19, in <module>
 from matplotlib import _png
ImportError: 
dlopen(/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5.1-py2.5.egg/matplotlib/_png.so, 
2): Symbol not found: _png_destroy_read_struct
 Referenced from: 
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.98.5.1-py2.5.egg/matplotlib/_png.so
 Expected in: dynamic lookup
I'm running python 2.5.2 universal framework build, on a PPC running 
OS-X 10.4
Here is the otool ouput on _png.so:
otool -L _png.so
_png.so:
 /usr/lib/libz.1.dylib (compatibility version 1.0.0, current 
version 1.2.3)
 /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, 
current version 7.4.0)
 /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, 
current version 88.3.10)
 /usr/local/lib/libgcc_s.1.dylib (compatibility version 1.0.0, 
current version 1.0.0)
 /usr/lib/libmx.A.dylib (compatibility version 1.0.0, current 
version 47.1.0)
so it's not linked to the dynamic libpng -- hmmm.
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: Michael H. <mh...@us...> - 2008年12月16日 20:14:02
John - I get the same error at the end. I've been able to build the 
package from the tarball successfully. Output follows:
sudo easy_install matplotlib-0.98.5.1-py2.5-macosx.egg
Processing matplotlib-0.98.5.1-py2.5-macosx.egg
removing 
'/Library/Python/2.5/site-packages/matplotlib-0.98.5.1-py2.5-macosx.egg' 
(and everything under it)
creating 
/Library/Python/2.5/site-packages/matplotlib-0.98.5.1-py2.5-macosx.egg
Extracting matplotlib-0.98.5.1-py2.5-macosx.egg to 
/Library/Python/2.5/site-packages
matplotlib 0.98.5.1 is already the active version in easy-install.pth
Installed 
/Library/Python/2.5/site-packages/matplotlib-0.98.5.1-py2.5-macosx.egg
Processing dependencies for matplotlib==0.98.5.1
Searching for matplotlib==0.98.5.1
Reading http://pypi.python.org/simple/matplotlib/
Reading http://matplotlib.sourceforge.net
Reading http://sourceforge.net/project/showfiles.php?group_id=80706
Reading 
https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=278194
Reading 
https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474
Best match: matplotlib 0.98.5.1
Downloading 
http://downloads.sourceforge.net/matplotlib/matplotlib-0.98.5.1.tar.gz?modtime=1229456199&big_mirror=0
Processing matplotlib-0.98.5.1.tar.gz
Running matplotlib-0.98.5.1/setup.py -q bdist_egg --dist-dir 
/var/folders/GK/GKdPFArAGq0lmR1STz+kR++++TQ/-Tmp-/easy_install-RxTUy6/matplotlib-0.98.5.1/egg-dist-tmp-9hZznV
============================================================================
BUILDING MATPLOTLIB
matplotlib: 0.98.5.1
python: 2.5.1 (r251:54863, Jan 17 2008, 19:35:17) [GCC
4.0.1 (Apple Inc. build 5465)]
platform: darwin
REQUIRED DEPENDENCIES
numpy: 1.1.0.dev5077
freetype2: 9.17.3
OPTIONAL BACKEND DEPENDENCIES
libpng: 1.2.18
Tkinter: Tkinter: 50704, Tk: 8.4, Tcl: 8.4
wxPython: 2.8.4.0
* WxAgg extension not required for wxPython >= 2.8
Gtk+: no
* Building for Gtk+ requires pygtk; you must be able
* to "import gtk" in your build/install environment
Mac OS X native: yes
Qt: no
Qt4: no
Cairo: no
OPTIONAL DATE/TIMEZONE DEPENDENCIES
datetime: present, version unknown
dateutil: 1.4.1
pytz: 2008i
OPTIONAL USETEX DEPENDENCIES
dvipng: no
ghostscript: 8.61
latex: no
EXPERIMENTAL CONFIG PACKAGE DEPENDENCIES
configobj: matplotlib will provide
enthought.traits: 2.6b1-mpl
[Edit setup.cfg to suppress the above messages]
============================================================================
pymods ['pylab', 'configobj']
packages ['matplotlib', 'matplotlib.backends', 'matplotlib.projections', 
'mpl_toolkits', 'matplotlib.numerix', 'matplotlib.numerix.mlab', 
'matplotlib.numerix.ma', 'matplotlib.numerix.npyma', 
'matplotlib.numerix.linear_algebra', 'matplotlib.numerix.random_array', 
'matplotlib.numerix.fft', 'matplotlib.delaunay', 'matplotlib.config']
warning: no files found matching 'MANIFEST'
warning: no files found matching 'lib/mpl_toolkits'
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
In file included from /usr/X11/include/freetype2/freetype/freetype.h:41,
from src/ft2font.h:14,
from src/ft2font.cpp:1:
/usr/X11/include/freetype2/freetype/config/ftconfig.h:65:1: warning: 
"SIZEOF_LONG" redefined
In file included from 
/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:8,
from ./CXX/WrapPython.h:42,
from ./CXX/Extensions.hxx:48,
from src/ft2font.h:4,
from src/ft2font.cpp:1:
/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/pyconfig.h:814:1: 
warning: this is the location of the previous definition
In file included from /usr/X11/include/freetype2/freetype/freetype.h:41,
from src/ft2font.h:14,
from src/ft2font.cpp:1:
/usr/X11/include/freetype2/freetype/config/ftconfig.h:65:1: warning: 
"SIZEOF_LONG" redefined
In file included from 
/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:8,
from ./CXX/WrapPython.h:42,
from ./CXX/Extensions.hxx:48,
from src/ft2font.h:4,
from src/ft2font.cpp:1:
/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/pyconfig.h:814:1: 
warning: this is the location of the previous definition
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
/Library/Python/2.5/site-packages/numpy-1.1.0.dev5077-py2.5-macosx-10.3-i386.egg/numpy/core/include/numpy/__multiarray_api.h:948: 
warning: ‘int _import_array()’ defined but not used
/Library/Python/2.5/site-packages/numpy-1.1.0.dev5077-py2.5-macosx-10.3-i386.egg/numpy/core/include/numpy/__multiarray_api.h:948: 
warning: ‘int _import_array()’ defined but not used
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
In file included from /usr/X11/include/freetype2/freetype/freetype.h:41,
from src/ft2font.h:14,
from src/backend_agg.cpp:10:
/usr/X11/include/freetype2/freetype/config/ftconfig.h:65:1: warning: 
"SIZEOF_LONG" redefined
In file included from 
/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:8,
from ./CXX/WrapPython.h:42,
from ./CXX/Extensions.hxx:48,
from src/ft2font.h:4,
from src/backend_agg.cpp:10:
/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/pyconfig.h:814:1: 
warning: this is the location of the previous definition
In file included from /usr/X11/include/freetype2/freetype/freetype.h:41,
from src/ft2font.h:14,
from src/backend_agg.cpp:10:
/usr/X11/include/freetype2/freetype/config/ftconfig.h:65:1: warning: 
"SIZEOF_LONG" redefined
In file included from 
/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:8,
from ./CXX/WrapPython.h:42,
from ./CXX/Extensions.hxx:48,
from src/ft2font.h:4,
from src/backend_agg.cpp:10:
/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/pyconfig.h:814:1: 
warning: this is the location of the previous definition
ld: warning in /sw/lib/freetype219/lib/libfreetype.dylib, file is not of 
required architecture
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
ld: warning in /sw/lib/libpng12.dylib, file is not of required architecture
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
C/ObjC but not for C++
powerpc-apple-darwin9-gcc-4.0.1: -framework: linker input file unused 
because linking not done
powerpc-apple-darwin9-gcc-4.0.1: Tcl: linker input file unused because 
linking not done
powerpc-apple-darwin9-gcc-4.0.1: -framework: linker input file unused 
because linking not done
powerpc-apple-darwin9-gcc-4.0.1: Tk: linker input file unused because 
linking not done
i686-apple-darwin9-gcc-4.0.1: -framework: linker input file unused 
because linking not done
i686-apple-darwin9-gcc-4.0.1: Tcl: linker input file unused because 
linking not done
i686-apple-darwin9-gcc-4.0.1: -framework: linker input file unused 
because linking not done
i686-apple-darwin9-gcc-4.0.1: Tk: linker input file unused because 
linking not done
ld: warning in /sw/lib/freetype219/lib/libfreetype.dylib, file is not of 
required architecture
zip_safe flag not set; analyzing archive contents...
matplotlib.__init__: module references __file__
matplotlib.pyparsing: module MAY be using inspect.stack
matplotlib.backends.backend_cocoaagg: module references __file__
matplotlib.config.cutils: module references __file__
Removing matplotlib 0.98.5.1 from easy-install.pth file
Adding matplotlib 0.98.5.1 to easy-install.pth file
Installed 
/Library/Python/2.5/site-packages/matplotlib-0.98.5.1-py2.5-macosx-10.5-i386.egg
Finished processing dependencies for matplotlib==0.98.5.1
Exception exceptions.OSError: (2, 'No such file or directory', 
'src/image.cpp') in <bound method CleanUpFile.__del__ of 
<setupext.CleanUpFile instance at 0x14c5aa8>> ignored
Exception exceptions.OSError: (2, 'No such file or directory', 
'src/path.cpp') in <bound method CleanUpFile.__del__ of 
<setupext.CleanUpFile instance at 0x14c5300>> ignored
Exception exceptions.OSError: (2, 'No such file or directory', 
'src/backend_agg.cpp') in <bound method CleanUpFile.__del__ of 
<setupext.CleanUpFile instance at 0x14c55f8>> ignored
John Hunter wrote:
> On Mon, Dec 15, 2008 at 7:08 PM, Michael Hearne <mh...@us...> wrote:
> 
>> I get the following output when trying to install the latest version of
>> matplotlib from an egg. I'm running Mac OS X 10.5.5.
>> 
>
> We've had a lot of trouble with our eggs. I am not sure this is all
> our fault, because it looks like some combination of distutils and
> setuptools is breaking in the presence of symlinks, which we use. I'm
> modified our installs to work around this problem, and have posted new
> eggs at
>
> https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=278194&release_id=646644
>
> You have two choices for OS X :
>
> * matplotlib-0.98.5.1-py2.5-macosx10.5.zip - a binary mpkg installer
> * matplotlib-0.98.5.1-py2.5-macosx.egg - an egg with the known
> problems fixed.
>
> Please give it another whirl and let me know.
>
> JDH
> 
From: John H. <jd...@gm...> - 2008年12月16日 19:48:44
On Mon, Dec 15, 2008 at 7:08 PM, Michael Hearne <mh...@us...> wrote:
> I get the following output when trying to install the latest version of
> matplotlib from an egg. I'm running Mac OS X 10.5.5.
We've had a lot of trouble with our eggs. I am not sure this is all
our fault, because it looks like some combination of distutils and
setuptools is breaking in the presence of symlinks, which we use. I'm
modified our installs to work around this problem, and have posted new
eggs at
 https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=278194&release_id=646644
You have two choices for OS X :
 * matplotlib-0.98.5.1-py2.5-macosx10.5.zip - a binary mpkg installer
 * matplotlib-0.98.5.1-py2.5-macosx.egg - an egg with the known
problems fixed.
Please give it another whirl and let me know.
JDH
From: Jae-Joon L. <lee...@gm...> - 2008年12月16日 19:40:30
On Tue, Dec 16, 2008 at 12:17 PM, jkitchin <jki...@an...> wrote:
>
> I also observed this with eps output. The png looked fine, but the eps legend
> was very large in my case.
>
> j
>
Hmm, it is not clear to me if this is a same issue. I think eps output
is not very sensitive to dpi thing in matplotlib.
I tried a few tests but couldn't see any obvious problems.
If my patch does not fix your problem, please report some more details.
Regards,
-JJ
From: Jae-Joon L. <lee...@gm...> - 2008年12月16日 19:28:23
Attachments: legend_dpi.patch
I just found my previous message was only sent to Lebostein.
Anyhow, here is my original meesage.
On Tue, Dec 16, 2008 at 10:38 AM, Jae-Joon Lee <lee...@gm...> wrote:
> Yes, I can see the differences.
> Anyway, it seems to me the differences are primarily caused by
> different dpi, not by different backend.
> I guess the image in
> http://matplotlib.sourceforge.net/examples/pylab_examples/legend_demo3.html
> is also created with png backend, and that looks okay to me.
> And I'm afraid that I didn't correctly accounted the figure dpi when I
> calculate these dimensions.
> I'll try to correct this soon.
>
> Thanks.
>
> -JJ
>
>
And, Micheal, yes, it is a dpi issue. I was using font size in
"points" as a reference while it should be in "pixels". This should be
fixed both in the maintenance branch and in the trunk.
So, Lebostein and j, if you know how to check out using svn, can you
give a try either the svn trunk or the maintenance branch? I'm
attaching the patch just in case.
Regards,
-JJ
From: John H. <jd...@gm...> - 2008年12月16日 18:54:04
On Tue, Dec 16, 2008 at 12:38 PM, Jörgen Stenarson
<jor...@bo...> wrote:
> Hi
>
> I get the following error when I try to build matplotlib on a windows
> machine. It builds fine if I comment out the offending line in setup.py.
>
> C:\python\external\matplotlib-trunk>python setup.py config
> --compiler=mingw32 build --compiler=mingw32 bdist
> Traceback (most recent call last):
> File "setup.py", line 13, in <module>
> del os.link
> AttributeError: link
Thanks -- I'll fix it. This is a hack to prevent distutils from
copying our symlinks, which is breaking easy_install.
JDH
From: Jörgen S. <jor...@bo...> - 2008年12月16日 18:48:55
Hi,
I have a problem with svn. When updating trunk today I get the following 
from line 94 in matplotlib/__init__.py:
__date__ = '$Date: 2008年12月15日 21:46:00 +0100 (må, 15 dec 2008) $'
As you can see there is a 'å' in the Date string but there is no 
encoding specified at the top of the file so I get a SyntaxError about 
unspecified encoding when I import matplotlib. It seems svn assumes utf-8.
Traceback (most recent call last):
 File "C:\Python25\Scripts\ipython.py", line 28, in <module>
 IPython.Shell.start().mainloop()
 File "c:\python\external\ipython\IPython\Shell.py", line 1243, in start
 shell = _select_shell(sys.argv)
 File "c:\python\external\ipython\IPython\Shell.py", line 1200, in 
_select_shell
 import matplotlib
 File 
"c:\python\external\matplotlib-trunk\build\lib.win32-2.5\matplotlib\__init__.py", 
line 94
SyntaxError: Non-ASCII character '\xc3' in file 
c:\python\external\matplotlib-trunk\build\lib.win32-2.5\matplotlib\__init__.py 
on line 94, but no encoding declared; see 
http://www.python.org/peps/pep-0263.html for details
Does anyone know how I can force svn and tortoise svn to not include the 
last part with the weekday? I'm not sure if svn always uses utf-8 if 
that is the case then we could just add the encoding specification and 
everything will work. I believe it would be best if this can be fixed on 
the server side otherwise this problem will come up now and again 
depending on user configurations.
/Jörgen
From: Jörgen S. <jor...@bo...> - 2008年12月16日 18:38:07
Hi
I get the following error when I try to build matplotlib on a windows 
machine. It builds fine if I comment out the offending line in setup.py.
C:\python\external\matplotlib-trunk>python setup.py config 
--compiler=mingw32 build --compiler=mingw32 bdist
Traceback (most recent call last):
 File "setup.py", line 13, in <module>
 del os.link
AttributeError: link
/Jörgen
From: Eric F. <ef...@ha...> - 2008年12月16日 18:22:06
AlsCdz wrote:
> Hello, i need you help!
> I want to draw a plot with circles, which are coloured according to size. So
> let's say we have a list=[1,3,5,7] that would give me four circles, first
> very small, second bigger and so on. 
> Now i need a way to "convert" integers to color value which would match
> matplotlib.cm.spectral
> values.
> 
> I hope you understand what i want to do, something like: (
> http://zoonek2.free.fr/UNIX/48_R/g208.png
> http://zoonek2.free.fr/UNIX/48_R/g208.png )
> 
> I posted only the "important" bits of code: 
> 
> 
> listData = [[2,5,1],[2,4,15],[13,2,1],[1,10,2]]
> cmap = mpl.cm.spectral
> norm = mpl.colors.Normalize(vmin=1, vmax=15)
> 
> listA = ([i for i in range(len(listData))])
> for a in range(len(listData)):
> listB = ([a for i in range(len(listData[0]))])
> area = ([listData[a][i]*100 for i in range(len(listData[a]))])
> color = ([listData[a][i]*100 for i in range(len(listData[a]))])
> plt.scatter(listA,listB,s=area, cmap=cmap, c=??what to put here???)
> 
> cb1 = mpl.colorbar.ColorbarBase(ax1, cmap=cmap, norm=norm,
> orientation='vertical')
> 
> 
> 
> I hope someone could help me!
> 
> thank you very much
> ales
radius = np.arange(10)
area = np.pi*radius**2
x = np.random.rand(10)
y = np.random.rand(10)
cmap = plt.get_cmap('spectral')
plt.scatter(x, y, s=area, c=radius, cmap=cmap)
plt.colorbar()
I think the above illustrates what you need.
Eric
From: R. A. <ra...@gm...> - 2008年12月16日 18:11:35
Ahh, because I have labels and other text already drawn on the image.
Squishing it alters the shape of the letters. And I have potentially many
of these coming out of WMS requests where I know the image size and corner
coords, but I can't alter the basic nature of the image. What I'd like to
do is use these images as figures in a report, so I need to be able to add
Axes with labeling, and also Figure titles and text.
Thanks,
Roger
--
On Tue, Dec 16, 2008 at 9:53 AM, Jeff Whitaker <js...@fa...> wrote:
> Roger André wrote:
>
>> Hi Jeff,
>>
>> I checked, and no the images are not geographically square. I wonder if I
>> could approach this problem in a different way. Would it be possible for me
>> to add tick marks and annotation to the image without using the Basemap
>> module alone? My thinking is that I could bring the image into Matplotlib,
>> define a square figure, and then manually define the size of the X and Y
>> axes and label them. Is it possible to "decorate" an image this way,
>> without using any projection support?
>>
>> Thanks for the help,
>>
>> Roger
>>
>
> Roger: Sure, you could do that. I'm not sure why you would want to
> display an image that's not geographically square as a square though.
> What's wrong with just letting Basemap show it as a rectange?
>
> -Jeff
>
>> --
>>
>>
>> On Tue, Dec 16, 2008 at 4:43 AM, Jeff Whitaker <js...@fa...<mailto:
>> js...@fa...>> wrote:
>>
>> Roger André wrote:
>>
>> Hi All,
>>
>> I have some square images which were generated via WMS
>> requests. I have imported them into Matplotlib via
>> pil_to_array, and then display them in a Basemap instance
>> where I have defined the projection as:
>>
>> m = Basemap(projection='cyl', lon_0=lon_0, llcrnrlon=ll_lon,
>> llcrnrlat=ll_lat, urcrnrlon=ur_lon,
>> urcrnrlat=ur_lat, suppress_ticks=False)
>>
>> While this works (it appears the tics are at the right
>> places), the image is no longer square, and I wonder if my
>> projection definition is correct.
>>
>> Can someone show me what the correct Basemap parameters are
>> for working with images that are in EPSG:4326?
>>
>> Thanks,
>>
>> Roger
>>
>>
>> Roger: The image will only be square if ur_lon-ll_lon =
>> ur_lat-ll_lat (i.e. the longitude range equals the latitude
>> range). Is this the case?
>> -Jeff
>>
>> -- Jeffrey S. Whitaker Phone : (303)497-6313
>> NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449
>> 325 Broadway Boulder, CO, USA 80305-3328
>>
>>
>>
>
> --
> 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-113
> Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
>
>
From: Jeff W. <js...@fa...> - 2008年12月16日 17:54:07
Roger André wrote:
> Hi Jeff,
>
> I checked, and no the images are not geographically square. I wonder 
> if I could approach this problem in a different way. Would it be 
> possible for me to add tick marks and annotation to the image without 
> using the Basemap module alone? My thinking is that I could bring the 
> image into Matplotlib, define a square figure, and then manually 
> define the size of the X and Y axes and label them. Is it possible to 
> "decorate" an image this way, without using any projection support?
>
> Thanks for the help,
>
> Roger
Roger: Sure, you could do that. I'm not sure why you would want to 
display an image that's not geographically square as a square though. 
What's wrong with just letting Basemap show it as a rectange?
-Jeff
> --
>
> On Tue, Dec 16, 2008 at 4:43 AM, Jeff Whitaker <js...@fa... 
> <mailto:js...@fa...>> wrote:
>
> Roger André wrote:
>
> Hi All,
>
> I have some square images which were generated via WMS
> requests. I have imported them into Matplotlib via
> pil_to_array, and then display them in a Basemap instance
> where I have defined the projection as:
>
> m = Basemap(projection='cyl', lon_0=lon_0, llcrnrlon=ll_lon,
> llcrnrlat=ll_lat, urcrnrlon=ur_lon,
> urcrnrlat=ur_lat, suppress_ticks=False)
>
> While this works (it appears the tics are at the right
> places), the image is no longer square, and I wonder if my
> projection definition is correct.
>
> Can someone show me what the correct Basemap parameters are
> for working with images that are in EPSG:4326?
>
> Thanks,
>
> Roger
>
>
> Roger: The image will only be square if ur_lon-ll_lon =
> ur_lat-ll_lat (i.e. the longitude range equals the latitude
> range). Is this the case?
> -Jeff
>
> -- 
> Jeffrey S. Whitaker Phone : (303)497-6313
> NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449
> 325 Broadway Boulder, CO, USA 80305-3328
>
>
-- 
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-113
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg

Showing results of 38

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