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
(15) |
3
(16) |
4
(3) |
5
(1) |
|
6
(1) |
7
(11) |
8
(10) |
9
(13) |
10
(24) |
11
(21) |
12
(10) |
|
13
(2) |
14
(24) |
15
(20) |
16
(36) |
17
(13) |
18
(6) |
19
(4) |
|
20
(2) |
21
(11) |
22
(13) |
23
(7) |
24
(10) |
25
(7) |
26
(12) |
|
27
(2) |
28
(6) |
29
(20) |
30
(9) |
31
(39) |
|
|
|
From: Alan G I. <ai...@am...> - 2008-07-16 23:54:33
|
> On Wed, Jul 16, 2008 at 5:51 PM, Christopher Barker wrote: >> I'd like to see the Delaunay stuff included -- in fact, >> you could contour irregular data directly using Delaunay >> triangulation. On Wed, 16 Jul 2008, John Hunter apparently wrote: > I'd love to see it included to -- I believe the problem is finding a > good code that is BSD compatible. I have not been following this thread so sorry if this proves irrelevant. I assume you know of Robert Kern's code? <URL:http://cours-info.iut-bm.univ-fcomte.fr/docs/python/scipy/scipy.sandbox.delaunay-module.html> Cheers, Alan Isaac |
|
From: John H. <jd...@gm...> - 2008-07-16 23:51:26
|
On Wed, Jul 16, 2008 at 5:51 PM, Christopher Barker <Chr...@no...> wrote: > In there, is says that MPL does not have this functionality built in -- > is that still true? > > If so, I'd like to see the Delaunay stuff included -- in fact, you could > contour irregular data directly using Delaunay triangulation. I'd love to see it included to -- I believe the problem is finding a good code that is BSD compatible. JDH |
|
From: Christopher B. <Chr...@no...> - 2008-07-16 22:49:46
|
Oz Nahum wrote: > What I want to do plot is a cross section, and there is no easy way to > extrapulate between points. Not in excell and not in matlab. I hope you mean interpolate -- extrapolation is fraught with danger! > here is a simplification: > > > distance > _____________________________________________________ > | > | x x > | x x x > | > | y y y y > y y > | > | z > | z z > z z > | > | > Now I want to draw contours between the x's y's and z's. This will > allow me to create very quickly lots' of graph of temp. prfiles of the > gulf. OK, it looks like what you've got is some data on an irregularly spaced grid, in x.y space. To draw a contour plot of that data, you need to interpolate it onto a regular grid. Here is wiki page about that: http://www.scipy.org/Cookbook/Matplotlib/Gridding_irregularly_spaced_data In there, is says that MPL does not have this functionality built in -- is that still true? If so, I'd like to see the Delaunay stuff included -- in fact, you could contour irregular data directly using Delaunay triangulation. -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: Alan G I. <ai...@am...> - 2008-07-16 22:39:07
|
On Wed, 16 Jul 2008, Michael Droettboom apparently wrote: > [Attachment: dolphin.py : TEXT/PLAIN, 62 lines] I have to say, I was completely unaware of the path.Path capability of Matplotlib, but even if I had known of it, I would not have thought of how to exploit it this way. Even though this was intended to be just for fun, I hope it will be added to the examples. Thanks! Alan Isaac |
|
From: Christopher B. <Chr...@no...> - 2008-07-16 22:35:15
|
Oz Nahum wrote: > I still get this error > Traceback (most recent call last): > File "yael.py", line 24, in <module> > x = x.transpose() > AttributeError: 'tuple' object has no attribute 'transpose' as someone suggested, you really want to read up on numpy -- the transpose method is a method of numpy arrays. numpy arrays are kind of like Matlab matrixes, only more powerful and flexible. MPL is using numpy arrays inside anyway. > and one more thing I discovered. the Data points that are ploted are not > temperature... this are the depth:distance coordinates. if you have a contour plot, you have depth,distance as your x,y coordinates, with the temp value shown by the contours How did you expect to plot temp on top of that? > I am a lost case about reading tutorial at the moment. > I am in a middle of a very intense course, and they expect us to do > crazy stuff with matlab. so it's either that or solving with python. Either way, there is not choice but to learn a bit first! As hard as this is, you're right trying to do all your computation and plotting with with a spreadsheet is a nightmare -- you'll be glad you've learned it! Have you read the MPL docs -- there's a lot of good, simple examples in there: http://matplotlib.sourceforge.net/users_guide_0.98.1.pdf -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: Oz N. <na...@gm...> - 2008-07-16 21:54:49
|
So, after mailing all the previous mails, I've thought maybe I'm not asking
the right question.
What I want to do plot is a cross section, and there is no easy way to
extrapulate between points. Not in excell and not in matlab.
here is a simplification:
distance
_____________________________________________________
|
| x x
| x x x
|
| y y y y
y y
|
| z
| z z
z z
|
|
suppose the letters represent the temps: 29, 26, 23 deg. cel. and the
unmarked y axis is depth.
Now I want to draw contours between the x's y's and z's. This will allow me
to create very quickly lots' of graph of temp. prfiles of the gulf.
Many thanks, again. Oz
|
|
From: Chee S. L. <che...@gm...> - 2008-07-16 21:41:48
|
Hello, I'm pretty new to matplotlib, so please bear with me. I am writing an application that includes a hexagonally binned scatter plot that updates periodically, up to a couple times a second. My current approach is clearing axes.collections, calling hexbin() with the updated data, and then calling canvas.draw(). It works, but it is entirely too slow. I would like to implement the blitting animation technique shown in the matplotlib cookbook, but the collection object returned by hexbin() doesn't seem to have any sort of set_data method to update the data. Any suggestions? I am using the wxPython GUI tookit, and FigureCanvasWxAgg. Thanks, Chee Sing Lee |
|
From: Oz N. <na...@gm...> - 2008-07-16 21:21:10
|
Dear Mike, I really laughed. Many thanks. It's almost to late for me to really understand the code now. But some how you managed to throw in some stuff that can help: you've made what I've wanted except for the dolphin. I am sorry about the exagerating, but everybody here keep talking about this young dolphin that keeps swimming around the reef here (I am in Eilat, northren tip of Gulf of Aqaba). Anyways, many thanks for you people trying to help. Oz. On Thu, Jul 17, 2008 at 12:12 AM, Michael Droettboom <md...@st...> wrote: > Oz Nahum wrote: > >> I am mostly frustrated with documentation writers who write very nice >> tutorials describing how to plot completely unusfull graphs of spheres >> inside loops and a dolphin swimming in the middle. >> > I'm sorry. I just couldn't resist writing a tutorial example for this. > Please take it in the spirit of fun it was intended. > > Mike > > -- > Michael Droettboom > Science Software Branch > Operations and Engineering Division > Space Telescope Science Institute > Operated by AURA for NASA > > > import matplotlib.pyplot as plt > from matplotlib.patches import Circle, PathPatch > from matplotlib.path import Path > from matplotlib.transforms import Affine2D > import numpy as np > > r = np.random.rand(50) > t = np.random.rand(50) * np.pi * 2.0 > x = r * np.cos(t) > y = r * np.sin(t) > > fig = plt.figure(figsize=(6,6)) > ax = plt.subplot(111) > circle = Circle((0, 0), 1, facecolor=(0,0,0.8), > edgecolor=(0,0.8,0.8), linewidth=3, alpha=0.5) > ax.add_patch(circle) > > plt.plot(x, y, 'o', color=(0.9, 0.9, 1.0), alpha=0.8) > > # Dolphin from OpenClipart library by Andy Fitzsimon > # <cc:License rdf:about="http://web.resource.org/cc/PublicDomain"> > # <cc:permits rdf:resource=" > http://web.resource.org/cc/Reproduction"/> > # <cc:permits rdf:resource=" > http://web.resource.org/cc/Distribution"/> > # <cc:permits rdf:resource=" > http://web.resource.org/cc/DerivativeWorks"/> > # </cc:License> > > dolphin = """ > M -0.59739425,160.18173 C -0.62740401,160.18885 -0.57867129,160.11183 > -0.57867129,160.11183 C -0.57867129,160.11183 -0.5438361,159.89315 > -0.39514638,159.81496 C -0.24645668,159.73678 -0.18316813,159.71981 > -0.18316813,159.71981 C -0.18316813,159.71981 -0.10322971,159.58124 > -0.057804323,159.58725 C -0.029723983,159.58913 -0.061841603,159.60356 > -0.071265813,159.62815 C -0.080250183,159.65325 -0.082918513,159.70554 > -0.061841203,159.71248 C -0.040763903,159.7194 -0.0066711426,159.71091 > 0.077336307,159.73612 C 0.16879567,159.76377 0.28380306,159.86448 > 0.31516668,159.91533 C 0.3465303,159.96618 0.5011127,160.1771 > 0.5011127,160.1771 C 0.63668998,160.19238 0.67763022,160.31259 > 0.66556395,160.32668 C 0.65339985,160.34212 0.66350443,160.33642 > 0.64907098,160.33088 C 0.63463742,160.32533 0.61309688,160.297 > 0.5789627,160.29339 C 0.54348657,160.28968 0.52329693,160.27674 > 0.50728856,160.27737 C 0.49060916,160.27795 0.48965803,160.31565 > 0.46114204,160.33673 C 0.43329696,160.35786 0.4570711,160.39871 > 0.43309565,160.40685 C 0.4105108,160.41442 0.39416631,160.33027 > 0.3954995,160.2935 C 0.39683269,160.25672 0.43807996,160.21522 > 0.44567915,160.19734 C 0.45327833,160.17946 0.27946869,159.9424 > -0.061852613,159.99845 C -0.083965233,160.0427 -0.26176109,160.06683 > -0.26176109,160.06683 C -0.30127962,160.07028 -0.21167141,160.09731 > -0.24649368,160.1011 C -0.32642366,160.11569 -0.34521187,160.06895 > -0.40622293,160.0819 C -0.467234,160.09485 -0.56738444,160.17461 > -0.59739425,160.18173 > """ > > vertices = [] > codes = [] > parts = dolphin.split() > i = 0 > code_map = { > 'M': (Path.MOVETO, 1), > 'C': (Path.CURVE4, 3), > 'L': (Path.LINETO, 1) > } > > while i < len(parts): > code = parts[i] > path_code, npoints = code_map[code] > codes.extend([path_code] * npoints) > vertices.extend([[float(x) for x in y.split(',')] for y in > parts[i+1:i+npoints+1]]) > i += npoints + 1 > vertices = np.array(vertices, np.float) > vertices[:,1] -= 160 > > dolphin_path = Path(vertices, codes) > dolphin_patch = PathPatch(dolphin_path, facecolor=(0.6, 0.6, 0.6), > edgecolor=(0.0, 0.0, 0.0)) > ax.add_patch(dolphin_patch) > > vertices = Affine2D().rotate_deg(60).transform(vertices) > dolphin_path2 = Path(vertices, codes) > dolphin_patch2 = PathPatch(dolphin_path2, facecolor=(0.5, 0.5, 0.5), > edgecolor=(0.0, 0.0, 0.0)) > ax.add_patch(dolphin_patch2) > > plt.show() > > |
|
From: Michael D. <md...@st...> - 2008-07-16 21:12:21
|
Oz Nahum wrote: > I am mostly frustrated with documentation writers who write very nice > tutorials describing how to plot completely unusfull graphs of spheres > inside loops and a dolphin swimming in the middle. I'm sorry. I just couldn't resist writing a tutorial example for this. Please take it in the spirit of fun it was intended. Mike -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA |
|
From: Oz N. <na...@gm...> - 2008-07-16 20:34:49
|
I still get this error
Traceback (most recent call last):
File "yael.py", line 24, in <module>
x = x.transpose()
AttributeError: 'tuple' object has no attribute 'transpose'
and one more thing I discovered. the Data points that are ploted are not
temperature... this are the depth:distance coordinates.
I am a lost case about reading tutorial at the moment.
I am in a middle of a very intense course, and they expect us to do crazy
stuff with matlab. so it's either that or solving with python. I'll do read
it when I have time...
I am mostly frustrated with documentation writers who write very nice
tutorials describing how to plot completely unusfull graphs of spheres
inside loops and a dolphin swimming in the middle.
Come on, this is not what users need. I am talking about what many students
feel. We need real tutorials, this why I wrote my own little tutorial here
http://www.tabula0rasa.org/?p=21
but that's not enough.
sorry about making so much fuss in the mailing list and crying my hearts
out, but I thought since I know python it's worth trying this and not
mathlab
Oz
On Wed, Jul 16, 2008 at 11:20 PM, John Hunter <jd...@gm...> wrote:
> On Wed, Jul 16, 2008 at 3:18 PM, Oz Nahum <na...@gm...> wrote:
> >>You can transpose your inputs. For numpy arrays: x = x.transpose()
> >
> > i wrote:
> > for np arrays: x = x.transpose()
> >
> > but I still get a syntax error.
>
> umm.... that was english, not python. They python is
>
> x = x.transpose()
>
> I know you are anxious to get results fast, but I suggest taking a
> deep breath and doing a little reading on the numpy and matplotlib
> tutorials linked on theor respective websites....
>
> JDH
>
|
|
From: John H. <jd...@gm...> - 2008-07-16 20:20:33
|
On Wed, Jul 16, 2008 at 3:18 PM, Oz Nahum <na...@gm...> wrote: >>You can transpose your inputs. For numpy arrays: x = x.transpose() > > i wrote: > for np arrays: x = x.transpose() > > but I still get a syntax error. umm.... that was english, not python. They python is x = x.transpose() I know you are anxious to get results fast, but I suggest taking a deep breath and doing a little reading on the numpy and matplotlib tutorials linked on theor respective websites.... JDH |
|
From: Tim M. <tim...@gm...> - 2008-07-16 20:19:37
|
Oz Nahum schrieb: > Hi, > I want to draw a contour plot which uses data from files. I know how to > import the files, so it's not the main issue. I was discussion a similar issue with Jeff this week. Take a look at the thread: http://news.gmane.org/gmane.comp.python.matplotlib.general Unfortunately, I had to focus on other things and had to postpone the development of my script... |
|
From: Oz N. <na...@gm...> - 2008-07-16 20:18:35
|
>You can transpose your inputs. For numpy arrays: x = x.transpose() i wrote: for np arrays: x = x.transpose() but I still get a syntax error. > > Also, one more thing, I can't find how to expand the borders of the plot, > > say from 350 to 400 > > (same for depth) I tried usig xlim and ylim(0,900) but no result. > > >Subsequent calls to plot will call the autoscaler, so either you need > >to set the xlim *after* all the plotting commands or turn off > >autoscaling entirely by passing the autoscale_on=False property to the > >axes, eg > > >plt.gca().set_autoscale_on(False) > That does for the one of the problems. And I still haven't manage to plot the 4th series. still many thanks... hope I can figure this out... |
|
From: John H. <jd...@gm...> - 2008-07-16 20:11:03
|
On Wed, Jul 16, 2008 at 2:58 PM, Oz Nahum <na...@gm...> wrote: > Here is why the contours are wrong: > they are ploted verticaly, while I think, it is more common to draw temp. > contours in oceanography when the are horizontal. You can transpose your inputs. For numpy arrays: x = x.transpose() > Also, one more thing, I can't find how to expand the borders of the plot, > say from 350 to 400 > (same for depth) I tried usig xlim and ylim(0,900) but no result. Subsequent calls to plot will call the autoscaler, so either you need to set the xlim *after* all the plotting commands or turn off autoscaling entirely by passing the autoscale_on=False property to the axes, eg plt.gca().set_autoscale_on(False) |
|
From: Oz N. <na...@gm...> - 2008-07-16 19:58:48
|
Here is why the contours are wrong:
they are ploted verticaly, while I think, it is more common to draw temp.
contours in oceanography when the are horizontal.
Also, one more thing, I can't find how to expand the borders of the plot,
say from 350 to 400
(same for depth) I tried usig xlim and ylim(0,900) but no result.
Here is my code now, I can't really get it, ha ?
another issue is that I've added anoter temp. series but it won't show it. I
still see 3 rows.
from matplotlib import pyplot as plt
from pylab import *
temperature=[
[9,8,6],
[9,7,6],
[9,7,6],
[9,6,6]
]
distance = (0,200,350)
depth = (100,250,250,700)
x = distance
y = depth
z = temperature
#m = plt.contourf(x,y,z)
m = plt.contour(x,y,z)
ylabel('Depth')
xlabel('Distance')
ylim(0,1200)
#plt.xlim(0,500)
plt.gca().invert_yaxis()
#plt.colorbar(m)
import numpy as np
X, Y = np.meshgrid(x,y)
#plt.hold(True) # probably not necessary
plt.plot(X,Y, 'o')
plt.show(m)
On Wed, Jul 16, 2008 at 10:28 PM, Eric Firing <ef...@ha...> wrote:
> Oz Nahum wrote:
>
>> Hi Eric,
>> really thanks for your help so far. I am doing a quick short course, and
>> I'll do the examples later.
>> I've fixed the code, here it is:
>>
>> from matplotlib import pyplot as plt
>> temperature=[
>> [10,8,6],
>> [9,7,5],
>> [8,7,4]
>> ]
>>
>> distance = (100,200,300)
>> depth = (100,300,700)
>>
>> x = distance
>> y = depth
>> z = temperature
>>
>> m = plt.contourf(x,y,z)
>> plt.gca().invert_yaxis()
>> plt.colorbar(m)
>> plt.show(m)
>>
>> the trouble now that the contours seems wrong... and my question still
>> stands. I'd like to do the plot as said: contours + series, can you show me
>> where I'm wrong ?
>>
>
> The plot looks right to me--I see 4 degrees in the lower RH corner, 300
> distance units and 700 depth units. Why do you say the contours seem
> wrong?
>
> As for plotting the "series", what do you mean? Put circles on the data
> points? Then include something like this, after the call to contourf:
>
> import numpy as np
> X, Y = np.meshgrid(x,y)
> plt.hold(True) # probably not necessary
> plt.plot(X,Y, 'o')
>
>
>
> Eric
>
>>
>> thanks, Oz
>>
>>
>> On Wed, Jul 16, 2008 at 9:37 PM, Eric Firing <ef...@ha... <mailto:
>> ef...@ha...>> wrote:
>>
>> Oz Nahum wrote:
>>
>> Ok, I played with it a little bit.
>>
>> Here is what I know:
>> importing the data is not a big issue, I aready wrote a tutorial
>> about it here:
>> http://www.tabula0rasa.org/?p=21
>>
>> here is a sample code I wrote.
>> from matplotlib import pyplot as plt
>> from pylab import *
>> temperature=[
>> [1,3,4],
>> [2,4,5],
>> [6,3,2]
>> ]
>>
>> distance = (100,200,300)
>> depth = (10,30,50)
>>
>> plt.colorbar()
>> plt.contourf(distance,depth,temperature)
>> plt.gca().invert_yaxis()
>> plt.show()
>>
>>
>>
>> Can I plot the dots as different series on top of the contours ?
>>
>>
>> First you have to make your basic example work; what you posted
>> above does not.
>> 1) For an example like this, use a different number of points in the
>> x and y directions, to make it clear how the arrays are oriented.
>> 2) The colorbar command must *follow* the contourf command.
>> 3) Make your test temperature profiles more reasonable, i.e.
>> temperature decreasing with depth, so you can see whether your plot
>> is doing the right thing.
>> 4) Omit the "from pylab import *"
>> 5) Once you start doing real work, you will need numpy. The
>> suggested import syntax is "import numpy as np".
>> 6) Study the examples that come with mpl.
>>
>> Eric
>>
>>
>>
>
|
|
From: Eric F. <ef...@ha...> - 2008-07-16 19:28:30
|
Oz Nahum wrote: > Hi Eric, > really thanks for your help so far. I am doing a quick short course, and > I'll do the examples later. > I've fixed the code, here it is: > > from matplotlib import pyplot as plt > temperature=[ > [10,8,6], > [9,7,5], > [8,7,4] > ] > > distance = (100,200,300) > depth = (100,300,700) > > x = distance > y = depth > z = temperature > > m = plt.contourf(x,y,z) > plt.gca().invert_yaxis() > plt.colorbar(m) > plt.show(m) > > the trouble now that the contours seems wrong... and my question still > stands. I'd like to do the plot as said: contours + series, can you show > me where I'm wrong ? The plot looks right to me--I see 4 degrees in the lower RH corner, 300 distance units and 700 depth units. Why do you say the contours seem wrong? As for plotting the "series", what do you mean? Put circles on the data points? Then include something like this, after the call to contourf: import numpy as np X, Y = np.meshgrid(x,y) plt.hold(True) # probably not necessary plt.plot(X,Y, 'o') Eric > > thanks, Oz > > On Wed, Jul 16, 2008 at 9:37 PM, Eric Firing <ef...@ha... > <mailto:ef...@ha...>> wrote: > > Oz Nahum wrote: > > Ok, I played with it a little bit. > > Here is what I know: > importing the data is not a big issue, I aready wrote a tutorial > about it here: > http://www.tabula0rasa.org/?p=21 > > here is a sample code I wrote. > from matplotlib import pyplot as plt > from pylab import * > temperature=[ > [1,3,4], > [2,4,5], > [6,3,2] > ] > > distance = (100,200,300) > depth = (10,30,50) > > plt.colorbar() > plt.contourf(distance,depth,temperature) > plt.gca().invert_yaxis() > plt.show() > > > > Can I plot the dots as different series on top of the contours ? > > > First you have to make your basic example work; what you posted > above does not. > 1) For an example like this, use a different number of points in the > x and y directions, to make it clear how the arrays are oriented. > 2) The colorbar command must *follow* the contourf command. > 3) Make your test temperature profiles more reasonable, i.e. > temperature decreasing with depth, so you can see whether your plot > is doing the right thing. > 4) Omit the "from pylab import *" > 5) Once you start doing real work, you will need numpy. The > suggested import syntax is "import numpy as np". > 6) Study the examples that come with mpl. > > Eric > > |
|
From: Oz N. <na...@gm...> - 2008-07-16 18:47:48
|
Hi Eric,
really thanks for your help so far. I am doing a quick short course, and
I'll do the examples later.
I've fixed the code, here it is:
from matplotlib import pyplot as plt
temperature=[
[10,8,6],
[9,7,5],
[8,7,4]
]
distance = (100,200,300)
depth = (100,300,700)
x = distance
y = depth
z = temperature
m = plt.contourf(x,y,z)
plt.gca().invert_yaxis()
plt.colorbar(m)
plt.show(m)
the trouble now that the contours seems wrong... and my question still
stands. I'd like to do the plot as said: contours + series, can you show me
where I'm wrong ?
thanks, Oz
On Wed, Jul 16, 2008 at 9:37 PM, Eric Firing <ef...@ha...> wrote:
> Oz Nahum wrote:
>
>> Ok, I played with it a little bit.
>>
>> Here is what I know:
>> importing the data is not a big issue, I aready wrote a tutorial about it
>> here:
>> http://www.tabula0rasa.org/?p=21
>>
>> here is a sample code I wrote.
>> from matplotlib import pyplot as plt
>> from pylab import *
>> temperature=[
>> [1,3,4],
>> [2,4,5],
>> [6,3,2]
>> ]
>>
>> distance = (100,200,300)
>> depth = (10,30,50)
>>
>> plt.colorbar()
>> plt.contourf(distance,depth,temperature)
>> plt.gca().invert_yaxis()
>> plt.show()
>>
>>
>>
>> Can I plot the dots as different series on top of the contours ?
>>
>
> First you have to make your basic example work; what you posted above does
> not.
> 1) For an example like this, use a different number of points in the x and
> y directions, to make it clear how the arrays are oriented.
> 2) The colorbar command must *follow* the contourf command.
> 3) Make your test temperature profiles more reasonable, i.e. temperature
> decreasing with depth, so you can see whether your plot is doing the right
> thing.
> 4) Omit the "from pylab import *"
> 5) Once you start doing real work, you will need numpy. The suggested
> import syntax is "import numpy as np".
> 6) Study the examples that come with mpl.
>
> Eric
>
|
|
From: Eric F. <ef...@ha...> - 2008-07-16 18:38:15
|
Oz Nahum wrote: > Ok, I played with it a little bit. > > Here is what I know: > importing the data is not a big issue, I aready wrote a tutorial about > it here: > http://www.tabula0rasa.org/?p=21 > > here is a sample code I wrote. > from matplotlib import pyplot as plt > from pylab import * > temperature=[ > [1,3,4], > [2,4,5], > [6,3,2] > ] > > distance = (100,200,300) > depth = (10,30,50) > > plt.colorbar() > plt.contourf(distance,depth,temperature) > plt.gca().invert_yaxis() > plt.show() > > > > Can I plot the dots as different series on top of the contours ? First you have to make your basic example work; what you posted above does not. 1) For an example like this, use a different number of points in the x and y directions, to make it clear how the arrays are oriented. 2) The colorbar command must *follow* the contourf command. 3) Make your test temperature profiles more reasonable, i.e. temperature decreasing with depth, so you can see whether your plot is doing the right thing. 4) Omit the "from pylab import *" 5) Once you start doing real work, you will need numpy. The suggested import syntax is "import numpy as np". 6) Study the examples that come with mpl. Eric |
|
From: John H. <jd...@gm...> - 2008-07-16 18:29:26
|
On Wed, Jul 16, 2008 at 1:25 PM, Oz Nahum <na...@gm...> wrote: > Ok, I played with it a little bit. > > Here is what I know: > importing the data is not a big issue, I aready wrote a tutorial about it > here: > http://www.tabula0rasa.org/?p=21 There are a couple of functions for loading ASCII data so you probably don't need to role your own unless you have specialized needs. See numpy.loadtxt and matplotlib.mlab.csv2rec (example at http://matplotlib.sf.net/examples/pylab_examples/loadrec.py JDH |
|
From: Oz N. <na...@gm...> - 2008-07-16 18:25:09
|
Ok, I played with it a little bit. Here is what I know: importing the data is not a big issue, I aready wrote a tutorial about it here: http://www.tabula0rasa.org/?p=21 here is a sample code I wrote. from matplotlib import pyplot as plt from pylab import * temperature=[ [1,3,4], [2,4,5], [6,3,2] ] distance = (100,200,300) depth = (10,30,50) plt.colorbar() plt.contourf(distance,depth,temperature) plt.gca().invert_yaxis() plt.show() Can I plot the dots as different series on top of the contours ? many many 10x. Oz On Wed, Jul 16, 2008 at 8:58 PM, Eric Firing <ef...@ha...> wrote: > Oz Nahum wrote: > >> Thanks for the quick answer. >> So if I have a series of 18 points withe measured distance, and 18 data >> points with distance, it makes it almost impossible to build the graph ??? I >> can't type 18^18 points.... I want the computer to plot the points and >> extrapulate between them... >> > > I'm puzzled. You said you knew how to read in your data from files, so > there should be no question of having to type too many numbers. > > Eric > >> >> excuse me the possibly dumb question, I am new to sceintific programming >> and for matplotlib >> >> Oz >> >> On Wed, Jul 16, 2008 at 7:51 PM, Eric Firing <ef...@ha... <mailto: >> ef...@ha...>> wrote: >> >> Oz Nahum wrote: >> >> Hi, >> I want to draw a contour plot which uses data from files. I know >> how to import the files, so it's not the main issue. >> Let's say I want to do a profile which has the following data: >> distance, depth and some oceanographic data like temp, oxygen >> and stuff.... >> >> so for simplicity lets say I have: >> >> distance = [1,2,3,4,5,6,7,8,9] >> depth = [1,2,3,4,5,6,7,8,9] >> >> temp = [26.5, 26.2, 26.2, 26.0,25, 24, 22, 21, 18] >> >> >> Too simple. If your grid has 9 points in distance and 9 in depth, >> then you need 81 values of temperature (9 profiles of 9 depths each). >> >> Suppose you have 10 profiles of 8 points each. Then your >> temperature array should have shape (8,10). Your distance and depth >> arrays can either have the same shape as temperature, or both can be >> 1-D, in which case distance.shape = (10,) and depth.shape = (8,). >> Either way, you then use (assuming a current release of mpl) >> >> from matplotlib import pyplot as plt >> plt.contour(distance, depth, temperature) >> plt.gca().invert_yaxis() # so depth increases down the y-axis >> plt.show() >> >> Note that the shape of your temperature array is the transpose of >> what one might expect. This is for matlab compatibility, and goes >> with the idea of looking at an array as it is printed, with the >> column dimension (second index) increasing across the page. >> >> See the contour_demo.py and contourf_demo.py in the mpl examples. >> >> Eric >> >> >> >> how do I produce a countour plot were distanc is X, Y is depth >> and the contours are for temp ? >> >> many thanks... >> Oz >> >> >> >> ------------------------------------------------------------------------ >> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's >> challenge >> Build the coolest Linux based applications with Moblin SDK & win great >> prizes >> Grand prize is a trip for two to an Open Source event anywhere in the >> world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > > |
|
From: Eric F. <ef...@ha...> - 2008-07-16 17:58:49
|
Oz Nahum wrote: > Thanks for the quick answer. > So if I have a series of 18 points withe measured distance, and 18 data > points with distance, it makes it almost impossible to build the graph > ??? I can't type 18^18 points.... I want the computer to plot the points > and extrapulate between them... I'm puzzled. You said you knew how to read in your data from files, so there should be no question of having to type too many numbers. Eric > > excuse me the possibly dumb question, I am new to sceintific programming > and for matplotlib > > Oz > > > On Wed, Jul 16, 2008 at 7:51 PM, Eric Firing <ef...@ha... > <mailto:ef...@ha...>> wrote: > > Oz Nahum wrote: > > Hi, > I want to draw a contour plot which uses data from files. I know > how to import the files, so it's not the main issue. > Let's say I want to do a profile which has the following data: > distance, depth and some oceanographic data like temp, oxygen > and stuff.... > > so for simplicity lets say I have: > > distance = [1,2,3,4,5,6,7,8,9] > depth = [1,2,3,4,5,6,7,8,9] > > temp = [26.5, 26.2, 26.2, 26.0,25, 24, 22, 21, 18] > > > Too simple. If your grid has 9 points in distance and 9 in depth, > then you need 81 values of temperature (9 profiles of 9 depths each). > > Suppose you have 10 profiles of 8 points each. Then your > temperature array should have shape (8,10). Your distance and depth > arrays can either have the same shape as temperature, or both can be > 1-D, in which case distance.shape = (10,) and depth.shape = (8,). > Either way, you then use (assuming a current release of mpl) > > from matplotlib import pyplot as plt > plt.contour(distance, depth, temperature) > plt.gca().invert_yaxis() # so depth increases down the y-axis > plt.show() > > Note that the shape of your temperature array is the transpose of > what one might expect. This is for matlab compatibility, and goes > with the idea of looking at an array as it is printed, with the > column dimension (second index) increasing across the page. > > See the contour_demo.py and contourf_demo.py in the mpl examples. > > Eric > > > > how do I produce a countour plot were distanc is X, Y is depth > and the contours are for temp ? > > many thanks... > Oz > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > > > ------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: Michael D. <md...@st...> - 2008-07-16 17:23:20
|
Alex Stapleton wrote: > 2008/7/16 Jeff Whitaker <js...@fa...>: > >> Alex Stapleton wrote: >> >> Alex: I don't have the Cairo backend installed, but I bet it would work if >> you changed resolution='i' to resolution='l'. Seems like a pretty severe >> limitation of the backend though. >> > I suppose it's not up to matplotlib to work around silly limits in > Cairo :) Slightly OT -- I put the check for the length of the path in there because otherwise pycairo/cairo segfaults, and I thought an exception would be preferable to a segfault. That limit was obtained through experimentation, and might not be accurate (I couldn't actually find a hard limit in the cairo code, it's more likely due to an interaction of multiple parts of the code). This was all true with Cairo 1.4.10/pycairo 1.4.0. With other versions this may not be the case, but my "catch" happens regardless. We may want to revisit that if we discover that newer versions of Cairo can handle longer paths. Cheers, Mike -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA |
|
From: Oz N. <na...@gm...> - 2008-07-16 17:11:02
|
Thanks for the quick answer. So if I have a series of 18 points withe measured distance, and 18 data points with distance, it makes it almost impossible to build the graph ??? I can't type 18^18 points.... I want the computer to plot the points and extrapulate between them... excuse me the possibly dumb question, I am new to sceintific programming and for matplotlib Oz On Wed, Jul 16, 2008 at 7:51 PM, Eric Firing <ef...@ha...> wrote: > Oz Nahum wrote: > >> Hi, >> I want to draw a contour plot which uses data from files. I know how to >> import the files, so it's not the main issue. >> Let's say I want to do a profile which has the following data: >> distance, depth and some oceanographic data like temp, oxygen and >> stuff.... >> >> so for simplicity lets say I have: >> >> distance = [1,2,3,4,5,6,7,8,9] >> depth = [1,2,3,4,5,6,7,8,9] >> >> temp = [26.5, 26.2, 26.2, 26.0,25, 24, 22, 21, 18] >> > > Too simple. If your grid has 9 points in distance and 9 in depth, then you > need 81 values of temperature (9 profiles of 9 depths each). > > Suppose you have 10 profiles of 8 points each. Then your temperature array > should have shape (8,10). Your distance and depth arrays can either have > the same shape as temperature, or both can be 1-D, in which case > distance.shape = (10,) and depth.shape = (8,). Either way, you then use > (assuming a current release of mpl) > > from matplotlib import pyplot as plt > plt.contour(distance, depth, temperature) > plt.gca().invert_yaxis() # so depth increases down the y-axis > plt.show() > > Note that the shape of your temperature array is the transpose of what one > might expect. This is for matlab compatibility, and goes with the idea of > looking at an array as it is printed, with the column dimension (second > index) increasing across the page. > > See the contour_demo.py and contourf_demo.py in the mpl examples. > > Eric > > > >> how do I produce a countour plot were distanc is X, Y is depth and the >> contours are for temp ? >> >> many thanks... >> Oz >> > |
|
From: Eric F. <ef...@ha...> - 2008-07-16 16:51:58
|
Oz Nahum wrote: > Hi, > I want to draw a contour plot which uses data from files. I know how to > import the files, so it's not the main issue. > Let's say I want to do a profile which has the following data: > distance, depth and some oceanographic data like temp, oxygen and stuff.... > > so for simplicity lets say I have: > > distance = [1,2,3,4,5,6,7,8,9] > depth = [1,2,3,4,5,6,7,8,9] > > temp = [26.5, 26.2, 26.2, 26.0,25, 24, 22, 21, 18] Too simple. If your grid has 9 points in distance and 9 in depth, then you need 81 values of temperature (9 profiles of 9 depths each). Suppose you have 10 profiles of 8 points each. Then your temperature array should have shape (8,10). Your distance and depth arrays can either have the same shape as temperature, or both can be 1-D, in which case distance.shape = (10,) and depth.shape = (8,). Either way, you then use (assuming a current release of mpl) from matplotlib import pyplot as plt plt.contour(distance, depth, temperature) plt.gca().invert_yaxis() # so depth increases down the y-axis plt.show() Note that the shape of your temperature array is the transpose of what one might expect. This is for matlab compatibility, and goes with the idea of looking at an array as it is printed, with the column dimension (second index) increasing across the page. See the contour_demo.py and contourf_demo.py in the mpl examples. Eric > > how do I produce a countour plot were distanc is X, Y is depth and the > contours are for temp ? > > many thanks... > Oz |
|
From: Oz N. <na...@gm...> - 2008-07-16 16:33:39
|
Hi, I want to draw a contour plot which uses data from files. I know how to import the files, so it's not the main issue. Let's say I want to do a profile which has the following data: distance, depth and some oceanographic data like temp, oxygen and stuff.... so for simplicity lets say I have: distance = [1,2,3,4,5,6,7,8,9] depth = [1,2,3,4,5,6,7,8,9] temp = [26.5, 26.2, 26.2, 26.0,25, 24, 22, 21, 18] how do I produce a countour plot were distanc is X, Y is depth and the contours are for temp ? many thanks... Oz |