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
(11) |
|
2
(24) |
3
(24) |
4
(31) |
5
(30) |
6
(27) |
7
(25) |
8
(8) |
|
9
(2) |
10
(12) |
11
(16) |
12
(33) |
13
(18) |
14
(17) |
15
(3) |
|
16
(7) |
17
(8) |
18
(22) |
19
(20) |
20
(25) |
21
(10) |
22
(17) |
|
23
(18) |
24
(23) |
25
(15) |
26
(19) |
27
(6) |
28
(7) |
29
(6) |
|
30
(1) |
31
(12) |
|
|
|
|
|
|
From: Thomas R. <tho...@gm...> - 2009-08-24 20:15:03
|
> I think the easiest solution is to override the Axes.format_coord. > For example, > > ax = gca() > ax.format_coord = lambda x,y : "x=%g y=%g" % (x, y) > > x,y are in data coordinate. I'm not sure if there is any side effect, > but it seems that the format_coord method is only used to display the > coordinate in the toolbar. This is exactly what I needed - thanks! Tom |
|
From: M. H. <mhe...@in...> - 2009-08-24 20:13:00
|
Thank you, this was exacly what I was looking for. No I try to understand this ;-) -- View this message in context: http://www.nabble.com/Three-Phase-Diagrams-with-matplotlib-tp25122001p25123043.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Chloe L. <ch...@na...> - 2009-08-24 19:40:06
|
If your percents always sum to 100, you can use a subclass of Figure I made up for soil science; pictures at http://nature.berkeley.edu/~chlewis/Projects/Entries/2009/6/25_A_function_to_plot_information_on_the_soil_texture_triangle.html (non-soil example at end) and code at http://nature.berkeley.edu/~chlewis/Sourcecode.html &C On Aug 24, 2009, at 12:23 PM, M. Hecht wrote: > > Hello, > > does anyone know whether it is possible to draw three-phase-diagrams > with > matplotlib? > > A three-phase-diagram is a triangular diagram applied in chemistry > e.g. for > slags where > one has three main components of a chemical substance at the corners > and > points or lines > within the triangle marking different compositions of the substances > in > percent, e.g. > in metallurgy 20% Al2O3, 45% CaO and 35% SiO2. > > -- > View this message in context: http://www.nabble.com/Three-Phase-Diagrams-with-matplotlib-tp25122001p25122001.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 > 30-Day > trial. Simplify your report design, integration and deployment - and > focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users Chloe Lewis Graduate student, Amundson Lab Division of Ecosystem Sciences, ESPM University of California, Berkeley 137 Mulford Hall - #3114 Berkeley, CA 94720-3114 ch...@na... |
|
From: Jae-Joon L. <lee...@gm...> - 2009-08-24 19:27:43
|
On Mon, Aug 24, 2009 at 1:48 PM, Xavier Gnata<xav...@gm...> wrote: > Hi, > > I have already asked about that but I'm back once again :) > > The way I use matplotlib may be a corner case: > I'm often looking at large (4k x 4k) images and I do want to see the > pixels values moving the mouse over the display. > imshow does a great job but all the backend only display "x= y=". > I would love to see "x= y= Z=" (or "value="...call it the way you want ;)) > > What is the best way to do that? > imshow is great because there is nothing to connect to see x and y > values on the backend. > I need to code something as simple as imshow to get also the pixel values. The easiest way I can think of is to override Axes.format_coord method. A pseudo code might look like below def report_pixel(x, y): # get the pixel value v = get_pixel_value_of_your_image(x,y) return "x=%f y=%f value=%f" % (x, y, v) ax = gca() ax.format_coord = report_pixel The code will become more complicated if you want to support multiple images. This solution is far from elegant, but maybe the easiest one. -JJ > > Is there really on way to get that as a new option in imshow? at least > in one of the backend (as a starting point) > > Best Regards, > Xavier > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: M. H. <mhe...@in...> - 2009-08-24 19:24:15
|
Hello, does anyone know whether it is possible to draw three-phase-diagrams with matplotlib? A three-phase-diagram is a triangular diagram applied in chemistry e.g. for slags where one has three main components of a chemical substance at the corners and points or lines within the triangle marking different compositions of the substances in percent, e.g. in metallurgy 20% Al2O3, 45% CaO and 35% SiO2. -- View this message in context: http://www.nabble.com/Three-Phase-Diagrams-with-matplotlib-tp25122001p25122001.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Jae-Joon L. <lee...@gm...> - 2009-08-24 19:09:47
|
On Mon, Aug 24, 2009 at 1:14 PM, Thomas Robitaille<tho...@gm...> wrote: > > Hi, > > I'm interested in controlling how the cursor position appears at the bottom > of interactive windows. > > I noticed that by default, it is the Formatter that gets called. However, in > my case, the displayed coordinates each depend on both the x and y pixel > value, and therefore I need to somehow override the Formatter. > I doubt if overriding formatter works. Formatter basically does not know about the other coordinate. I think the easiest solution is to override the Axes.format_coord. For example, ax = gca() ax.format_coord = lambda x,y : "x=%g y=%g" % (x, y) x,y are in data coordinate. I'm not sure if there is any side effect, but it seems that the format_coord method is only used to display the coordinate in the toolbar. > Does anyone have any suggestions? Should I use event handling with the > 'motion_notify_event' event? If so, how do I make sure that the formatter > doesn't still get called, and where is the string object that I should > update? Take a look at the NavigationToolbar2 class in backend_bases.py. If you go down this road, you may need to modify mouse_move method to prevent it displaying the coordinate. You may use set_message method to display the coordinate. But I personally think overriding format_coord method is good enough. Regards, -JJ > > Thanks, > > Thomas > -- > View this message in context: http://www.nabble.com/Cursor-position-tp25119919p25119919.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Jeff W. <js...@fa...> - 2009-08-24 19:04:30
|
Arto Oksanen wrote: > Thanks Jeff! > > That is just a perfect solution!! > > arto Arto: I've cleaned up that example and added it to svn as examples/daynight.py. -Jeff > > 2009/8/24 Jeff Whitaker <js...@fa... <mailto:js...@fa...>> > > Arto Oksanen wrote: > > Thanks for your prompt reply. I should have given a more > detailed explanation. I do know the solar position and then > the latitude and longitude of the point on globe where the Sun > is on the zenith. And as the sun illuminates always half of > the globe, I just need to draw a "dark half globe" over the > normal globe. Is this possible? That should be a lot simpler > than drawing continents etc. :-) > > arto > > > Arto: Here's something - is this what you're looking for? It > computes the day-night terminator, then shades one side of the > terminator gray on a map. > > -Jeff > > P.S. I've cc-ed the matplotlib users list in case anyone else has > ideas. > > > > > 2009/8/24 Jeff Whitaker <jef...@no... > <mailto:jef...@no...> > <mailto:jef...@no... > <mailto:jef...@no...>>> > > > Arto Oksanen wrote: > > Hello from Finland! > > I am writing an utility for quickly seeing where > astronomical > events (like a GRB) are visible on Earth. I have installed > Basemap and it generates very nice Earth views, but I > still need > to somehow display the day and night on the globe. Any > sample > code somewhere or some pointers how to do this? > > I am looking for something like this: > > http://www.fourmilab.ch/cgi-bin/Earth?imgsize=320&opt=-l&lat=57.1667&ns=North&lon=49.125&ew=West&alt=372461&img=learth.evif > <http://www.fourmilab.ch/cgi-bin/Earth?imgsize=320&opt=-l&lat=57.1667&ns=North&lon=49.125&ew=West&alt=372461&img=learth.evif> > > <http://www.fourmilab.ch/cgi-bin/Earth?imgsize=320&opt=-l&lat=57.1667&ns=North&lon=49.125&ew=West&alt=372461&img=learth.evif > <http://www.fourmilab.ch/cgi-bin/Earth?imgsize=320&opt=-l&lat=57.1667&ns=North&lon=49.125&ew=West&alt=372461&img=learth.evif>> > > <http://www.fourmilab.ch/cgi-bin/Earth?imgsize=320&opt=-l&lat=57.1667&ns=North&lon=49.125&ew=West&alt=372461&img=learth.evif > <http://www.fourmilab.ch/cgi-bin/Earth?imgsize=320&opt=-l&lat=57.1667&ns=North&lon=49.125&ew=West&alt=372461&img=learth.evif> > > <http://www.fourmilab.ch/cgi-bin/Earth?imgsize=320&opt=-l&lat=57.1667&ns=North&lon=49.125&ew=West&alt=372461&img=learth.evif > <http://www.fourmilab.ch/cgi-bin/Earth?imgsize=320&opt=-l&lat=57.1667&ns=North&lon=49.125&ew=West&alt=372461&img=learth.evif>>> > > TIA! > > arto > > -- Arto Oksanen > art...@jk... > <mailto:art...@jk...> > <mailto:art...@jk... > <mailto:art...@jk...>> > <mailto:art...@jk... > <mailto:art...@jk...> > <mailto:art...@jk... > <mailto:art...@jk...>>> > Muurame, Finland > > Arto: This might help: > > http://en.wikipedia.org/wiki/Sunrise_equation > > -Jeff > > > > > -- > Arto Oksanen > art...@jk... <mailto:art...@jk...> > <mailto:art...@jk... > <mailto:art...@jk...>> > Muurame, Finland > > > > -- > Jeffrey S. Whitaker Phone : (303)497-6313 > Meteorologist FAX : (303)497-6449 > NOAA/OAR/PSD R/PSD1 Email : Jef...@no... > <mailto:Jef...@no...> > 325 Broadway Office : Skaggs Research Cntr 1D-113 > Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg > > > > > -- > Arto Oksanen > art...@jk... <mailto:art...@jk...> > Muurame, Finland -- 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: Arto O. <art...@jk...> - 2009-08-24 18:09:35
|
Thanks Jeff! That is just a perfect solution!! arto 2009/8/24 Jeff Whitaker <js...@fa...> > Arto Oksanen wrote: > >> Thanks for your prompt reply. I should have given a more detailed >> explanation. I do know the solar position and then the latitude and >> longitude of the point on globe where the Sun is on the zenith. And as the >> sun illuminates always half of the globe, I just need to draw a "dark half >> globe" over the normal globe. Is this possible? That should be a lot simpler >> than drawing continents etc. :-) >> >> arto >> > > Arto: Here's something - is this what you're looking for? It computes > the day-night terminator, then shades one side of the terminator gray on a > map. > > -Jeff > > P.S. I've cc-ed the matplotlib users list in case anyone else has ideas. > >> >> >> >> 2009/8/24 Jeff Whitaker <jef...@no... <mailto: >> jef...@no...>> >> >> >> Arto Oksanen wrote: >> >> Hello from Finland! >> >> I am writing an utility for quickly seeing where astronomical >> events (like a GRB) are visible on Earth. I have installed >> Basemap and it generates very nice Earth views, but I still need >> to somehow display the day and night on the globe. Any sample >> code somewhere or some pointers how to do this? >> >> I am looking for something like this: >> >> http://www.fourmilab.ch/cgi-bin/Earth?imgsize=320&opt=-l&lat=57.1667&ns=North&lon=49.125&ew=West&alt=372461&img=learth.evif >> < >> http://www.fourmilab.ch/cgi-bin/Earth?imgsize=320&opt=-l&lat=57.1667&ns=North&lon=49.125&ew=West&alt=372461&img=learth.evif >> > >> < >> http://www.fourmilab.ch/cgi-bin/Earth?imgsize=320&opt=-l&lat=57.1667&ns=North&lon=49.125&ew=West&alt=372461&img=learth.evif >> < >> http://www.fourmilab.ch/cgi-bin/Earth?imgsize=320&opt=-l&lat=57.1667&ns=North&lon=49.125&ew=West&alt=372461&img=learth.evif >> >> >> >> TIA! >> >> arto >> >> -- Arto Oksanen >> art...@jk... <mailto:art...@jk...> >> <mailto:art...@jk... >> <mailto:art...@jk...>> >> Muurame, Finland >> >> Arto: This might help: >> >> http://en.wikipedia.org/wiki/Sunrise_equation >> >> -Jeff >> >> >> >> >> -- >> Arto Oksanen >> art...@jk... <mailto:art...@jk...> >> Muurame, Finland >> > > > -- > 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 > -- Arto Oksanen art...@jk... Muurame, Finland |
|
From: Xavier G. <xav...@gm...> - 2009-08-24 17:48:54
|
Hi, I have already asked about that but I'm back once again :) The way I use matplotlib may be a corner case: I'm often looking at large (4k x 4k) images and I do want to see the pixels values moving the mouse over the display. imshow does a great job but all the backend only display "x= y=". I would love to see "x= y= Z=" (or "value="...call it the way you want ;)) What is the best way to do that? imshow is great because there is nothing to connect to see x and y values on the backend. I need to code something as simple as imshow to get also the pixel values. Is there really on way to get that as a new option in imshow? at least in one of the backend (as a starting point) Best Regards, Xavier |
|
From: Thomas R. <tho...@gm...> - 2009-08-24 17:14:17
|
Hi, I'm interested in controlling how the cursor position appears at the bottom of interactive windows. I noticed that by default, it is the Formatter that gets called. However, in my case, the displayed coordinates each depend on both the x and y pixel value, and therefore I need to somehow override the Formatter. Does anyone have any suggestions? Should I use event handling with the 'motion_notify_event' event? If so, how do I make sure that the formatter doesn't still get called, and where is the string object that I should update? Thanks, Thomas -- View this message in context: http://www.nabble.com/Cursor-position-tp25119919p25119919.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Jeff W. <js...@fa...> - 2009-08-24 16:15:43
|
Arto Oksanen wrote: > Thanks for your prompt reply. I should have given a more detailed > explanation. I do know the solar position and then the latitude and > longitude of the point on globe where the Sun is on the zenith. And as > the sun illuminates always half of the globe, I just need to draw a > "dark half globe" over the normal globe. Is this possible? That should > be a lot simpler than drawing continents etc. :-) > > arto Arto: Here's something - is this what you're looking for? It computes the day-night terminator, then shades one side of the terminator gray on a map. -Jeff P.S. I've cc-ed the matplotlib users list in case anyone else has ideas. > > > > 2009/8/24 Jeff Whitaker <jef...@no... > <mailto:jef...@no...>> > > Arto Oksanen wrote: > > Hello from Finland! > > I am writing an utility for quickly seeing where astronomical > events (like a GRB) are visible on Earth. I have installed > Basemap and it generates very nice Earth views, but I still need > to somehow display the day and night on the globe. Any sample > code somewhere or some pointers how to do this? > > I am looking for something like this: > http://www.fourmilab.ch/cgi-bin/Earth?imgsize=320&opt=-l&lat=57.1667&ns=North&lon=49.125&ew=West&alt=372461&img=learth.evif > <http://www.fourmilab.ch/cgi-bin/Earth?imgsize=320&opt=-l&lat=57.1667&ns=North&lon=49.125&ew=West&alt=372461&img=learth.evif> > <http://www.fourmilab.ch/cgi-bin/Earth?imgsize=320&opt=-l&lat=57.1667&ns=North&lon=49.125&ew=West&alt=372461&img=learth.evif > <http://www.fourmilab.ch/cgi-bin/Earth?imgsize=320&opt=-l&lat=57.1667&ns=North&lon=49.125&ew=West&alt=372461&img=learth.evif>> > > TIA! > > arto > > -- > Arto Oksanen > art...@jk... <mailto:art...@jk...> > <mailto:art...@jk... > <mailto:art...@jk...>> > Muurame, Finland > > Arto: This might help: > > http://en.wikipedia.org/wiki/Sunrise_equation > > -Jeff > > > > > -- > Arto Oksanen > art...@jk... <mailto:art...@jk...> > Muurame, Finland -- 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: Ryan N. <ne...@em...> - 2009-08-24 16:06:34
|
Hello, I hope someone can give me a tip to get this working.
I have some data that I have manipulated in to the following format:
x_dim is a 1D array of sample times (in minutes)
array([ 0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300,
330, 360, 390, 420, 450, 480, 510, 540, 570, 600, 630,
660, 690, 720, 750, 780, 810, 840, 870, 900, 930, 960,
990, 1020, 1050, 1080, 1110, 1140, 1170, 1200, 1230, 1260, 1290,
1320, 1350, 1380, 1410])
x_dim is often, but not always regularly spaced and will in practice be much
much larger.
y_dim is a 1D array of sample depths
array([ 0., -10., -20., -30., -40., -50., -60., -70., -80.,
-90., -100., -110., -120., -130., -140., -150., -160., -170.,
-180., -190., -200., -210.])
y_dim is always regularly spaced and won't get much bigger than this
z_dim is a dictionary of 2D arrays of data values where:
z_dim['salin'][1,:] is an array of salinity data taken at the second
sampling (time 30) with one value for every depth in y_dim:
z_dim['salin'][1,:] =
array([ NaN, 10.14000034, 10.14333344, 10.1766669 ,
10.22333336, 10.26000023, NaN, 10.21000004,
10.21000004, 10.19999981, 10.15999985, 10.12800007,
10.10333347, 10.09666697, 10.07000001, 10.06333351,
10.05000019, 10.03666655, 10.01666705, 9.99333318,
9.97999954, NaN])
I put in the numpy.nan where I have no data.
I tried to run this through griddata to make sure the times are regular with
something like this:
import matplotlib, numpy
xi = arange(0,x_dim[-1] + 30,30)
zi = mlab.griddata(x_dim,y_dim,z_dim['salin'],xi,y_dim)
# but it complains that "inputs x,y,z must all be 1D arrays of the same
length"
# I can't find any example of griddata that use arrays rather than functions
for z.
# in my exampley_dim IS regular, so I should be able to skip on to plotting.
x_grid,y_grid = meshgrid(x_dim,y_dim)
z_grid = transpose(z_dim['salin'])
# x_grid, y_grid, and z_grid now have the same shape
# Now mask out all the NaNs
ma.fix_invalid(z_grid)
# I have previously figured out level_min and level_max for this dataset.
contour_levels = list(linspace(floor(level_min),ceil(level_max),10))
figure = pyplot.figure()
contour_plot = pyplot.contourf(x_grid,y_grid,z_grid,contour_levels)
cbar = pyplot.colorbar()
pyplot.show()
#and that doesn't look right at all.
Any tips are greatly appreciated.
|
|
From: Sameer R. <re...@gm...> - 2009-08-24 16:05:00
|
Thank you Lee. Thank you Chris and John, the problem is solved. Chris, we did the method 1) as this was easier for us. Sameer On Sun, Aug 23, 2009 at 5:53 PM, John Hunter <jd...@gm...> wrote: > On Sun, Aug 23, 2009 at 7:45 PM, Chris Barker<Chr...@no...> > wrote: > > > This is a Bezier spline -- it can not exactly form a piece of a circle > > (though it can get pretty close). You can probably find the math > > somewhere for how to approximate a circle, but... > > somewhere like ... matplotlib.path.unit_circle (thanks to Michael D) > > @classmethod > def unit_circle(cls): > """ > (staticmethod) Returns a :class:`Path` of the unit circle. > The circle is approximated using cubic Bezier curves. This > uses 8 splines around the circle using the approach presented > here: > > Lancaster, Don. `Approximating a Circle or an Ellipse Using Four > Bezier Cubic Splines <http://www.tinaja.com/glib/ellipse4.pdf>`_. > """ > if cls._unit_circle is None: > MAGIC = 0.2652031 > SQRTHALF = np.sqrt(0.5) > MAGIC45 = np.sqrt((MAGIC*MAGIC) / 2.0) > > vertices = np.array( > [[0.0, -1.0], > > [MAGIC, -1.0], > [SQRTHALF-MAGIC45, -SQRTHALF-MAGIC45], > [SQRTHALF, -SQRTHALF], > > [SQRTHALF+MAGIC45, -SQRTHALF+MAGIC45], > [1.0, -MAGIC], > [1.0, 0.0], > > [1.0, MAGIC], > [SQRTHALF+MAGIC45, SQRTHALF-MAGIC45], > [SQRTHALF, SQRTHALF], > > [SQRTHALF-MAGIC45, SQRTHALF+MAGIC45], > [MAGIC, 1.0], > [0.0, 1.0], > > [-MAGIC, 1.0], > [-SQRTHALF+MAGIC45, SQRTHALF+MAGIC45], > [-SQRTHALF, SQRTHALF], > > [-SQRTHALF-MAGIC45, SQRTHALF-MAGIC45], > [-1.0, MAGIC], > [-1.0, 0.0], > > [-1.0, -MAGIC], > [-SQRTHALF-MAGIC45, -SQRTHALF+MAGIC45], > [-SQRTHALF, -SQRTHALF], > > [-SQRTHALF+MAGIC45, -SQRTHALF-MAGIC45], > [-MAGIC, -1.0], > [0.0, -1.0], > > [0.0, -1.0]], > np.float_) > > codes = cls.CURVE4 * np.ones(26) > codes[0] = cls.MOVETO > codes[-1] = cls.CLOSEPOLY > > cls._unit_circle = cls(vertices, codes) > return cls._unit_circle > |
|
From: Peter-Jan R. <pjr...@su...> - 2009-08-24 16:02:28
|
Dear All,
I came across this peculiar bug when using patches together with savefig.
I first want to display the contour plot of the vector potentials in a
electrical machine, and the the contour plot of the flux density.
If I first define the patches (for the yoke and the magnets) and then
the first contour plot (for the vector potentials) and then, using the
same patch definitions, the second contour plot (for the flux density)
...
#Patch definitions
inner_yoke=Wedge(...)
outer_yoke=Wedge(...)
inner_N_magnet=Wedge(...)
outer_S_magnet=Wedge(...)
inner_S_magnet=Wedge(...)
outer_N_magnet=Wedge(...)
plt.figure(1)
CS=plt.contour(x,y,Az,40)
ax=plt.gca()
ax.add_patch(inner_yoke)
ax.add_patch(outer_yoke)
ax.add_patch(inner_N_magnet)
ax.add_patch(outer_S_magnet)
ax.add_patch(inner_S_magnet)
ax.add_patch(outer_N_magnet)
plt.savefig('Az-savefig.png')
plt.figure(2)
CS=plt.contour(x,y,Bmag,50)
CS=plt.contourf(x,y,Bmag,50)
ax=plt.gca()
ax.add_patch(inner_yoke)
ax.add_patch(outer_yoke)
ax.add_patch(inner_N_magnet)
ax.add_patch(outer_S_magnet)
ax.add_patch(inner_S_magnet)
ax.add_patch(outer_N_magnet)
plt.savefig('Bmag-savefig.png')
plt.show()
the two figures are displayed correctly on the screen, see
http://staff.ee.sun.ac.za/pjrandewijk/matplotlib/Az-snapshot.png and
http://staff.ee.sun.ac.za/pjrandewijk/matplotlib/Bmag-snapshot.png
However, if I look at the saved PNG files
http://staff.ee.sun.ac.za/pjrandewijk/matplotlib/Az-savefig.png and
http://staff.ee.sun.ac.za/pjrandewijk/matplotlib/Bmag-savefig.png the
patches on Bmag-savefig.png are all wrong. It looks as if the Patches
are on a totally different scale??
A workaround is to copy the Patch definitions before plt.figure(1) and
paste it just before plt.figure(2) but which is not a very elegant
solution as one has to define the exact same patches twice, i.e.
...
#Patch definitions - Take I
inner_yoke=Wedge(...)
outer_yoke=Wedge(...)
inner_N_magnet=Wedge(...)
outer_S_magnet=Wedge(...)
inner_S_magnet=Wedge(...)
outer_N_magnet=Wedge(...)
plt.figure(1)
CS=plt.contour(x,y,Az,40)
ax=plt.gca()
ax.add_patch(inner_yoke)
ax.add_patch(outer_yoke)
ax.add_patch(inner_N_magnet)
ax.add_patch(outer_S_magnet)
ax.add_patch(inner_S_magnet)
ax.add_patch(outer_N_magnet)
plt.savefig('Az-savefig.png')
#Exactly the same Patch definitions - Take II
inner_yoke=Wedge(...)
outer_yoke=Wedge(...)
inner_N_magnet=Wedge(...)
outer_S_magnet=Wedge(...)
inner_S_magnet=Wedge(...)
outer_N_magnet=Wedge(...)
plt.figure(2)
CS=plt.contour(x,y,Bmag,50)
CS=plt.contourf(x,y,Bmag,50)
ax=plt.gca()
ax.add_patch(inner_yoke)
ax.add_patch(outer_yoke)
ax.add_patch(inner_N_magnet)
ax.add_patch(outer_S_magnet)
ax.add_patch(inner_S_magnet)
ax.add_patch(outer_N_magnet)
plt.savefig('Bmag-savefig.png')
plt.show()
Kind regards,
Peter-Jan
|
|
From: Jae-Joon L. <lee...@gm...> - 2009-08-24 15:50:37
|
I think you can just copy the axes_grid.inset_locator.py file and use it after deleting a few lines of code that gives some ImportError. However, here is a some related post. http://www.nabble.com/embedding-figures-inside-another-%28coordinates%29-td22826126.html#a22832238 Just replace the bbox coordinate of the inset axes, eg., ip = InsetPosition(ax, [1.1, 0., 0.1, 0.5]) Note that the coordinate is the normalized axes coordinate of the parent axes. *axes_locator* takes a callable object which takes arguments of the axes itself and the renderer, and subsequently returns the bbox object. Once set, the axes_locator is called at the drawing time and adjust the axes position to the returned bbox. -JJ On Sun, Aug 23, 2009 at 10:42 AM, Patrick Marsh<pat...@gm...> wrote: > Hi JJ, > > I'm not sure I understand how to properly set the axe_locator. Below > is my snippet of code that I use to create my contourf plot and then > create the colorbar. I'm unsure how I would modify it to do as you > suggested. Any help would be appreciated. > > plot = ax.contourf(xc, yc, data, cmap=cmap, levels=clevels) > cax = plt.axes([0.85, 0.125, 0.035, 0.325]) > cbar = fig.colorbar(plot, format='%.1f', cax=cax) > > I should also point out that the reason I'm not using the axes_grid > toolkit is because I'm constrained to develop based on the current > Enthought release. > > Patrick > --- > Patrick Marsh > Graduate Research Assistant > School of Meteorology > University of Oklahoma > http://www.patricktmarsh.com > > > > > On Sat, Aug 22, 2009 at 10:37 PM, Jae-Joon Lee<lee...@gm...> wrote: >> What you need is to adjust the axes position of the colorbar at the >> drawing time (because the axes position of the contour plot is >> adjusted only during the drawing time). >> You may do this by properly setting the axe_locator property of the axes. >> >> If you're using mpl 0.99, axes_grid toolkit may be helpful. >> I just posted a simple example with the screenshot in the link below. >> >> http://abitofpythonabitofastronomy.blogspot.com/2009/08/creating-color-bar-using-inset-axes.html >> >> Regards, >> >> -JJ >> >> >> >> On Sat, Aug 22, 2009 at 9:51 PM, Patrick Marsh<pat...@gm...> wrote: >>> Greeting MPL world, >>> >>> I have a contourf plot where the aspect ratio is 1. I need to add a >>> colorbar to the plot in a manner that keeps the colorbar in the same >>> place relative to the contourf plot (good.png), even if the parent >>> window is resized. I can do this with text, but haven't been able to >>> figure out how to do it with a colorbar. To the best of my knowledge, >>> there are two ways forward. >>> >>> 1.) I can create an entirely new axis instance (cax) but will need to >>> find a way to define the axes in a relative way to the original ax >>> instance. As it stands now, I can only define axes in terms of the >>> total figure size. As a result, the figure looks like it does in >>> bad.png >>> >>> >>> 2.) I can use the original ax instance, but need to find a way to >>> have more control over the colorbar placement. For example, it needs >>> to "sit" on the x-axis and not be centered in the middle of the yaxis. >>> Using shrink and aspect, I can get the plot size to be correct, >>> however it's position is centered on the yaxis as in bad2.png >>> >>> Is there a way to accomplish what I'm needing to do and I'm just missing it? >>> >>> Thanks in advance, >>> Patrick >>> --- >>> Patrick MarshC >>> Graduate Research Assistant >>> School of Meteorology >>> University of OklahomaC >>> http://www.patricktmarsh.com >>> >>> ------------------------------------------------------------------------------ >>> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day >>> trial. Simplify your report design, integration and deployment - and focus on >>> what you do best, core application coding. Discover what's new with >>> Crystal Reports now. http://p.sf.net/sfu/bobj-july >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> >>> >> > |
|
From: Romi A. <po...@ro...> - 2009-08-24 15:26:47
|
Hi!
After installing matplotlib 0.99.0 (over 0.98.6) I started to get the
following exceptions while checking hitlist:
Traceback (most recent call last):
File "C:\Python26\Lib\site-packages\matplotlib\artist.py", line 231,
in hitlist
hascursor,info = self.contains(event)
File "C:\Python26\Lib\site-packages\matplotlib\lines.py", line 286, in
contains
path, affine = self._transformed_path.get_transformed_path_and_affine()
AttributeError: 'NoneType' object has no attribute
'get_transformed_path_and_affine'
while checking <class 'matplotlib.lines.Line2D'>
...(several times the same exception for one mouse event)
The exception is produced with 'motion_notify_event' when trying to get
the hitlist.
How could I solve this problem?
Thanks
Romi
|
|
From: Ravi A. <rav...@gm...> - 2009-08-24 12:56:47
|
Hi, I am new to matplotlib. I am using boxplot and i wanted to mark current value or any special value on the box plot. How do i achieve this? Something like below. Thanks in advance, --- [---X------]----- --------------[---------]-------X--- -- View this message in context: http://www.nabble.com/showing-current-value-on-boxplot-tp25115648p25115648.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Reinier H. <re...@he...> - 2009-08-24 08:17:37
|
Hi Scripper,
I'm not sure what you would like to know, but it is possible to change
the tick settings on the 3D axes in the same way as for normal 2D
axes. For example:
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
from matplotlib.ticker import LinearLocator, FixedLocator, FormatStrFormatter
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
ax = Axes3D(fig)
X = np.arange(-5, 5, 0.25)
Y = np.arange(-5, 5, 0.25)
X, Y = np.meshgrid(X, Y)
R = np.sqrt(X**2 + Y**2)
Z = np.sin(R)
ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.jet)
ax.set_zlim3d(-1.01, 1.01)
ax.w_zaxis.set_major_locator(LinearLocator(10))
ax.w_zaxis.set_major_formatter(FormatStrFormatter('%.03f'))
plt.show()
Hope this helps,
Reinier
On Tue, Aug 18, 2009 at 7:16 PM, scripper<Scr...@gm...> wrote:
>
> Hi everybody,
> i am a newbie on Matplotlib and wanna know whether there is already tick
> setting on x,y,z axes in 3D plot. By now i just know on 2-dimension which
> listed on the gallery.
> Thanks very much!
> --
> View this message in context: http://www.nabble.com/plot3d-ticker-setting-tp25029488p25029488.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
--
Reinier Heeres
Tel: +31 6 10852639
|
|
From: Reinier H. <re...@he...> - 2009-08-24 07:37:05
|
Hi German, Although I haven't tried it, it should certainly work. Please look at the examples which embed QT4: http://matplotlib.sourceforge.net/examples/animation/animation_blit_qt4.html and http://matplotlib.sourceforge.net/examples/user_interfaces/embedding_in_qt4.html. All you'll need to do is replace the add_subplot() call with something like ax = Axes3D(fig). Then you can combine the QT4 example with the mplot3d examples, e.g. http://matplotlib.sourceforge.net/examples/mplot3d/surface3d_demo.html Cheers, Reinier On Sun, Aug 23, 2009 at 11:16 AM, German Ocampo<ger...@gm...> wrote: > Good morning > I'm working in a project in QT4 and I need to create a 3D graph embedded in > a Widget form. Is it possible to do it? and where I could get an example? > > Thanks > German > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus > on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- Reinier Heeres Tel: +31 6 10852639 |
|
From: Phil R. <ver...@gm...> - 2009-08-24 04:04:32
|
When you have a problem like this with one install looking one place
and another install looking in another place making a symbolic link is
usually easier and more likely to catch everything than making a copy.
In your case you could have said:
ln -s /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages
/Library/Python/2.5/site-packages
I'm glad you quickly found the root cause.
Phil
On Sat, Aug 22, 2009 at 6:36 PM, per freem<per...@gm...> wrote:
> i figured out what i did wrong and so am writing it here in case it
> helps others.
>
> the basic issue is that the .ttf font was missing in the new
> matplotlib directory. to discover this, i ran python with
> --verbose-debug as suggested in previous threads by others. then i
> copied my version of Helvetica.ttf into:
>
> /Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts
>
> and
>
> /Library/Python/2.5/site-packages/matplotlib/mpl-data/fonts/ttf
>
> then everything worked and i was able to change fonts to helvetica.
>
> thanks.
>
> On Sat, Aug 22, 2009 at 7:12 PM, per freem<per...@gm...> wrote:
>> Hi all,
>>
>> the following code used to work for me in matplotlib-0.98 to make a
>> simple scatter plot and change the font from the default font to
>> Helvetica (I am using mac os x).
>>
>> import matplotlib
>> matplotlib.use('PDF')
>> import matplotlib.pyplot as plt
>> from matplotlib import rc
>> rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
>> from scipy import *
>> from numpy import *
>>
>> my_fig = plt.figure(figsize=(6,5), dpi=100)
>> x = rand(100)*300
>> y = rand(100)
>> plt.scatter(x, y)
>> plt.rcParams['xtick.direction'] = 'out'
>> plt.rcParams['ytick.direction'] = 'out'
>> c = 0.05*300.5
>> plt.xlim([0-c, 300+c])
>> plt.ylim([-0.05, 1.05])
>> plt.savefig('x.pdf')
>>
>> i recently upgraded to matplotlib-0.99 and the changing of the font
>> using the above method no longer works. the figure is plotted the
>> same, but the font remains the default matplotlib font.
>>
>> one potential problem in the installation was this: i installed
>> matplotlib-0.99 using the dmg prepackaged binary installer. this
>> installed matplotlib in the directory:
>>
>> /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages
>>
>> however, for some reason ipython / python2.5 was looking for packages in:
>>
>> /Library/Python/2.5/site-packages
>>
>> and so matplotlib/mpl_toolkits was not found. so I copied the
>> directories 'matplotlib' and 'mpl_toolkits' from
>> /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages
>> to /Library/Python/2.5/site-packages. Perhaps this was the cause of
>> the problem?
>>
>> thanks for your help.
>>
>> (i run my code via ipython, by the way.)
>>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
|
|
From: John H. <jd...@gm...> - 2009-08-24 00:54:01
|
On Sun, Aug 23, 2009 at 7:45 PM, Chris Barker<Chr...@no...> wrote:
> This is a Bezier spline -- it can not exactly form a piece of a circle
> (though it can get pretty close). You can probably find the math
> somewhere for how to approximate a circle, but...
somewhere like ... matplotlib.path.unit_circle (thanks to Michael D)
@classmethod
def unit_circle(cls):
"""
(staticmethod) Returns a :class:`Path` of the unit circle.
The circle is approximated using cubic Bezier curves. This
uses 8 splines around the circle using the approach presented
here:
Lancaster, Don. `Approximating a Circle or an Ellipse Using Four
Bezier Cubic Splines <http://www.tinaja.com/glib/ellipse4.pdf>`_.
"""
if cls._unit_circle is None:
MAGIC = 0.2652031
SQRTHALF = np.sqrt(0.5)
MAGIC45 = np.sqrt((MAGIC*MAGIC) / 2.0)
vertices = np.array(
[[0.0, -1.0],
[MAGIC, -1.0],
[SQRTHALF-MAGIC45, -SQRTHALF-MAGIC45],
[SQRTHALF, -SQRTHALF],
[SQRTHALF+MAGIC45, -SQRTHALF+MAGIC45],
[1.0, -MAGIC],
[1.0, 0.0],
[1.0, MAGIC],
[SQRTHALF+MAGIC45, SQRTHALF-MAGIC45],
[SQRTHALF, SQRTHALF],
[SQRTHALF-MAGIC45, SQRTHALF+MAGIC45],
[MAGIC, 1.0],
[0.0, 1.0],
[-MAGIC, 1.0],
[-SQRTHALF+MAGIC45, SQRTHALF+MAGIC45],
[-SQRTHALF, SQRTHALF],
[-SQRTHALF-MAGIC45, SQRTHALF-MAGIC45],
[-1.0, MAGIC],
[-1.0, 0.0],
[-1.0, -MAGIC],
[-SQRTHALF-MAGIC45, -SQRTHALF+MAGIC45],
[-SQRTHALF, -SQRTHALF],
[-SQRTHALF+MAGIC45, -SQRTHALF-MAGIC45],
[-MAGIC, -1.0],
[0.0, -1.0],
[0.0, -1.0]],
np.float_)
codes = cls.CURVE4 * np.ones(26)
codes[0] = cls.MOVETO
codes[-1] = cls.CLOSEPOLY
cls._unit_circle = cls(vertices, codes)
return cls._unit_circle
|
|
From: Chris B. <Chr...@no...> - 2009-08-24 00:46:02
|
Sameer Regmi wrote: > We are working on plotting mesh (in > hermes2d: http://hpfem.math.unr.edu/projects/hermes2d-new/) > In the hermes2d examples curves are defined as [4, 7, 45] where 4,7 > are vertices indices, and 45 is center angle. > 1) matplot.path porvides a way to plot curve with three points > http://matplotlib.sourceforge.net/api/path_api.html#module-matplotlib.path This is a Bezier spline -- it can not exactly form a piece of a circle (though it can get pretty close). You can probably find the math somewhere for how to approximate a circle, but... > 2) matplot.patch.arc provides a way to plot an arc > http://matplotlib.sourceforge.net/api/artist_api.html#module-matplotlib.patches > > but it needs > -> center of circle > -> start angle > -> end angle > -> radius of circle > we have to calculate all these with data available to us Since this actually plots s circle, I think it's a better bet. It should be pretty straightforward coordinate geometry to find those parameters from the ones you have -- and you only have to write that once! This page (or others like it) might help you get started: http://www.codecogs.com/reference/maths/analytical_geometry/the_coordinate_geometry_of_a_circle.php HTH, -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... |