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
(47) |
2
(13) |
3
(12) |
4
(16) |
5
(3) |
6
(6) |
7
(20) |
8
(45) |
9
(24) |
10
(30) |
11
(14) |
12
(4) |
13
(1) |
14
(6) |
15
(6) |
16
(10) |
17
(15) |
18
(13) |
19
(4) |
20
|
21
(14) |
22
(13) |
23
(9) |
24
(19) |
25
(24) |
26
|
27
(4) |
28
(20) |
29
(17) |
30
(7) |
|
|
|
From: Jeff W. <js...@fa...> - 2010-06-10 21:47:47
|
On 6/10/10 3:28 PM, Benjamin Root wrote: > > > On Thu, Jun 10, 2010 at 1:00 PM, Jae-Joon Lee <lee...@gm... > <mailto:lee...@gm...>> wrote: > > On Thu, Jun 10, 2010 at 12:47 PM, Benjamin Root <ben...@ou... > <mailto:ben...@ou...>> wrote: > > P.S. - I have found a 'bug' of sorts with using 'box-forced' for > Basemap and > > AxesGrid. For the displayed plot, if one were to zoom in on one > of the > > plots, the other plots will zoom in as well (which I think is > neat), but > > they won't update their bbox to completely match the zoomed-in > axes. I > > guess this would be an argument against using 'box-forced'? > > By default, x-axis is shared along the axes in a same column and > y-axis is shared along the axes in a same raw. i.e., in your example, > only the y-axis are shared which I think is the source of your issue. > > http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/overview.html#axesgrid > > I think what you want is to use share_all=True. > > grid = AxesGrid(fig, 111, > nrows_ncols=(1, 3), > axes_pad=0.1, > share_all=True, > cbar_mode='single', > cbar_pad=0.05, > cbar_size=0.08, > ) > > Is this solve your problem? > Regards, > > -JJ > > > Not that it was a "problem" per se, just merely an observation I had. > Anyway, I tried that and indeed, zooming on one box zoomed all of the > other boxes the same way. Might be good to include in the basemap > examples, maybe? > > Thanks, > Ben Root Ben: I've added a new example (fcstmaps_axesgrid.py) that does this. -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: mdekauwe <mde...@gm...> - 2010-06-10 21:29:04
|
Hi, yes as I understand it (happy to be corrected)... fig = plt.figure(figsize=(8, 4)) fig.subplots_adjust(bottom=0.05) does nothing unless you also do ax = fig.add_subplot(111) but as I am also doing ax = fig.add_axes([0.1, 0.15, 0.7, 0.7]), it means I would just get two frames. Benjamin Root-2 wrote: > > Just to make sure, were you calling subplots_adjust() *before* calling > subplot()? Calling it after subplot() shouldn't have an effect on the > already created axes (I think...). > > Ben Root > > On Thu, Jun 10, 2010 at 3:41 PM, mdekauwe <mde...@gm...> wrote: > >> >> Unless I am mistaken subplots_adjust doesn't do anything as I am building >> an >> axes instance. Doing... >> >> fig = plt.figure(figsize=(8, 4)) >> ax = fig.add_axes([0.1, 0.15, 0.7, 0.7]) >> >> has shrunk the white space, though I think the font of the legend looks a >> bit less well defined, but perhaps that is just my eyes! >> >> http://old.nabble.com/file/p28848239/diffmap_JULES_DJF_snowFrac.GSWP2_vs_SSMI.jpeg >> >> >> >> >> Jae-Joon Lee wrote: >> > >> > On Thu, Jun 10, 2010 at 1:55 PM, mdekauwe <mde...@gm...> wrote: >> >> fig = plt.figure(figsize=(8, 6)) >> > >> > This. >> > Also play with subplots_adjust. >> > >> > -JJ >> > >> > >> ------------------------------------------------------------------------------ >> > ThinkGeek and WIRED's GeekDad team up for the Ultimate >> > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the >> > lucky parental unit. See the prize list and enter to win: >> > http://p.sf.net/sfu/thinkgeek-promo >> > _______________________________________________ >> > Matplotlib-users mailing list >> > Mat...@li... >> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > >> > >> >> -- >> View this message in context: >> http://old.nabble.com/Removing-white-space-surrounding-plots-tp28824528p28848239.html >> Sent from the matplotlib - users mailing list archive at Nabble.com. >> >> >> >> ------------------------------------------------------------------------------ >> ThinkGeek and WIRED's GeekDad team up for the Ultimate >> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the >> lucky parental unit. See the prize list and enter to win: >> http://p.sf.net/sfu/thinkgeek-promo >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://old.nabble.com/Removing-white-space-surrounding-plots-tp28824528p28848795.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Benjamin R. <ben...@ou...> - 2010-06-10 21:28:58
|
On Thu, Jun 10, 2010 at 1:00 PM, Jae-Joon Lee <lee...@gm...> wrote: > On Thu, Jun 10, 2010 at 12:47 PM, Benjamin Root <ben...@ou...> wrote: > > P.S. - I have found a 'bug' of sorts with using 'box-forced' for Basemap > and > > AxesGrid. For the displayed plot, if one were to zoom in on one of the > > plots, the other plots will zoom in as well (which I think is neat), but > > they won't update their bbox to completely match the zoomed-in axes. I > > guess this would be an argument against using 'box-forced'? > > By default, x-axis is shared along the axes in a same column and > y-axis is shared along the axes in a same raw. i.e., in your example, > only the y-axis are shared which I think is the source of your issue. > > > http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/overview.html#axesgrid > > I think what you want is to use share_all=True. > > grid = AxesGrid(fig, 111, > nrows_ncols=(1, 3), > axes_pad=0.1, > share_all=True, > cbar_mode='single', > cbar_pad=0.05, > cbar_size=0.08, > ) > > Is this solve your problem? > Regards, > > -JJ > Not that it was a "problem" per se, just merely an observation I had. Anyway, I tried that and indeed, zooming on one box zoomed all of the other boxes the same way. Might be good to include in the basemap examples, maybe? Thanks, Ben Root |
From: Benjamin R. <ben...@ou...> - 2010-06-10 21:13:52
|
Just to make sure, were you calling subplots_adjust() *before* calling subplot()? Calling it after subplot() shouldn't have an effect on the already created axes (I think...). Ben Root On Thu, Jun 10, 2010 at 3:41 PM, mdekauwe <mde...@gm...> wrote: > > Unless I am mistaken subplots_adjust doesn't do anything as I am building > an > axes instance. Doing... > > fig = plt.figure(figsize=(8, 4)) > ax = fig.add_axes([0.1, 0.15, 0.7, 0.7]) > > has shrunk the white space, though I think the font of the legend looks a > bit less well defined, but perhaps that is just my eyes! > > http://old.nabble.com/file/p28848239/diffmap_JULES_DJF_snowFrac.GSWP2_vs_SSMI.jpeg > > > > > Jae-Joon Lee wrote: > > > > On Thu, Jun 10, 2010 at 1:55 PM, mdekauwe <mde...@gm...> wrote: > >> fig = plt.figure(figsize=(8, 6)) > > > > This. > > Also play with subplots_adjust. > > > > -JJ > > > > > ------------------------------------------------------------------------------ > > ThinkGeek and WIRED's GeekDad team up for the Ultimate > > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > > lucky parental unit. See the prize list and enter to win: > > http://p.sf.net/sfu/thinkgeek-promo > > _______________________________________________ > > Matplotlib-users mailing list > > Mat...@li... > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > > > -- > View this message in context: > http://old.nabble.com/Removing-white-space-surrounding-plots-tp28824528p28848239.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: mdekauwe <mde...@gm...> - 2010-06-10 20:41:32
|
Unless I am mistaken subplots_adjust doesn't do anything as I am building an axes instance. Doing... fig = plt.figure(figsize=(8, 4)) ax = fig.add_axes([0.1, 0.15, 0.7, 0.7]) has shrunk the white space, though I think the font of the legend looks a bit less well defined, but perhaps that is just my eyes! http://old.nabble.com/file/p28848239/diffmap_JULES_DJF_snowFrac.GSWP2_vs_SSMI.jpeg Jae-Joon Lee wrote: > > On Thu, Jun 10, 2010 at 1:55 PM, mdekauwe <mde...@gm...> wrote: >> fig = plt.figure(figsize=(8, 6)) > > This. > Also play with subplots_adjust. > > -JJ > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://old.nabble.com/Removing-white-space-surrounding-plots-tp28824528p28848239.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Jeff P. <je...@gm...> - 2010-06-10 20:03:15
|
When I run the following, I get gibberish for the math symbols: ),?," instead of alph's, beta's, ..., etc. I believe I have all the correct fonts installed: stix, computer modern. I have tex and latex installed. Any suggestions? I am running FC12. Thanks, Jeff 1 import numpy as np 2 import matplotlib.pyplot as plt 3 t = np.arange(0.0, 2.0, 0.01) 4 s = np.sin(2*np.pi*t) 5 6 plt.plot(t,s) 7 plt.title(r'$\alpha_i > \beta_i$', fontsize=20) 8 plt.text(1, -0.6, r'$\sum_{i=0}^\infty x_i$', fontsize=20) 9 plt.text(0.6, 0.6, r'$\mathcal{A}\mathrm{sin}(2 \omega t)$', 10 fontsize=20) 11 plt.xlabel('time (s)') 12 plt.ylabel('volts (mV)') 13 plt.show() |
From: Benjamin R. <ben...@ou...> - 2010-06-10 19:09:06
|
Just in case nobody responded to you, yet... Are you asking how to plot a trend line onto a figure already containing data, or are you asking how to calculate a trend line from the data? If you need to calculate a trend line, then you need to use the SciPy module. If you already have your trend data, then you can call plot(X, Y) after you call your other command to plot your data. Ben Root On Thu, Jun 10, 2010 at 2:34 AM, L1011 <yab...@ho...> wrote: > > Hello all! > > I was wondering if it's possible to a trend curve (linear, quadratic...) to > a set of data with matplotlib... > > Thanks you! > > L1011 > -- > View this message in context: > http://old.nabble.com/Trend-curve-tp28839772p28839772.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Jeff W. <js...@fa...> - 2010-06-10 18:27:20
|
On 6/10/10 12:00 PM, Jae-Joon Lee wrote: > On Thu, Jun 10, 2010 at 12:47 PM, Benjamin Root<ben...@ou...> wrote: > >> P.S. - I have found a 'bug' of sorts with using 'box-forced' for Basemap and >> AxesGrid. For the displayed plot, if one were to zoom in on one of the >> plots, the other plots will zoom in as well (which I think is neat), but >> they won't update their bbox to completely match the zoomed-in axes. I >> guess this would be an argument against using 'box-forced'? >> > By default, x-axis is shared along the axes in a same column and > y-axis is shared along the axes in a same raw. i.e., in your example, > only the y-axis are shared which I think is the source of your issue. > > http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/overview.html#axesgrid > > I think what you want is to use share_all=True. > > grid = AxesGrid(fig, 111, > nrows_ncols=(1, 3), > axes_pad=0.1, > share_all=True, > cbar_mode='single', > cbar_pad=0.05, > cbar_size=0.08, > ) > > Is this solve your problem? > Regards, > > -JJ > Thanks Jae-Joon: Since I couldn't see any problem with removing adjustable='box' from Basemap, I went ahead and did it (and added an example that uses AxesGrid). AFAICT, a problem will only occur if the user explicit does ax_set_adjustable('datalim'). -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: Jae-Joon L. <lee...@gm...> - 2010-06-10 18:15:01
|
On Thu, Jun 10, 2010 at 1:55 PM, mdekauwe <mde...@gm...> wrote: > fig = plt.figure(figsize=(8, 6)) This. Also play with subplots_adjust. -JJ |
From: Eric F. <ef...@ha...> - 2010-06-10 18:10:08
|
On 06/10/2010 04:41 AM, Mike Bauer wrote: > Hello, > > Is there a way to get the data value at a specific longitude/latitude > from an array that has been projected and smoothed with basemap and > transform_scalar to a higher grid density? > > My original data is a global lat,lon array (73,144) that I process by > hemisphere with a polar centered 'laea' projection (limited to 15 > degrees in each hemisphere). The data is also > run through transform_scalar w/ say the result array being (180,360). > What I want is a way to either get the data value at lon=x,lat=y from > this array or a way to map the indices (180,360) such that > I know index i,j is bound by a set of latitudes and longitudes. > Not sure I understand completely, but note that a basemap instance is a callable. By default it transforms from lon,lat to map coordinates, but it also takes a kwarg, 'inverse'. If true, to transforms back from map coordinates to lon,lat. If your data have been transformed to a regular grid in map coordinates, this should allow you to find out what those grid cells are in lon,lat. Eric > Thanks for any suggestions. > > Mike > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Jae-Joon L. <lee...@gm...> - 2010-06-10 18:01:02
|
On Thu, Jun 10, 2010 at 12:47 PM, Benjamin Root <ben...@ou...> wrote: > P.S. - I have found a 'bug' of sorts with using 'box-forced' for Basemap and > AxesGrid. For the displayed plot, if one were to zoom in on one of the > plots, the other plots will zoom in as well (which I think is neat), but > they won't update their bbox to completely match the zoomed-in axes. I > guess this would be an argument against using 'box-forced'? By default, x-axis is shared along the axes in a same column and y-axis is shared along the axes in a same raw. i.e., in your example, only the y-axis are shared which I think is the source of your issue. http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/overview.html#axesgrid I think what you want is to use share_all=True. grid = AxesGrid(fig, 111, nrows_ncols=(1, 3), axes_pad=0.1, share_all=True, cbar_mode='single', cbar_pad=0.05, cbar_size=0.08, ) Is this solve your problem? Regards, -JJ |
From: mdekauwe <mde...@gm...> - 2010-06-10 17:55:11
|
Hi OK assuming upgrading is going to be a hassle. I just looked into and some of the libraries need changing etc etc. Do you know what I would change as a short term work around? When you said adjust size, did you mean this line fig = plt.figure(figsize=(8, 6)) or this ax = fig.add_axes([0.1, 0.1, 0.7, 0.7]) ? Thanks Jae-Joon Lee wrote: > > On Thu, Jun 10, 2010 at 9:28 AM, mdekauwe <mde...@gm...> wrote: >> so by the sounds of it an outdated version? But your example will work on >> a >> newer version? > > I think bbox_inches option is not supported with your version of > matplotlib. > You may upgrade to newer version, or you have to manually adjust the > figure size etc. > > Regards, > > -JJ > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://old.nabble.com/Removing-white-space-surrounding-plots-tp28824528p28846476.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Pierre GM <pgm...@gm...> - 2010-06-10 17:50:43
|
On Jun 10, 2010, at 1:30 PM, Christoph Gohlke wrote: > > > On 6/10/2010 10:14 AM, Pierre GM wrote: >> On Jun 10, 2010, at 12:51 PM, Jeff Whitaker wrote: >>> On 6/10/10 10:40 AM, Pierre GM wrote: >>>> All, >>>> Sorry, it's been a while since I've been using Basemap. I was just trying to update my local svn directory to r8403 and reinstall basemap, but an import fail w/ the following message: >>>> """ >>>> Traceback (most recent call last): >>>> File "<string>", line 1, in<module> >>>> File "~/basemap-dev/lib/mpl_toolkits/basemap/__init__.py", line 43, in<module> >>>> import _geoslib, netcdftime >>>> File "_geoslib.pyx", line 13, in _geoslib (src/_geoslib.c:4014) >>>> ValueError: numpy.ndarray does not appear to be the correct type object >>>> """ >>>> I'm using numpy 2.0.0r8460 (development version). basemap can be successfully imported w/ the latest stable version, though. What am I doing wrong ? >>>> Thx in advance. >>>> P. >>>> >>> >>> Pierre: That should have been fixed with a recompile of the _geoslib C extension Are you sure you deleted the build directory before reinstalling basemap? >> > Try to regenerate the c files from _geod.pyx, _proj.pyx, and > _geoslib.pyx, using Cython-0.12.1. For example: That did the trick. Thanks a million, I would have spent far more time trying to find this one... |
From: Christoph G. <cg...@uc...> - 2010-06-10 17:31:16
|
On 6/10/2010 10:14 AM, Pierre GM wrote: > On Jun 10, 2010, at 12:51 PM, Jeff Whitaker wrote: >> On 6/10/10 10:40 AM, Pierre GM wrote: >>> All, >>> Sorry, it's been a while since I've been using Basemap. I was just trying to update my local svn directory to r8403 and reinstall basemap, but an import fail w/ the following message: >>> """ >>> Traceback (most recent call last): >>> File "<string>", line 1, in<module> >>> File "~/basemap-dev/lib/mpl_toolkits/basemap/__init__.py", line 43, in<module> >>> import _geoslib, netcdftime >>> File "_geoslib.pyx", line 13, in _geoslib (src/_geoslib.c:4014) >>> ValueError: numpy.ndarray does not appear to be the correct type object >>> """ >>> I'm using numpy 2.0.0r8460 (development version). basemap can be successfully imported w/ the latest stable version, though. What am I doing wrong ? >>> Thx in advance. >>> P. >>> >> >> Pierre: That should have been fixed with a recompile of the _geoslib C extension Are you sure you deleted the build directory before reinstalling basemap? > > > I did. Do I have to recompile geos ? It should be independent of numpy, right ? So I shouldn't have to touch it ? > As far as I can tell, the setup picks up the proper versions of numpy and Python... Try to regenerate the c files from _geod.pyx, _proj.pyx, and _geoslib.pyx, using Cython-0.12.1. For example: python -c "from Cython.Compiler.Main import main; main(command_line=1)" _geod.pyx -- Christoph |
From: Pierre GM <pgm...@gm...> - 2010-06-10 17:14:31
|
On Jun 10, 2010, at 12:51 PM, Jeff Whitaker wrote: > On 6/10/10 10:40 AM, Pierre GM wrote: >> All, >> Sorry, it's been a while since I've been using Basemap. I was just trying to update my local svn directory to r8403 and reinstall basemap, but an import fail w/ the following message: >> """ >> Traceback (most recent call last): >> File "<string>", line 1, in<module> >> File "~/basemap-dev/lib/mpl_toolkits/basemap/__init__.py", line 43, in<module> >> import _geoslib, netcdftime >> File "_geoslib.pyx", line 13, in _geoslib (src/_geoslib.c:4014) >> ValueError: numpy.ndarray does not appear to be the correct type object >> """ >> I'm using numpy 2.0.0r8460 (development version). basemap can be successfully imported w/ the latest stable version, though. What am I doing wrong ? >> Thx in advance. >> P. >> > > Pierre: That should have been fixed with a recompile of the _geoslib C extension Are you sure you deleted the build directory before reinstalling basemap? I did. Do I have to recompile geos ? It should be independent of numpy, right ? So I shouldn't have to touch it ? As far as I can tell, the setup picks up the proper versions of numpy and Python... |
From: Benjamin R. <ben...@ou...> - 2010-06-10 16:48:17
|
On Thu, Jun 10, 2010 at 11:05 AM, Jeff Whitaker <js...@fa...> wrote: > On 6/9/10 1:58 PM, Benjamin Root wrote: > > Has anybody given any further thought to the implication of having Basemap > set adjustable as "box-forced" instead of "box"? So far, it has been > working just fine for me, but I have no clue if there are any unintended > side-effects. > > Ben Root > > > Ben: To summarize the discussion so far, it seems that "box-forced" should > not be used, and either Basemap should continue to use adjustable="box" (for > the reasons Eric gave in his post yesterday) or adjustable should not be set > at all by Basemap and that job should be left to the user (since > adjustable='box' is the default anyway, as Jae-Joon pointed out today). > Perhaps it would help if you could provide a usage example for AxesGrid axes > sharing with Basemap, so we can see what the consequences of changing the > current behavior are. > > -Jeff > > Jeff, Maybe it isn't a use-case per se, but I have found that it is much easier to use axes_grid1 instead of subplots to produce multiple radar plots that all use the same colorbar. For example, I have 3 radar plots to show, and I want a single colorbar on the right-hand side. To a newbie, one would add three subplots with a .colorbar() command for the last one. Unfortunately, the newbie will discover that the third plot will be smaller than the other two because that last axes has to be split between two objects. To someone a little more advanced, you would create 4 subplots, but fool around with the size of the last axes (and also have to discover to use ColorbarBase instead of the regular colorbar call). But, with axes_grid, this is quite trivial and the results look very nice. This is a png image of a time series I recently included for a publication shows the result using AxesGrid: http://dl.dropbox.com/u/7325604/NWRT_TimeSeries.png Ben Root P.S. - I have found a 'bug' of sorts with using 'box-forced' for Basemap and AxesGrid. For the displayed plot, if one were to zoom in on one of the plots, the other plots will zoom in as well (which I think is neat), but they won't update their bbox to completely match the zoomed-in axes. I guess this would be an argument against using 'box-forced'? > > > On Tue, Jun 1, 2010 at 6:00 PM, Benjamin Root <ben...@ou...> wrote: > >> Right, that is sort of what I am asking. My thinking is that Basemap >> could use 'box-forced' instead of 'box' for the adjustable parameter in >> order to make it and AxesGrid compatible. Usually, if one wants to use >> AxesGrid, they all should have the same domain and aspect ratio. I just >> have no clue what sort of repricussions that has for other use cases. >> >> So far, this has worked just fine for me, but I hardly represent the >> normal use cases of Basemap and AxesGrid. >> >> Ben Root >> >> >> On Tue, Jun 1, 2010 at 5:20 PM, Jae-Joon Lee <lee...@gm...>wrote: >> >>> If Basemap explicitly sets aspect=1 and adjustable="box" at the same >>> time, you cannot use this with any axes that shares its axis with >>> others (including the axes created by the AxesGrid). >>> >>> You need to somehow avoid the set_aspect call with adjustable"box" >>> (you can set box-forced in stead). >>> >>> -JJ >>> >>> >>> On Tue, Jun 1, 2010 at 2:45 PM, Benjamin Root <ben...@ou...> wrote: >>> > >>> > On a related note, I have noticed an incompatibility between AxesGrid >>> and >>> > Basemap. It appears that Basemap will explicitly set adjustable='box' >>> when >>> > it calls ax.set_aspect(), but AxesGrid will error out, saying that it >>> has to >>> > be 'datalim'. What are the implications of using 'box-forced' instead >>> of >>> > 'box' in Basemap? >>> > >>> > Ben Root >>> > >>> > On Thu, May 27, 2010 at 1:59 PM, Jae-Joon Lee <lee...@gm...> >>> wrote: >>> >> >>> >> ax1 = subplot(121) >>> >> ax2 = subplot(122, sharex=ax1, sharey=ax1) >>> >> >>> >> ax1.set_adjustable("box-forced") >>> >> ax2.set_adjustable("box-forced") >>> >> >>> >> arr1 = np.arange(100).reshape((10, 10)) >>> >> ax1.imshow(arr1) >>> >> >>> >> arr2 = np.arange(100, 0, -1).reshape((10, 10)) >>> >> ax2.imshow(arr2) >>> >> >>> >> Note the use of set_adjustable("box-forced"). >>> >> sharex and sharey does not get along with axes of aspect=1 & >>> >> adjustable="box". >>> >> >>> >> -JJ >>> >> >>> >> >>> >> >>> >> On Thu, May 27, 2010 at 2:10 PM, <PH...@ge...> wrote: >>> >> > Do the “sharex” and “sharey” kwargs help? >>> >> > >>> >> > >>> >> > >>> http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.axes >>> >> > >>> >> > >>> >> > >>> http://matplotlib.sourceforge.net/examples/pylab_examples/shared_axis_demo.html >>> >> > >>> >> > -paul >>> >> > >>> >> > >>> >> > >>> >> > From: Adam Fraser [mailto:ada...@gm...] >>> >> > Sent: Thursday, May 27, 2010 10:44 AM >>> >> > To: matplotlib-users >>> >> > Subject: [Matplotlib-users] Is there a way to link axes of imshow >>> plots? >>> >> > >>> >> > >>> >> > >>> >> > Suppose I have a figure canvas with 3 plots... 2 are images of the >>> same >>> >> > dimensions plotted with imshow, and the other is a scatterplot. I'd >>> like >>> >> > to >>> >> > be able to link the x and y axes of the imshow plots so that when I >>> zoom >>> >> > in >>> >> > one, the other zooms to the same coordinates, and when I pan in one, >>> the >>> >> > other pans as well. >>> >> > >>> >> > >>> >> > >>> >> > I started hacking my way around this by >>> >> > subclassing NavigationToolbar2WxAgg >>> >> > (shown below)... but there are several problems here. >>> >> > >>> >> > 1) This will link the axes of all plots in a canvas since all I've >>> done >>> >> > is >>> >> > get rid of the checks for a.in_axes() >>> >> > >>> >> > 2) This worked well for panning, but zooming caused all subplots to >>> zoom >>> >> > from the same global point, rather than from the same point in each >>> of >>> >> > their >>> >> > respective axes. >>> >> > >>> >> > >>> >> > >>> >> > Can anyone suggest a workaround? >>> >> > >>> >> > >>> >> > >>> >> > Much thanks! >>> >> > >>> >> > -Adam >>> >> > >>> >> > >>> >> > >>> >> > from matplotlib.backends.backend_wxagg import >>> NavigationToolbar2WxAgg as >>> >> > NavigationToolbar >>> >> > >>> >> > class MyNavToolbar(NavigationToolbar): >>> >> > >>> >> > def __init__(self, canvas, cpfig): >>> >> > >>> >> > NavigationToolbar.__init__(self, canvas) >>> >> > >>> >> > >>> >> > >>> >> > # override >>> >> > >>> >> > def press_pan(self, event): >>> >> > >>> >> > 'the press mouse button in pan/zoom mode callback' >>> >> > >>> >> > >>> >> > >>> >> > if event.button == 1: >>> >> > >>> >> > self._button_pressed=1 >>> >> > >>> >> > elif event.button == 3: >>> >> > >>> >> > self._button_pressed=3 >>> >> > >>> >> > else: >>> >> > >>> >> > self._button_pressed=None >>> >> > >>> >> > return >>> >> > >>> >> > >>> >> > >>> >> > x, y = event.x, event.y >>> >> > >>> >> > >>> >> > >>> >> > # push the current view to define home if stack is empty >>> >> > >>> >> > if self._views.empty(): self.push_current() >>> >> > >>> >> > >>> >> > >>> >> > self._xypress=[] >>> >> > >>> >> > for i, a in enumerate(self.canvas.figure.get_axes()): >>> >> > >>> >> > # only difference from overridden method is that this >>> one >>> >> > doesn't >>> >> > >>> >> > # check a.in_axes(event) >>> >> > >>> >> > if x is not None and y is not None and a.get_navigate(): >>> >> > >>> >> > a.start_pan(x, y, event.button) >>> >> > >>> >> > self._xypress.append((a, i)) >>> >> > >>> >> > self.canvas.mpl_disconnect(self._idDrag) >>> >> > >>> >> > >>> >> > self._idDrag=self.canvas.mpl_connect('motion_notify_event', >>> >> > self.drag_pan) >>> >> > >>> >> > >>> >> > >>> >> > def press_zoom(self, event): >>> >> > >>> >> > 'the press mouse button in zoom to rect mode callback' >>> >> > >>> >> > if event.button == 1: >>> >> > >>> >> > self._button_pressed=1 >>> >> > >>> >> > elif event.button == 3: >>> >> > >>> >> > self._button_pressed=3 >>> >> > >>> >> > else: >>> >> > >>> >> > self._button_pressed=None >>> >> > >>> >> > return >>> >> > >>> >> > >>> >> > >>> >> > x, y = event.x, event.y >>> >> > >>> >> > >>> >> > >>> >> > # push the current view to define home if stack is empty >>> >> > >>> >> > if self._views.empty(): self.push_current() >>> >> > >>> >> > >>> >> > >>> >> > self._xypress=[] >>> >> > >>> >> > for i, a in enumerate(self.canvas.figure.get_axes()): >>> >> > >>> >> > # only difference from overridden method is that this >>> one >>> >> > doesn't >>> >> > >>> >> > # check a.in_axes(event) >>> >> > >>> >> > if x is not None and y is not None and a.get_navigate() >>> and >>> >> > a.can_zoom(): >>> >> > >>> >> > self._xypress.append(( x, y, a, i, >>> a.viewLim.frozen(), >>> >> > a.transData.frozen())) >>> >> > >>> >> > >>> >> > >>> >> > self.press(event) >>> >> > >>> >> > >>> >> > >>> >> > >>> >> > >>> >> > >>> >> > >>> >> > >>> >> > >>> ------------------------------------------------------------------------------ >>> >> > >>> >> > >>> >> > _______________________________________________ >>> >> > Matplotlib-users mailing list >>> >> > Mat...@li... >>> >> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> >> > >>> >> > >>> >> >>> >> >>> >> >>> ------------------------------------------------------------------------------ >>> >> >>> >> _______________________________________________ >>> >> Matplotlib-users mailing list >>> >> Mat...@li... >>> >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> > >>> > >>> > >>> ------------------------------------------------------------------------------ >>> > >>> > >>> > _______________________________________________ >>> > Matplotlib-devel mailing list >>> > Mat...@li... >>> > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel >>> > >>> > >>> >>> >>> ------------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> Matplotlib-devel mailing list >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel >>> >> >> > > > -- > Jeffrey S. Whitaker Phone : (303)497-6313 > Meteorologist FAX : (303)497-6449 > NOAA/OAR/PSD R/PSD1 Email : Jef...@no... > 325 Broadway Office : Skaggs Research Cntr 1D-113 > Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg > > |
From: Jeff W. <js...@fa...> - 2010-06-10 16:06:01
|
On 6/9/10 1:58 PM, Benjamin Root wrote: > Has anybody given any further thought to the implication of having > Basemap set adjustable as "box-forced" instead of "box"? So far, it > has been working just fine for me, but I have no clue if there are any > unintended side-effects. > > Ben Root Ben: To summarize the discussion so far, it seems that "box-forced" should not be used, and either Basemap should continue to use adjustable="box" (for the reasons Eric gave in his post yesterday) or adjustable should not be set at all by Basemap and that job should be left to the user (since adjustable='box' is the default anyway, as Jae-Joon pointed out today). Perhaps it would help if you could provide a usage example for AxesGrid axes sharing with Basemap, so we can see what the consequences of changing the current behavior are. -Jeff > > > On Tue, Jun 1, 2010 at 6:00 PM, Benjamin Root <ben...@ou... > <mailto:ben...@ou...>> wrote: > > Right, that is sort of what I am asking. My thinking is that > Basemap could use 'box-forced' instead of 'box' for the adjustable > parameter in order to make it and AxesGrid compatible. Usually, > if one wants to use AxesGrid, they all should have the same domain > and aspect ratio. I just have no clue what sort of repricussions > that has for other use cases. > > So far, this has worked just fine for me, but I hardly represent > the normal use cases of Basemap and AxesGrid. > > Ben Root > > > On Tue, Jun 1, 2010 at 5:20 PM, Jae-Joon Lee <lee...@gm... > <mailto:lee...@gm...>> wrote: > > If Basemap explicitly sets aspect=1 and adjustable="box" at > the same > time, you cannot use this with any axes that shares its axis with > others (including the axes created by the AxesGrid). > > You need to somehow avoid the set_aspect call with adjustable"box" > (you can set box-forced in stead). > > -JJ > > > On Tue, Jun 1, 2010 at 2:45 PM, Benjamin Root <ben...@ou... > <mailto:ben...@ou...>> wrote: > > > > On a related note, I have noticed an incompatibility between > AxesGrid and > > Basemap. It appears that Basemap will explicitly set > adjustable='box' when > > it calls ax.set_aspect(), but AxesGrid will error out, > saying that it has to > > be 'datalim'. What are the implications of using > 'box-forced' instead of > > 'box' in Basemap? > > > > Ben Root > > > > On Thu, May 27, 2010 at 1:59 PM, Jae-Joon Lee > <lee...@gm... <mailto:lee...@gm...>> wrote: > >> > >> ax1 = subplot(121) > >> ax2 = subplot(122, sharex=ax1, sharey=ax1) > >> > >> ax1.set_adjustable("box-forced") > >> ax2.set_adjustable("box-forced") > >> > >> arr1 = np.arange(100).reshape((10, 10)) > >> ax1.imshow(arr1) > >> > >> arr2 = np.arange(100, 0, -1).reshape((10, 10)) > >> ax2.imshow(arr2) > >> > >> Note the use of set_adjustable("box-forced"). > >> sharex and sharey does not get along with axes of aspect=1 & > >> adjustable="box". > >> > >> -JJ > >> > >> > >> > >> On Thu, May 27, 2010 at 2:10 PM, <PH...@ge... > <mailto:PH...@ge...>> wrote: > >> > Do the “sharex” and “sharey” kwargs help? > >> > > >> > > >> > > http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.axes > >> > > >> > > >> > > http://matplotlib.sourceforge.net/examples/pylab_examples/shared_axis_demo.html > >> > > >> > -paul > >> > > >> > > >> > > >> > From: Adam Fraser [mailto:ada...@gm... > <mailto:ada...@gm...>] > >> > Sent: Thursday, May 27, 2010 10:44 AM > >> > To: matplotlib-users > >> > Subject: [Matplotlib-users] Is there a way to link axes > of imshow plots? > >> > > >> > > >> > > >> > Suppose I have a figure canvas with 3 plots... 2 are > images of the same > >> > dimensions plotted with imshow, and the other is a > scatterplot. I'd like > >> > to > >> > be able to link the x and y axes of the imshow plots so > that when I zoom > >> > in > >> > one, the other zooms to the same coordinates, and when I > pan in one, the > >> > other pans as well. > >> > > >> > > >> > > >> > I started hacking my way around this by > >> > subclassing NavigationToolbar2WxAgg > >> > (shown below)... but there are several problems here. > >> > > >> > 1) This will link the axes of all plots in a canvas since > all I've done > >> > is > >> > get rid of the checks for a.in_axes() > >> > > >> > 2) This worked well for panning, but zooming caused all > subplots to zoom > >> > from the same global point, rather than from the same > point in each of > >> > their > >> > respective axes. > >> > > >> > > >> > > >> > Can anyone suggest a workaround? > >> > > >> > > >> > > >> > Much thanks! > >> > > >> > -Adam > >> > > >> > > >> > > >> > from matplotlib.backends.backend_wxagg import > NavigationToolbar2WxAgg as > >> > NavigationToolbar > >> > > >> > class MyNavToolbar(NavigationToolbar): > >> > > >> > def __init__(self, canvas, cpfig): > >> > > >> > NavigationToolbar.__init__(self, canvas) > >> > > >> > > >> > > >> > # override > >> > > >> > def press_pan(self, event): > >> > > >> > 'the press mouse button in pan/zoom mode callback' > >> > > >> > > >> > > >> > if event.button == 1: > >> > > >> > self._button_pressed=1 > >> > > >> > elif event.button == 3: > >> > > >> > self._button_pressed=3 > >> > > >> > else: > >> > > >> > self._button_pressed=None > >> > > >> > return > >> > > >> > > >> > > >> > x, y = event.x, event.y > >> > > >> > > >> > > >> > # push the current view to define home if stack > is empty > >> > > >> > if self._views.empty(): self.push_current() > >> > > >> > > >> > > >> > self._xypress=[] > >> > > >> > for i, a in enumerate(self.canvas.figure.get_axes()): > >> > > >> > # only difference from overridden method is > that this one > >> > doesn't > >> > > >> > # check a.in_axes(event) > >> > > >> > if x is not None and y is not None and > a.get_navigate(): > >> > > >> > a.start_pan(x, y, event.button) > >> > > >> > self._xypress.append((a, i)) > >> > > >> > self.canvas.mpl_disconnect(self._idDrag) > >> > > >> > > >> > self._idDrag=self.canvas.mpl_connect('motion_notify_event', > >> > self.drag_pan) > >> > > >> > > >> > > >> > def press_zoom(self, event): > >> > > >> > 'the press mouse button in zoom to rect mode > callback' > >> > > >> > if event.button == 1: > >> > > >> > self._button_pressed=1 > >> > > >> > elif event.button == 3: > >> > > >> > self._button_pressed=3 > >> > > >> > else: > >> > > >> > self._button_pressed=None > >> > > >> > return > >> > > >> > > >> > > >> > x, y = event.x, event.y > >> > > >> > > >> > > >> > # push the current view to define home if stack > is empty > >> > > >> > if self._views.empty(): self.push_current() > >> > > >> > > >> > > >> > self._xypress=[] > >> > > >> > for i, a in enumerate(self.canvas.figure.get_axes()): > >> > > >> > # only difference from overridden method is > that this one > >> > doesn't > >> > > >> > # check a.in_axes(event) > >> > > >> > if x is not None and y is not None and > a.get_navigate() and > >> > a.can_zoom(): > >> > > >> > self._xypress.append(( x, y, a, i, > a.viewLim.frozen(), > >> > a.transData.frozen())) > >> > > >> > > >> > > >> > self.press(event) > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > ------------------------------------------------------------------------------ > >> > > >> > > >> > _______________________________________________ > >> > Matplotlib-users mailing list > >> > Mat...@li... > <mailto:Mat...@li...> > >> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >> > > >> > > >> > >> > >> > ------------------------------------------------------------------------------ > >> > >> _______________________________________________ > >> Matplotlib-users mailing list > >> Mat...@li... > <mailto:Mat...@li...> > >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > > > > ------------------------------------------------------------------------------ > > > > > > _______________________________________________ > > Matplotlib-devel mailing list > > Mat...@li... > <mailto:Mat...@li...> > > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > > > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-devel mailing list > Mat...@li... > <mailto:Mat...@li...> > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > > > -- 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: Jae-Joon L. <lee...@gm...> - 2010-06-10 15:46:52
|
On Thu, Jun 10, 2010 at 9:28 AM, mdekauwe <mde...@gm...> wrote: > so by the sounds of it an outdated version? But your example will work on a > newer version? I think bbox_inches option is not supported with your version of matplotlib. You may upgrade to newer version, or you have to manually adjust the figure size etc. Regards, -JJ |
From: Jae-Joon L. <lee...@gm...> - 2010-06-10 15:16:49
|
Can you describe why using the "extent" keyword does not serve your purpose? The svn version of matplotlib support BboxImage which might be better (depending on your use case). -JJ On Thu, Jun 10, 2010 at 1:21 AM, Eamon Caddigan <eam...@gm...> wrote: > Hi everybody, > > I'd like to draw thumbnails of images on various plots, e.g., a bar > chart with a picture placed at the base of the bar, or a scatter plot > with photos next to select points. > > Reading and resizing the image aren't an issue. However, I've been > searching all day, and I can't figure out how to call imshow without > it taking over the axis in which its drawn. > > Thanks, > Eamon > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Mike B. <mb...@gi...> - 2010-06-10 14:41:47
|
Hello, Is there a way to get the data value at a specific longitude/latitude from an array that has been projected and smoothed with basemap and transform_scalar to a higher grid density? My original data is a global lat,lon array (73,144) that I process by hemisphere with a polar centered 'laea' projection (limited to 15 degrees in each hemisphere). The data is also run through transform_scalar w/ say the result array being (180,360). What I want is a way to either get the data value at lon=x,lat=y from this array or a way to map the indices (180,360) such that I know index i,j is bound by a set of latitudes and longitudes. Thanks for any suggestions. Mike |
From: Benjamin R. <ben...@ou...> - 2010-06-10 14:41:24
|
Actually, You might want to check out axes_grid module in the mpl_toolkits. After a quick perusal, I think InsetLocator might be what you are looking for in the axes_grid module. http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/overview.html I hope this helps, Ben Root On Thu, Jun 10, 2010 at 8:54 AM, Eamon Caddigan <eam...@gm...>wrote: > Actually, since axes are created with normalized coordinates, what I > really need is a way to query the size of the current figure, in > pixels. > > On Thu, Jun 10, 2010 at 7:43 AM, Eamon Caddigan > <eam...@gm...> wrote: > > Thanks Scott. In order to precisely position an image using separate > > axes, I'd need to be able to query and set the margin between the > > bounding box and the actual axes. I can't seem to find any way to do > > that, either. > > > > On Thu, Jun 10, 2010 at 1:13 AM, Scott Sinclair > > <sco...@gm...> wrote: > >>>On 10 June 2010 07:21, Eamon Caddigan <eam...@gm...> wrote: > >>> I'd like to draw thumbnails of images on various plots, e.g., a bar > >>> chart with a picture placed at the base of the bar, or a scatter plot > >>> with photos next to select points. > >>> > >>> Reading and resizing the image aren't an issue. However, I've been > >>> searching all day, and I can't figure out how to call imshow without > >>> it taking over the axis in which its drawn. > >> > >> You could try using separate axes for your images, as in > >> > http://matplotlib.sourceforge.net/examples/pylab_examples/axes_demo.html > >> > >> Cheers, > >> Scott > >> > >> > ------------------------------------------------------------------------------ > >> ThinkGeek and WIRED's GeekDad team up for the Ultimate > >> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > >> lucky parental unit. See the prize list and enter to win: > >> http://p.sf.net/sfu/thinkgeek-promo > >> _______________________________________________ > >> Matplotlib-users mailing list > >> Mat...@li... > >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >> > > > > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Eamon C. <eam...@gm...> - 2010-06-10 13:54:42
|
Actually, since axes are created with normalized coordinates, what I really need is a way to query the size of the current figure, in pixels. On Thu, Jun 10, 2010 at 7:43 AM, Eamon Caddigan <eam...@gm...> wrote: > Thanks Scott. In order to precisely position an image using separate > axes, I'd need to be able to query and set the margin between the > bounding box and the actual axes. I can't seem to find any way to do > that, either. > > On Thu, Jun 10, 2010 at 1:13 AM, Scott Sinclair > <sco...@gm...> wrote: >>>On 10 June 2010 07:21, Eamon Caddigan <eam...@gm...> wrote: >>> I'd like to draw thumbnails of images on various plots, e.g., a bar >>> chart with a picture placed at the base of the bar, or a scatter plot >>> with photos next to select points. >>> >>> Reading and resizing the image aren't an issue. However, I've been >>> searching all day, and I can't figure out how to call imshow without >>> it taking over the axis in which its drawn. >> >> You could try using separate axes for your images, as in >> http://matplotlib.sourceforge.net/examples/pylab_examples/axes_demo.html >> >> Cheers, >> Scott >> >> ------------------------------------------------------------------------------ >> ThinkGeek and WIRED's GeekDad team up for the Ultimate >> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the >> lucky parental unit. See the prize list and enter to win: >> http://p.sf.net/sfu/thinkgeek-promo >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > |
From: mdekauwe <mde...@gm...> - 2010-06-10 13:28:46
|
Hmm OK thanks. It seems I am using In [3]: matplotlib.__version__ Out[3]: '0.98.5.3' so by the sounds of it an outdated version? But your example will work on a newer version? What version of matplotlib are you using? With 0.99.1.1 (and likely later) and also with the svn version, using the bbox_inches="tight" actually produces an output with too small margin. With the svn version, following code should generate an output with an adequate margin. Otherwise, you cannot rely on bbox_inches features. Instead, you have to manually adjust the size of the figure (and subplots_adjust). Regards, -JJ t1=ax.text(0.5, -0.15, 'Longitude', transform=ax.transAxes, ha='center', va='center') t2=ax.text(-0.1, 0.5, 'Latitude', transform=ax.transAxes, ha= 'center', va='center', rotation='vertical') #ax.set_title("Sign.Different: GSPW2 - Princeton") fig.savefig('test.png', dpi=300, bbox_inches='tight', bbox_extra_artists=[t1, t2]) -- View this message in context: http://old.nabble.com/Removing-white-space-surrounding-plots-tp28824528p28843153.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Eamon C. <eam...@gm...> - 2010-06-10 12:43:15
|
Thanks Scott. In order to precisely position an image using separate axes, I'd need to be able to query and set the margin between the bounding box and the actual axes. I can't seem to find any way to do that, either. On Thu, Jun 10, 2010 at 1:13 AM, Scott Sinclair <sco...@gm...> wrote: >>On 10 June 2010 07:21, Eamon Caddigan <eam...@gm...> wrote: >> I'd like to draw thumbnails of images on various plots, e.g., a bar >> chart with a picture placed at the base of the bar, or a scatter plot >> with photos next to select points. >> >> Reading and resizing the image aren't an issue. However, I've been >> searching all day, and I can't figure out how to call imshow without >> it taking over the axis in which its drawn. > > You could try using separate axes for your images, as in > http://matplotlib.sourceforge.net/examples/pylab_examples/axes_demo.html > > Cheers, > Scott > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Eric F. <ef...@ha...> - 2010-06-10 07:57:53
|
On 06/09/2010 09:15 PM, Matthias Michler wrote: > On Wednesday, June 09, 2010 08:00:13 pm Eric Firing wrote: >> On 06/08/2010 11:07 PM, Matthias Michler wrote: >>> On Wednesday, June 09, 2010 11:00:31 am Eric Firing wrote: >>>> On 06/08/2010 10:48 PM, Matthias Michler wrote: >>>>> On Friday, April 23, 2010 11:08:50 am Matthias Michler wrote: >>>>>> Hello list, Hello developers, >>>>>> >>>>>> I'd like to summarize my discussion with Gökhan ("Turning off minor >>>>>> grids on log scaled plot") in the last days and propose two patches. >>>>>> >>>>>> The first patch adds the keyword argument 'which' from the axis.grid >>>>>> to the method 'grid' of the Axes >>>>>> (axes_grid_for_major_and_minor_ticks.patch). This allows to change the >>>>>> drawing of grid lines for x- and y-axis at the same time. >>>>>> >>>>>> Furthemore Gökhan proposed to toggle *all* (namely major and minor >>>>>> tick) grid lines after pressing the key 'g'. Therefore the call >>>>>> event.inaxes.grid(), which toggles only the (default) major tick grid >>>>>> lines, is replaced by event.inaxes.grid(which='majorminor') (see >>>>>> toggling_all_tick_grid_lines.patch). >>>>>> This yields the expected behavior if e.g. all (major and minor) tick >>>>>> grid lines are shown, because than toggling the grid means to remove >>>>>> all grid lines. But to be honest I'm not sure the latter is the >>>>>> intended behavior in all cases. For instance in the case of shown >>>>>> major tick lines toggling all means turning off major tick lines and >>>>>> turning on minor tick lines by pressing 'g'. This sounds a little bit >>>>>> crazy to me, although that's what toggling is about. >>>> >>>> I think that behavior would indeed drive the user crazy, so I would not >>>> want to commit a patch that does that. >>>> >>>> Eric >>> >>> Hi Eric, >>> >>> thanks a lot for your comment. What do you think about the first part >>> namely adding the kwarg 'which' from the axis method to the Axes method >>> grid? >> >> I went ahead and did it in 8402--check to see that this is what you had >> in mind. The which kwarg can be 'both', 'minor', or 'major'. > > Hi Eric, > > thanks a lot for this commit. This is exactly what I wanted. > > There is only one thing about the new possibilities 'both', 'minor', or > 'major'. The first possibility replaces 'majorminor', 'minormajor', > 'some_string_including_major_and_minor', ... and I'm afraid that this could > break someone's code. The docstring for Axis.grid used to say Set the axis grid on or off; b is a boolean. Use *which* = 'major' | 'minor' to set the grid for major or minor ticks. This is pretty clear--*which* is 'major' or 'minor', not a string that might contain either or both. How would a user have gotten the idea that the API included 'majorminor'? Was it documented somewhere else? Granted, because it was written using a string search to parse the kwarg, any string containing major and or minor would work, but this strikes me as a bad API, and not in keeping with the rest of mpl. Given the docstring, I suspect that the behavior was actually accidental. Both the code and the docstring have been the same since at least 2004--I got tired of tracing it back in time. In this case I am inclined to make the behavior consistent with the docstring, and then enhance it with the "both" option, as I did. Was there a mailing list thread pointing out that "majorminor" etc would actually work, contrary to the docstring? Eric > > Kind regards, > Matthias > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |