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) |
|
|
|
|
From: Mauro C. <mau...@gm...> - 2008-12-09 12:37:37
|
Dear Jeff & ALL, This is just a simple question on plotting points on Basemap (maybe it will have to be pursued further). I presume points could be plotted onto maps, no matter what projection is used -- so, I have been plotting quite well on maps using an Equirectangular projetion and one of your "classical" examples shows the plot of points on maps using an ortographic projection. However, my points are not displayed when I change the map projection, say, from Equirectangular to South Polar Stereographic, even if most of the points are well within range in the new projection. Any hints? Best regards, -- Dr. Mauro J. Cavalcanti Ecoinformatics Studio P.O. Box 46521, CEP 20551-970 Rio de Janeiro, RJ, BRASIL E-mail: mau...@gm... Web: http://studio.infobio.net Linux Registered User #473524 * Ubuntu User #22717 "Life is complex. It consists of real and imaginary parts." |
|
From: Jeff W. <js...@fa...> - 2008-12-09 12:26:40
|
Mauro Cavalcanti wrote:
> Dear ALL,
>
> Good morning! Here am I again with the first (and perhaps simpler)
> part of a potentially long question on plotting gridded data using MPL
> (*and* Basemap).
>
> Most examples I have found of plotting gridded data (using either
> MATLAB or MPL) depict highly sophisticated 3D plots that are much more
> than I can need, which turn to be plotting of data onto a geographic
> (therefore, regular and 2D) grid and displaying the plot over a
> Basemap (usually, but not necessarily, using an Equirectangular
> projection) -- so that I can come up with something like the attached
> figure.
>
> To begin with, here are some general questions:
>
> 1) Can a plot like this one (but not necessarily identical) be done
> with MPL/Basemap from gridded data?
>
Mauro: The answer is yes. It looks like a pcolor plot with missing
data over the oceans, so you will probably have to use a masked array
for the data with the ocean values masked.
> 2) For constructing the grid, I have to use the NumPy meshgrid()
> method, as the data are regularly spaced on a geographic grid. For
> example:
>
> import numpy
> import matplotlib.pyplot as plt
>
> coords = numpy.loadtxt('grid.dat')
> lon = coords[:,0]
> lat = coords[:,1]
> dat = coords[:,2]
> X, Y = numpy.meshgrid(lon, lat)
>
> where grid.dat is as follows (very simple dataset, just for
> demonstration purposes):
>
> -61.05 10.4 20
> -79.43 9.15 50
> -70.66 9.53 10
> -63.11 7.91 40
> -63.11 10.55 20
> -81.18 7.51 80
> -56.48 3.1 90
> -60.5 3.93 10
> -81.01 7.66 5
> -67.43 8.93 10
> -65.96 10.31 20
> -78.93 8.38 30
> -72.86 9.83 40
> -68.4 10.61 40
> -72.98 10.61 20
>
> The first two columns correspond to longitude, latitude, and the third
> correspond to the variable to be plotted onto the grid (species
> richness).
>
> The above script reads the data and generates the grid, but then, how
> can I display it on a 2D grid overlaid on a Basemap?
>
Assuming that this is a regular grid (so that using meshgrid makes
sense) you can
using pcolor:
m.pcolormesh(x,y,dat)
using contourf:
m.contourf(x,y,dat,clevs)
using imshow:
m.imshow(dat)
There are examples of all three included with basemap.
HTH,
-Jeff
> Well, as I mentioned above, this is the first part of a longer
> question (but I cannot pursue it first before solving these one
> first).
>
> Thanks in advance for any assistance you can provide.
>
> With best regards,
>
>
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> 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
>
--
Jeffrey S. Whitaker Phone : (303)497-6313
NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449
325 Broadway Boulder, CO, USA 80305-3328
|
|
From: Mauro C. <mau...@gm...> - 2008-12-09 11:59:10
|
Dear ALL,
Good morning! Here am I again with the first (and perhaps simpler)
part of a potentially long question on plotting gridded data using MPL
(*and* Basemap).
Most examples I have found of plotting gridded data (using either
MATLAB or MPL) depict highly sophisticated 3D plots that are much more
than I can need, which turn to be plotting of data onto a geographic
(therefore, regular and 2D) grid and displaying the plot over a
Basemap (usually, but not necessarily, using an Equirectangular
projection) -- so that I can come up with something like the attached
figure.
To begin with, here are some general questions:
1) Can a plot like this one (but not necessarily identical) be done
with MPL/Basemap from gridded data?
2) For constructing the grid, I have to use the NumPy meshgrid()
method, as the data are regularly spaced on a geographic grid. For
example:
import numpy
import matplotlib.pyplot as plt
coords = numpy.loadtxt('grid.dat')
lon = coords[:,0]
lat = coords[:,1]
dat = coords[:,2]
X, Y = numpy.meshgrid(lon, lat)
where grid.dat is as follows (very simple dataset, just for
demonstration purposes):
-61.05 10.4 20
-79.43 9.15 50
-70.66 9.53 10
-63.11 7.91 40
-63.11 10.55 20
-81.18 7.51 80
-56.48 3.1 90
-60.5 3.93 10
-81.01 7.66 5
-67.43 8.93 10
-65.96 10.31 20
-78.93 8.38 30
-72.86 9.83 40
-68.4 10.61 40
-72.98 10.61 20
The first two columns correspond to longitude, latitude, and the third
correspond to the variable to be plotted onto the grid (species
richness).
The above script reads the data and generates the grid, but then, how
can I display it on a 2D grid overlaid on a Basemap?
Well, as I mentioned above, this is the first part of a longer
question (but I cannot pursue it first before solving these one
first).
Thanks in advance for any assistance you can provide.
With best regards,
--
Dr. Mauro J. Cavalcanti
Ecoinformatics Studio
P.O. Box 46521, CEP 20551-970
Rio de Janeiro, RJ, BRASIL
E-mail: mau...@gm...
Web: http://studio.infobio.net
Linux Registered User #473524 * Ubuntu User #22717
"Life is complex. It consists of real and imaginary parts."
|
|
From: Fernando P. <fpe...@gm...> - 2008-12-08 23:38:40
|
On Mon, Dec 8, 2008 at 1:58 PM, Ryan May <rm...@gm...> wrote: > John Hunter wrote: > The scaling changes are in, as well as the warning and the corresponding lines in > api_changes and CHANGELOG. I also added the converted matlab demo I used to > figure this stuff out. Now would probably be the time to see if I did something > wrong (especially the warning). Question from the peanut gallery: are you guys putting in numerical tests as part of your unit test suite for this stuff? Rather than in the future saying 'I think in December 2008 it used to match matlab' it would be nice to have some automated testing of this. Useful if someone ever wants to optimize it, cythonize it, etc... Just a thought... f |
|
From: Jae-Joon L. <lee...@gm...> - 2008-12-08 23:20:07
|
John,
I remember that "-" is also rendedered as a dot in the HTML output.
Using "\-" instead of "-" seems to work. But, I'm afraid that the help
(or similar) command, which I frequently use in interactive sessions,
may show "\-" instead of "-".
So, quoting seems to be a best option to me.
Regards,
-JJ
On Mon, Dec 8, 2008 at 5:04 PM, John Hunter <jd...@gm...> wrote:
> In the Curve class of patches.py, where we are doing:
>
> _style_list["-"] = Curve
>
> and interpolating this into a rest table via patches._pprint_styles,
> which looks like this::
>
> ======== ====== =============================================
> Class Name Attrs
> ======== ====== =============================================
> Curve - None
> CurveB -> head_length=0.4,head_width=0.2
> BracketB -[ widthB=1.0,lengthB=0.2,angleB=None
> CurveA <- head_length=0.4,head_width=0.2
> CurveAB <-> head_length=0.4,head_width=0.2
> Fancy fancy head_length=0.4,head_width=0.4,tail_width=0.4
> Simple simple head_length=0.5,head_width=0.5,tail_width=0.2
> Wedge wedge tail_width=0.3,shrink_factor=0.5
> ======== ====== =============================================
>
>
> tex is inserting the following into the tex doc::
>
> Curve
> & \begin{itemize}
> \item {}
> \end{itemize}
> &
> None
> \\
>
> It looks like it thinks the hyphen is starting an itemize list, and
> this is breaking the tex table environment. Any ideas how to fix
> this?
>
> For now, I am going to quote the Name column with single quotes, eg '-' and '->'
>
> Thanks,
> JDH
>
> ------------------------------------------------------------------------------
> 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: Chad K. <cck...@gm...> - 2008-12-08 22:22:11
|
I've been looking for an elegant way to change, on a per-plot basis, the font attributes of my x and y tick labels. The best I've come up with is getting a list/collection of tick labels and looping through it to change the font attributes. Is there an easy one or two line way to do it? --Chad Kidder |
|
From: John H. <jd...@gm...> - 2008-12-08 22:04:22
|
In the Curve class of patches.py, where we are doing:
_style_list["-"] = Curve
and interpolating this into a rest table via patches._pprint_styles,
which looks like this::
======== ====== =============================================
Class Name Attrs
======== ====== =============================================
Curve - None
CurveB -> head_length=0.4,head_width=0.2
BracketB -[ widthB=1.0,lengthB=0.2,angleB=None
CurveA <- head_length=0.4,head_width=0.2
CurveAB <-> head_length=0.4,head_width=0.2
Fancy fancy head_length=0.4,head_width=0.4,tail_width=0.4
Simple simple head_length=0.5,head_width=0.5,tail_width=0.2
Wedge wedge tail_width=0.3,shrink_factor=0.5
======== ====== =============================================
tex is inserting the following into the tex doc::
Curve
& \begin{itemize}
\item {}
\end{itemize}
&
None
\\
It looks like it thinks the hyphen is starting an itemize list, and
this is breaking the tex table environment. Any ideas how to fix
this?
For now, I am going to quote the Name column with single quotes, eg '-' and '->'
Thanks,
JDH
|
|
From: Ryan M. <rm...@gm...> - 2008-12-08 21:58:51
|
John Hunter wrote: > On Mon, Dec 8, 2008 at 10:56 AM, Ryan May <rm...@gm...> wrote: > >> My only other concern is whether this belongs in 0.98.x. This is a behavior >> change from 0.98.3, not necessarily a bug fix. I'll defer to John, et al. >> on whether this should go in 0.98.x or go in a later release. > > It's a judgement call, but we have always had new features and minor > API changes in the point releases. Except on the 0.91 maintenance > branch, which is only bugfix, we have continuously added new stuff > on every release. When the breakage is likely to be difficult, or the > new feature really significant, we will push the major version. I > don't think these changes are so significant that they require waiting > until a new major version number, but you may want to consider issuing > a warning in addition to the requisite explanation in the docstring > and CHANGELOG. The scaling changes are in, as well as the warning and the corresponding lines in api_changes and CHANGELOG. I also added the converted matlab demo I used to figure this stuff out. Now would probably be the time to see if I did something wrong (especially the warning). Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma |
|
From: Chad K. <cck...@gm...> - 2008-12-08 20:20:14
|
On Dec 8, 2008, at 2:00 PM, Ryan May wrote:
> Chad Kidder wrote:
>> On Dec 8, 2008, at 12:55 PM, Ryan May wrote:
>>> Chad Kidder wrote:
>>>> I've got many series of data that I want to plot, and each has
>>>> an additional scalar that is valid for the whole series. What
>>>> I want to do is plot all these series on top of each other
>>>> (plot can do this just fine), but with the additional scalar
>>>> changing the color, efectively using color as the z-axis. I'm
>>>> not seeing how to do that. If there was a function where I
>>>> could give a color map a value and it would spit out the color,
>>>> that would work, but I haven't seen it. Thanks for your help.
>>> Try using scatter instead of plot. Specifically, the 'c' keyword
>>> argument:
>>>
>>> *c*:
>>> a color. *c* can be a single color format string, or a
>>> sequence of color specifications of length *N*, or a
>>> sequence of *N* numbers to be mapped to colors using the
>>> *cmap* and *norm* specified via kwargs (see below). Note
>>> that *c* should not be a single numeric RGB or RGBA
>>> sequence because that is indistinguishable from an array
>>> of values to be colormapped. *c* can be a 2-D array in
>>> which the rows are RGB or RGBA, however.
>
> Here's what you're looking for:
>
> import numpy as n
> import matplotlib.pyplot as p
> import matplotlib.colors as mcolors
> import matplotlib.cm as cm
>
> cmap = cm.get_cmap('winter')
> norm = mcolors.Normalize(0, 1) #Range of z
>
> nlines = 100
> z = n.random.rand(nlines)
> x = n.arange(nlines)
> t1, t2 = n.meshgrid(x,z)
> y = t1+t2-0.5
>
> #Uses normalize to map z values to range of 0 to 1.
> #Cmap maps these normalized values to colors
> colors = cmap(norm(z))
> for ii in range(nlines):
> p.plot(x, y[ii], color=colors[ii])
> p.show()
>
> Ryan
Thanks all. I had tried something close, but it didn't work. This
works great.
|
|
From: Ryan M. <rm...@gm...> - 2008-12-08 20:00:26
|
Chad Kidder wrote:
> On Dec 8, 2008, at 12:55 PM, Ryan May wrote:
>
>> Chad Kidder wrote:
>>> I've got many series of data that I want to plot, and each has an
>>> additional scalar that is valid for the whole series. What I want
>>> to do is plot all these series on top of each other (plot can do
>>> this just fine), but with the additional scalar changing the
>>> color, efectively using color as the z-axis. I'm not seeing how
>>> to do that. If there was a function where I could give a color
>>> map a value and it would spit out the color, that would work, but
>>> I haven't seen it. Thanks for your help.
>> Try using scatter instead of plot. Specifically, the 'c' keyword
>> argument:
>>
>> *c*:
>> a color. *c* can be a single color format string, or a
>> sequence of color specifications of length *N*, or a
>> sequence of *N* numbers to be mapped to colors using the
>> *cmap* and *norm* specified via kwargs (see below). Note
>> that *c* should not be a single numeric RGB or RGBA
>> sequence because that is indistinguishable from an array
>> of values to be colormapped. *c* can be a 2-D array in
>> which the rows are RGB or RGBA, however.
Here's what you're looking for:
import numpy as n
import matplotlib.pyplot as p
import matplotlib.colors as mcolors
import matplotlib.cm as cm
cmap = cm.get_cmap('winter')
norm = mcolors.Normalize(0, 1) #Range of z
nlines = 100
z = n.random.rand(nlines)
x = n.arange(nlines)
t1, t2 = n.meshgrid(x,z)
y = t1+t2-0.5
#Uses normalize to map z values to range of 0 to 1.
#Cmap maps these normalized values to colors
colors = cmap(norm(z))
for ii in range(nlines):
p.plot(x, y[ii], color=colors[ii])
p.show()
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
|
|
From: Eric F. <ef...@ha...> - 2008-12-08 19:57:28
|
Chad Kidder wrote:
> On Dec 8, 2008, at 12:55 PM, Ryan May wrote:
>
>> Chad Kidder wrote:
>>> I've got many series of data that I want to plot, and each has an
>>> additional scalar that is valid for the whole series. What I want
>>> to do is plot all these series on top of each other (plot can do
>>> this just fine), but with the additional scalar changing the
>>> color, efectively using color as the z-axis. I'm not seeing how
>>> to do that. If there was a function where I could give a color
>>> map a value and it would spit out the color, that would work, but
>>> I haven't seen it. Thanks for your help.
>> Try using scatter instead of plot. Specifically, the 'c' keyword
>> argument:
>>
>> *c*:
>> a color. *c* can be a single color format string, or a
>> sequence of color specifications of length *N*, or a
>> sequence of *N* numbers to be mapped to colors using the
>> *cmap* and *norm* specified via kwargs (see below). Note
>> that *c* should not be a single numeric RGB or RGBA
>> sequence because that is indistinguishable from an array
>> of values to be colormapped. *c* can be a 2-D array in
>> which the rows are RGB or RGBA, however.
>>
>> For example:
>>
>> import numpy as np
>> import matplotlib.pyplot as plt
>>
>> x = np.random.randn(100)
>> y = np.random.randn(100)
>> data = x**2 + y**2
>> plt.scatter(x, y, c=data)
>> plt.show()
>>
>> Ryan
>>
>
> Close, but not quite what I want. Maybe this will tell what I want to
> do better:
>
> ----------------------
> import numpy as n
> import matplotlib.pyplot as p
>
> nlines = 100
> z = n.random.rand(nlines)
> x = n.array(range(nlines))
> t1, t2 = n.meshgrid(x,z)
> y = t1+t2-0.5
> for ii in range(nlines):
> p.plot(x,y[ii,:],color = str(z[ii]))
> p.show()
> -------------------
> Instead of getting a grayscale plot out, I'd like to use a colormap
> like jet() or winter(). Any ideas there?
In [6]:cmap = get_cmap('jet')
In [7]:cmap(0.2)
Out[7]:(0.0, 0.29999999999999999, 1.0, 1.0)
In [8]:cmap(0.8)
Out[8]:(1.0, 0.40740740740740755, 0.0, 1.0)
The pyplot.get_cmap() function gets a colormap by name. Calling that
colormap with a floating-point argument in the 0-1 range returns the
mapped color as an rgba tuple, which will be accepted by the color kwarg
of plot. You can use pyplot.normalize to map your z range to the 0-1 range:
In [2]:norm = normalize(vmin=2, vmax=4)
In [3]:norm(3)
Out[3]:0.5
Alternatively, you can use a LineCollection. See the
examples/pylab_examples/line_collection2.py script.
Eric
>
>
>
>
>
> --Chad Kidder
>
> ------------------------------------------------------------------------------
> 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: John H. <jd...@gm...> - 2008-12-08 19:47:17
|
On Mon, Dec 8, 2008 at 1:25 PM, Chad Kidder <cck...@gm...> wrote:
-------------------
> Instead of getting a grayscale plot out, I'd like to use a colormap
> like jet() or winter(). Any ideas there?
How about?
import matplotlib.cm as cm
for ii in range(nlines):
color = cm.jet(z[ii])
p.plot(x,y[ii,:],color=color)
All of the mpl colormaps are callable, so if you pass in a [0..1]
normalized value they will return an RGB tuple
JDH
|
|
From: Chad K. <cck...@gm...> - 2008-12-08 19:25:27
|
On Dec 8, 2008, at 12:55 PM, Ryan May wrote:
> Chad Kidder wrote:
>> I've got many series of data that I want to plot, and each has an
>> additional scalar that is valid for the whole series. What I want
>> to do is plot all these series on top of each other (plot can do
>> this just fine), but with the additional scalar changing the
>> color, efectively using color as the z-axis. I'm not seeing how
>> to do that. If there was a function where I could give a color
>> map a value and it would spit out the color, that would work, but
>> I haven't seen it. Thanks for your help.
>
> Try using scatter instead of plot. Specifically, the 'c' keyword
> argument:
>
> *c*:
> a color. *c* can be a single color format string, or a
> sequence of color specifications of length *N*, or a
> sequence of *N* numbers to be mapped to colors using the
> *cmap* and *norm* specified via kwargs (see below). Note
> that *c* should not be a single numeric RGB or RGBA
> sequence because that is indistinguishable from an array
> of values to be colormapped. *c* can be a 2-D array in
> which the rows are RGB or RGBA, however.
>
> For example:
>
> import numpy as np
> import matplotlib.pyplot as plt
>
> x = np.random.randn(100)
> y = np.random.randn(100)
> data = x**2 + y**2
> plt.scatter(x, y, c=data)
> plt.show()
>
> Ryan
>
Close, but not quite what I want. Maybe this will tell what I want to
do better:
----------------------
import numpy as n
import matplotlib.pyplot as p
nlines = 100
z = n.random.rand(nlines)
x = n.array(range(nlines))
t1, t2 = n.meshgrid(x,z)
y = t1+t2-0.5
for ii in range(nlines):
p.plot(x,y[ii,:],color = str(z[ii]))
p.show()
-------------------
Instead of getting a grayscale plot out, I'd like to use a colormap
like jet() or winter(). Any ideas there?
--Chad Kidder
|
|
From: Ryan M. <rm...@gm...> - 2008-12-08 19:20:47
|
John Hunter wrote: > On Mon, Dec 8, 2008 at 10:56 AM, Ryan May <rm...@gm...> wrote: > >> My only other concern is whether this belongs in 0.98.x. This is a behavior >> change from 0.98.3, not necessarily a bug fix. I'll defer to John, et al. >> on whether this should go in 0.98.x or go in a later release. > > It's a judgement call, but we have always had new features and minor > API changes in the point releases. Except on the 0.91 maintenance > branch, which is only bugfix, we have continuously added new stuff > on every release. When the breakage is likely to be difficult, or the > new feature really significant, we will push the major version. I > don't think these changes are so significant that they require waiting > until a new major version number, but you may want to consider issuing > a warning in addition to the requisite explanation in the docstring > and CHANGELOG. How about making the default None, and if the default is used set to True and issue the warning for this release. In the future the warning is remove and the default goes to True. As long as we're going for Matlab compatibility, what about changing Fs from defaulting to 2 to 2*pi? That seems to be the default. Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma |
|
From: Ryan M. <rm...@gm...> - 2008-12-08 18:55:56
|
Chad Kidder wrote:
> I've got many series of data that I want to plot, and each has an
> additional scalar that is valid for the whole series. What I want to
> do is plot all these series on top of each other (plot can do this
> just fine), but with the additional scalar changing the color,
> efectively using color as the z-axis. I'm not seeing how to do that.
> If there was a function where I could give a color map a value and it
> would spit out the color, that would work, but I haven't seen it.
> Thanks for your help.
Try using scatter instead of plot. Specifically, the 'c' keyword argument:
*c*:
a color. *c* can be a single color format string, or a
sequence of color specifications of length *N*, or a
sequence of *N* numbers to be mapped to colors using the
*cmap* and *norm* specified via kwargs (see below). Note
that *c* should not be a single numeric RGB or RGBA
sequence because that is indistinguishable from an array
of values to be colormapped. *c* can be a 2-D array in
which the rows are RGB or RGBA, however.
For example:
import numpy as np
import matplotlib.pyplot as plt
x = np.random.randn(100)
y = np.random.randn(100)
data = x**2 + y**2
plt.scatter(x, y, c=data)
plt.show()
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
|
|
From: John H. <jd...@gm...> - 2008-12-08 18:53:08
|
On Mon, Dec 8, 2008 at 12:45 PM, Chad Kidder <cck...@gm...> wrote: > I've got many series of data that I want to plot, and each has an > additional scalar that is valid for the whole series. What I want to > do is plot all these series on top of each other (plot can do this > just fine), but with the additional scalar changing the color, > efectively using color as the z-axis. I'm not seeing how to do that. > If there was a function where I could give a color map a value and it > would spit out the color, that would work, but I haven't seen it. > Thanks for your help. Check out the scatter_demo -- scatter takes an optional argument 'c' for the color and an optional colormap http://matplotlib.sourceforge.net/users/screenshots.html#scatter-demo > > --Chad Kidder > > > > ------------------------------------------------------------------------------ > 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: Chad K. <cck...@gm...> - 2008-12-08 18:45:24
|
I've got many series of data that I want to plot, and each has an additional scalar that is valid for the whole series. What I want to do is plot all these series on top of each other (plot can do this just fine), but with the additional scalar changing the color, efectively using color as the z-axis. I'm not seeing how to do that. If there was a function where I could give a color map a value and it would spit out the color, that would work, but I haven't seen it. Thanks for your help. --Chad Kidder |
|
From: Mauro C. <mau...@gm...> - 2008-12-08 18:35:50
|
Dear Jeff, 2008/12/8 Jeff Whitaker <js...@fa...>: > Mauro: That's because the default is not really a map projection at all - > it just displays the data in lat/lon coordinates. The map scale really > has no meaning in that case. Sure, however some biological journals insist that authors provide these scales (and in at least one case I known of, also a wind rose!!!!) on all maps, even if when they have no meaning (as is the case with the Equirectangular projection). Regrettably, as I mentioned earlier, there have been no discussion of map projections -- their meaning and significance -- among biogeographers. With best regards, -- Dr. Mauro J. Cavalcanti Ecoinformatics Studio P.O. Box 46521, CEP 20551-970 Rio de Janeiro, RJ, BRASIL E-mail: mau...@gm... Web: http://studio.infobio.net Linux Registered User #473524 * Ubuntu User #22717 "Life is complex. It consists of real and imaginary parts." |
|
From: Jeff W. <js...@fa...> - 2008-12-08 18:27:06
|
Mauro Cavalcanti wrote: > Dear Jeff, > > Thanks.... Unfortunately, the map scale cannot be drawn for > cylindrical projections like the Equirectangular default... :-( > Mauro: That's because the default is not really a map projection at all - it just displays the data in lat/lon coordinates. The map scale really has no meaning in that case. -Jeff > Best wishes, > > 2008/12/8 Jeff Whitaker <js...@fa...>: > >> Mauro Cavalcanti wrote: >> >>> Dear Jeff & ALL, >>> >>> Are there any examples of the use of the drawmapscale() Basemap >>> method? I can use this myself and will also add any examples to the >>> forthcoming "Basemap Cookbook" website (for this, I am compiling all >>> available examples). >>> >>> Thanks in advance! >>> >>> Best wishes, >>> >>> >>> >> Mauro: >> >> see the ortho_demo.py example. >> >> -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-113 >> Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg >> >> >> > > > > -- 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: Mauro C. <mau...@gm...> - 2008-12-08 18:03:42
|
Dear Jeff, Thanks.... Unfortunately, the map scale cannot be drawn for cylindrical projections like the Equirectangular default... :-( Best wishes, 2008/12/8 Jeff Whitaker <js...@fa...>: > Mauro Cavalcanti wrote: >> >> Dear Jeff & ALL, >> >> Are there any examples of the use of the drawmapscale() Basemap >> method? I can use this myself and will also add any examples to the >> forthcoming "Basemap Cookbook" website (for this, I am compiling all >> available examples). >> >> Thanks in advance! >> >> Best wishes, >> >> > > Mauro: > > see the ortho_demo.py example. > > -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-113 > Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg > > -- Dr. Mauro J. Cavalcanti Ecoinformatics Studio P.O. Box 46521, CEP 20551-970 Rio de Janeiro, RJ, BRASIL E-mail: mau...@gm... Web: http://studio.infobio.net Linux Registered User #473524 * Ubuntu User #22717 "Life is complex. It consists of real and imaginary parts." |
|
From: Jeff W. <js...@fa...> - 2008-12-08 17:46:35
|
Mauro Cavalcanti wrote: > Dear Jeff & ALL, > > Are there any examples of the use of the drawmapscale() Basemap > method? I can use this myself and will also add any examples to the > forthcoming "Basemap Cookbook" website (for this, I am compiling all > available examples). > > Thanks in advance! > > Best wishes, > > Mauro: see the ortho_demo.py example. -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-113 Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg |
|
From: Mauro C. <mau...@gm...> - 2008-12-08 17:43:31
|
Dear Jeff & ALL, Are there any examples of the use of the drawmapscale() Basemap method? I can use this myself and will also add any examples to the forthcoming "Basemap Cookbook" website (for this, I am compiling all available examples). Thanks in advance! Best wishes, -- Dr. Mauro J. Cavalcanti Ecoinformatics Studio P.O. Box 46521, CEP 20551-970 Rio de Janeiro, RJ, BRASIL E-mail: mau...@gm... Web: http://studio.infobio.net Linux Registered User #473524 * Ubuntu User #22717 "Life is complex. It consists of real and imaginary parts." |
|
From: Jeff W. <js...@fa...> - 2008-12-08 17:22:40
|
Mauro Cavalcanti wrote: > Dear Jeff, > > 2008/12/8 Jeff Whitaker <js...@fa...>: > >> Mauro: I just added a 'scale' keyword to bluemarble that downsamples the >> image to speed things up. scale=1.0 (the default) gives the same answer as >> before (the full resolution image). scale=0.5 downsamples the image to half >> the original size, speeding things up considerably (and using a lot less >> memory, which I think is the real problem). >> > > Thank you very much for that! Yes, the real problem with the slow > plotting of Blue Marble very probably concerns the amount of available > memory and not the processor speed. I will try it ASAP. I suppose this > modification is also available only via SVN? Is there a time schedule > for releasing a new distribution version incorporating this recent > changes? I need a setup package that can be downloaded and installed > by computer-unsophisticated Windows users :-( > > More soon... > > With best wishes, > > Mauro: I can make a new release shortly, after the new changes have been tested a bit. -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-113 Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg |
|
From: Mauro C. <mau...@gm...> - 2008-12-08 17:16:43
|
Dear Jeff, 2008/12/8 Jeff Whitaker <js...@fa...>: > Mauro: I just added a 'scale' keyword to bluemarble that downsamples the > image to speed things up. scale=1.0 (the default) gives the same answer as > before (the full resolution image). scale=0.5 downsamples the image to half > the original size, speeding things up considerably (and using a lot less > memory, which I think is the real problem). Thank you very much for that! Yes, the real problem with the slow plotting of Blue Marble very probably concerns the amount of available memory and not the processor speed. I will try it ASAP. I suppose this modification is also available only via SVN? Is there a time schedule for releasing a new distribution version incorporating this recent changes? I need a setup package that can be downloaded and installed by computer-unsophisticated Windows users :-( More soon... With best wishes, -- Dr. Mauro J. Cavalcanti Ecoinformatics Studio P.O. Box 46521, CEP 20551-970 Rio de Janeiro, RJ, BRASIL E-mail: mau...@gm... Web: http://studio.infobio.net Linux Registered User #473524 * Ubuntu User #22717 "Life is complex. It consists of real and imaginary parts." |
|
From: John H. <jd...@gm...> - 2008-12-08 17:16:01
|
On Mon, Dec 8, 2008 at 10:56 AM, Ryan May <rm...@gm...> wrote: > My only other concern is whether this belongs in 0.98.x. This is a behavior > change from 0.98.3, not necessarily a bug fix. I'll defer to John, et al. > on whether this should go in 0.98.x or go in a later release. It's a judgement call, but we have always had new features and minor API changes in the point releases. Except on the 0.91 maintenance branch, which is only bugfix, we have continuously added new stuff on every release. When the breakage is likely to be difficult, or the new feature really significant, we will push the major version. I don't think these changes are so significant that they require waiting until a new major version number, but you may want to consider issuing a warning in addition to the requisite explanation in the docstring and CHANGELOG. JDH |