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
(9) |
2
(1) |
3
(4) |
4
(4) |
|
5
(9) |
6
(5) |
7
(12) |
8
(5) |
9
(27) |
10
(10) |
11
(4) |
|
12
|
13
(6) |
14
(12) |
15
(16) |
16
(13) |
17
(9) |
18
(1) |
|
19
(2) |
20
(4) |
21
(9) |
22
(5) |
23
(2) |
24
(6) |
25
|
|
26
(1) |
27
(9) |
28
(7) |
29
(2) |
30
(9) |
|
|
|
From: Benjamin R. <ben...@ou...> - 2011-06-07 23:37:06
|
On Tuesday, June 7, 2011, Eric Firing <ef...@ha...> wrote: > On 06/07/2011 11:46 AM, Benjamin Root wrote: >> On Saturday, June 4, 2011, Eric Firing<ef...@ha...> wrote: >>> >>> >>> https://github.com/efiring/matplotlib/blob/faq_show_draw/doc/faq/usage_faq.rst >>> >>> Eric, Ben, >>> >>> See if the section "What is interactive mode" makes sense to you. I have just added it to a feature branch (which includes some other faq madifications, mainly moving the backend section from installation to usage), but have not yet generated a pull request. It doesn't go into every detail, or into the underlying machinery. It is intended to provide just enough understanding to clear up user-level confusion about interactive mode, show, and draw, and let most relatively new users get on with their work. >>> >>> Eric >>> >> >> Eric, >> >> I see where you are going with this, and this is valuable information >> to include in the docs. However, the interactive mode and backend info >> doesn't seem to fit properly with everything else on the page. I am > > I don't see why not. A FAQ is a place for answers to questions, and > this is the usage section of the FAQ, so I don't see any inherent reason > why information about backends and interactive mode, both of which > involve mpl usage, can't go there. There may be better places, to which > the FAQ could refer, but I think the FAQ is better than nothing. I > moved the backend piece from the installation part of the FAQ, where it > *really* didn't belong. (And the remaining installation part is also an > out-of-date worm jar.) > >> not sure where to put them yet, but I will see if I can take a deeper >> look tomorrow. I also already noticed some other wording issues in >> some other parts of that page. >> >> Ben Root > > What you will also find is that the section users/shell.rst, which threw > Eric L for a loop in the first place, badly needs updating, and overlaps > with what I was trying to do in the FAQ. As Eric also points out, a > section with more detail would probably be good somewhere; I was > thinking of putting that in the FAQ also, at least as a first step. > > My github branch now includes a changeset with augmented docstrings for > show and draw. > > Eric > I think my main issue is that the FAQ is not really an FAQ anymore. There are only a few remaining questions as section headers, and some of the "answers" are much too involved. I would think we would be best served by a real FAQ and then separate topic-based docs that the answers can link to (as well as having them accessible from the main toc). Ben Root |
|
From: Eric F. <ef...@ha...> - 2011-06-07 22:48:04
|
On 06/07/2011 11:36 AM, Bruce Ford wrote: > That's what I thought, but the code below fails (ValueError: Shape > mismatch objects cannot be broadcast to a single shape) when trying to > plot the 2nd parameter. Do I need another basemap? No, but check the dimensions of t2m; maybe it is transposed relative to what is needed. It needs to have shape (n_latitudes, n_longitudes), just like x1 and y1. It's confusing, but it's a common convention. Also, although this is not relevant to your particular problem here, it might be good to transform your lon, lat 2-D arrays into map coordinates, so that if you decide to use a different projection some day, it will still work. Eric > > Appreciate any thoughts! > > from mpl_toolkits.basemap import Basemap, shiftgrid > from netCDF4 import Dataset > import numpy as np > import matplotlib.pyplot as plt > > fig=plt.figure() > lon1 = 0 > lon2 = 357.5 > lat1 = -90 > lat2 = 90 > m = Basemap(resolution='c',projection='cyl',llcrnrlon=lon1,llcrnrlat=lat1,\ > urcrnrlon=lon2,urcrnrlat=lat2) > > #get data and plot 1st parameter - This works > filename = "/data/reanal-2/ltm/monthly_ltm_01.nc <http://monthly_ltm_01.nc>" > print filename > nc = Dataset(filename, mode="r") > hgt = nc.variables['HGT_2_ISBL_10'][16,:,:] > print hgt.shape > lons = nc.variables['longitude'][:] > lats = nc.variables['latitude'][:] > x,y = np.meshgrid(lons, lats) > CS = m.contour(x,y,hgt,15,linewidths=0.5,colors='k') > CS = m.contourf(x,y,hgt,cmap=plt.cm.jet) > ########################### > > #extract and plot 2nd paramter - This fails with > # ValueError: Shape mismatch objects cannot be broadcast to a single shape > filename1 = "/data/nps_datasets/WNA_T2m_200808.nc" > print filename1 > nc1 = Dataset(filename1, mode="r") > for var in nc1.variables: > print var > t2m = nc1.variables['T2m'][0,:,:] > print t2m.shape > lons1 = nc1.variables['lon'][:] > lats1 = nc1.variables['lat'][:] > x1,y1 = np.meshgrid(lons1, lats1) > CS1 = m.contour(x1,y1,t2m,15,linewidths=0.5,colors='k') > CS1 = m.contourf(x1,y1,t2m,cmap=plt.cm.jet) > ############################# > > m.drawcoastlines() > m.drawmapboundary() > #m.fillcontinents() > # draw parallels and meridians. > parallels = np.arange(-90,90,30) > #m.drawparallels(parallels,labels=[1,0,0,1]) > m.drawparallels(parallels,labels=[1,0,0,1]) > meridians = np.arange(0,357.5,30) > m.drawmeridians(meridians,labels=[1,0,0,1]) > plt.title('Plotted Grid') > plt.show() > |
|
From: Bruce F. <br...@cl...> - 2011-06-07 22:04:44
|
That's what I thought, but the code below fails (ValueError: Shape mismatch
objects cannot be broadcast to a single shape) when trying to plot the 2nd
parameter. Do I need another basemap?
Appreciate any thoughts!
from mpl_toolkits.basemap import Basemap, shiftgrid
from netCDF4 import Dataset
import numpy as np
import matplotlib.pyplot as plt
fig=plt.figure()
lon1 = 0
lon2 = 357.5
lat1 = -90
lat2 = 90
m = Basemap(resolution='c',projection='cyl',llcrnrlon=lon1,llcrnrlat=lat1,\
urcrnrlon=lon2,urcrnrlat=lat2)
#get data and plot 1st parameter - This works
filename = "/data/reanal-2/ltm/monthly_ltm_01.nc"
print filename
nc = Dataset(filename, mode="r")
hgt = nc.variables['HGT_2_ISBL_10'][16,:,:]
print hgt.shape
lons = nc.variables['longitude'][:]
lats = nc.variables['latitude'][:]
x,y = np.meshgrid(lons, lats)
CS = m.contour(x,y,hgt,15,linewidths=0.5,colors='k')
CS = m.contourf(x,y,hgt,cmap=plt.cm.jet)
###########################
#extract and plot 2nd paramter - This fails with
# ValueError: Shape mismatch objects cannot be broadcast to a single shape
filename1 = "/data/nps_datasets/WNA_T2m_200808.nc"
print filename1
nc1 = Dataset(filename1, mode="r")
for var in nc1.variables:
print var
t2m = nc1.variables['T2m'][0,:,:]
print t2m.shape
lons1 = nc1.variables['lon'][:]
lats1 = nc1.variables['lat'][:]
x1,y1 = np.meshgrid(lons1, lats1)
CS1 = m.contour(x1,y1,t2m,15,linewidths=0.5,colors='k')
CS1 = m.contourf(x1,y1,t2m,cmap=plt.cm.jet)
#############################
m.drawcoastlines()
m.drawmapboundary()
#m.fillcontinents()
# draw parallels and meridians.
parallels = np.arange(-90,90,30)
#m.drawparallels(parallels,labels=[1,0,0,1])
m.drawparallels(parallels,labels=[1,0,0,1])
meridians = np.arange(0,357.5,30)
m.drawmeridians(meridians,labels=[1,0,0,1])
plt.title('Plotted Grid')
plt.show()
---------------------------------------
Bruce W. Ford
Clear Science, Inc.
br...@cl...
http://www.ClearScienceInc.com
http://www.facebook.com/clearscience
http://www.twitter.com/ROVs_rule
Phone: (904) 796-8101
Fax: (904) 379-9704
8241 Parkridge Circle N.
Jacksonville, FL 32211
Skype: bruce.w.ford
On Tue, Jun 7, 2011 at 1:06 AM, Benjamin Root <ben...@ou...> wrote:
> On Monday, June 6, 2011, Bruce Ford <br...@cl...> wrote:
> > Does anyone have an example of nested grids.
> > I need to (for instance), plot a global grid in filled contours, then
> plot another, higher resolution grid over the US.The global grid could work
> something like this, but I'm not sure where to start with the 2nd (nested)
> grid to go atop.
> >
> >
> > fig=plt.figure()m =
> Basemap(resolution='c',projection='cyl',llcrnrlon=lon1,llcrnrlat=lat1,\
> urcrnrlon=lon2,urcrnrlat=lat2)# make a filled contour plot.
> >
> > x, y = m(lons, lats)CS =
> m.contour(x,y,hgt,15,linewidths=0.5,colors='k')CS =
> m.contourf(x,y,hgt,15,cmap=plt.cm.jet)m.drawcoastlines()m.drawmapboundary()
> > m.fillcontinents()
> > # draw parallels and meridians.parallels =
> np.arange(-90,90,10)#m.drawparallels(parallels,labels=[1,0,0,1])m.drawparallels(parallels,labels=[1,0,0,1])meridians
> = np.arange(-180.,180.,10.)
> >
> > m.drawmeridians(meridians,labels=[1,0,0,1])plt.title('Plotted
> Grid')plt.show()
> > Thanks!
> > Bruce
> > ---------------------------------------
> > Bruce W. Ford
> > Clear Science, Inc.
> > br...@cl...
> >
> >
> >
> >
> >
>
> It should just work as you expect. Do the global contour with the
> coarser x/y data, and then do the US contour with finer x/y data.
>
> Ben Root
>
|
|
From: Eric F. <ef...@ha...> - 2011-06-07 22:02:01
|
On 06/07/2011 11:46 AM, Benjamin Root wrote: > On Saturday, June 4, 2011, Eric Firing<ef...@ha...> wrote: >> >> >> https://github.com/efiring/matplotlib/blob/faq_show_draw/doc/faq/usage_faq.rst >> >> Eric, Ben, >> >> See if the section "What is interactive mode" makes sense to you. I have just added it to a feature branch (which includes some other faq madifications, mainly moving the backend section from installation to usage), but have not yet generated a pull request. It doesn't go into every detail, or into the underlying machinery. It is intended to provide just enough understanding to clear up user-level confusion about interactive mode, show, and draw, and let most relatively new users get on with their work. >> >> Eric >> > > Eric, > > I see where you are going with this, and this is valuable information > to include in the docs. However, the interactive mode and backend info > doesn't seem to fit properly with everything else on the page. I am I don't see why not. A FAQ is a place for answers to questions, and this is the usage section of the FAQ, so I don't see any inherent reason why information about backends and interactive mode, both of which involve mpl usage, can't go there. There may be better places, to which the FAQ could refer, but I think the FAQ is better than nothing. I moved the backend piece from the installation part of the FAQ, where it *really* didn't belong. (And the remaining installation part is also an out-of-date worm jar.) > not sure where to put them yet, but I will see if I can take a deeper > look tomorrow. I also already noticed some other wording issues in > some other parts of that page. > > Ben Root What you will also find is that the section users/shell.rst, which threw Eric L for a loop in the first place, badly needs updating, and overlaps with what I was trying to do in the FAQ. As Eric also points out, a section with more detail would probably be good somewhere; I was thinking of putting that in the FAQ also, at least as a first step. My github branch now includes a changeset with augmented docstrings for show and draw. Eric |
|
From: Benjamin R. <ben...@ou...> - 2011-06-07 21:52:33
|
On Tuesday, June 7, 2011, Bruce Ford <br...@cl...> wrote:
> That's what I thought, but the code below fails (ValueError: Shape mismatch objects cannot be broadcast to a single shape) when trying to plot the 2nd parameter. Do I need another basemap?
>
> Appreciate any thoughts!
>
> from mpl_toolkits.basemap import Basemap, shiftgrid
> from netCDF4 import Dataset
> import numpy as np
> import matplotlib.pyplot as plt
>
> fig=plt.figure()
> lon1 = 0
> lon2 = 357.5
> lat1 = -90
> lat2 = 90
> m = Basemap(resolution='c',projection='cyl',llcrnrlon=lon1,llcrnrlat=lat1,\
> urcrnrlon=lon2,urcrnrlat=lat2)
>
> #get data and plot 1st parameter - This works
> filename = "/data/reanal-2/ltm/monthly_ltm_01.nc"
> print filename
> nc = Dataset(filename, mode="r")
> hgt = nc.variables['HGT_2_ISBL_10'][16,:,:]
> print hgt.shape
> lons = nc.variables['longitude'][:]
> lats = nc.variables['latitude'][:]
> x,y = np.meshgrid(lons, lats)
> CS = m.contour(x,y,hgt,15,linewidths=0.5,colors='k')
> CS = m.contourf(x,y,hgt,cmap=plt.cm.jet)
> ###########################
>
> #extract and plot 2nd paramter - This fails with
> # ValueError: Shape mismatch objects cannot be broadcast to a single shape
> filename1 = "/data/nps_datasets/WNA_T2m_200808.nc"
> print filename1
> nc1 = Dataset(filename1, mode="r")
> for var in nc1.variables:
> print var
> t2m = nc1.variables['T2m'][0,:,:]
> print t2m.shape
> lons1 = nc1.variables['lon'][:]
> lats1 = nc1.variables['lat'][:]
> x1,y1 = np.meshgrid(lons1, lats1)
> CS1 = m.contour(x1,y1,t2m,15,linewidths=0.5,colors='k')
> CS1 = m.contourf(x1,y1,t2m,cmap=plt.cm.jet)
> #############################
>
> m.drawcoastlines()
> m.drawmapboundary()
> #m.fillcontinents()
> # draw parallels and meridians.
> parallels = np.arange(-90,90,30)
> #m.drawparallels(parallels,labels=[1,0,0,1])
> m.drawparallels(parallels,labels=[1,0,0,1])
> meridians = np.arange(0,357.5,30)
> m.drawmeridians(meridians,labels=[1,0,0,1])
> plt.title('Plotted Grid')
> plt.show()
>
> ---------------------------------------
> Bruce W. Ford
> Clear Science, Inc.
> br...@cl...
> http://www.ClearScienceInc.com
> http://www.facebook.com/clearscience
> http://www.twitter.com/ROVs_rule
> Phone: (904) 796-8101
> Fax: (904) 379-9704
> 8241 Parkridge Circle N.
> Jacksonville, FL 32211
> Skype: bruce.w.ford
>
>
I would double-check the shapes of x1 and y1 to make sure it matches
t2m's shape. You shouldn't need another Basemap object.
Ben Root
|
|
From: Benjamin R. <ben...@ou...> - 2011-06-07 21:46:11
|
On Saturday, June 4, 2011, Eric Firing <ef...@ha...> wrote: > > > https://github.com/efiring/matplotlib/blob/faq_show_draw/doc/faq/usage_faq.rst > > Eric, Ben, > > See if the section "What is interactive mode" makes sense to you. I have just added it to a feature branch (which includes some other faq madifications, mainly moving the backend section from installation to usage), but have not yet generated a pull request. It doesn't go into every detail, or into the underlying machinery. It is intended to provide just enough understanding to clear up user-level confusion about interactive mode, show, and draw, and let most relatively new users get on with their work. > > Eric > Eric, I see where you are going with this, and this is valuable information to include in the docs. However, the interactive mode and backend info doesn't seem to fit properly with everything else on the page. I am not sure where to put them yet, but I will see if I can take a deeper look tomorrow. I also already noticed some other wording issues in some other parts of that page. Ben Root |
|
From: Eric F. <ef...@ha...> - 2011-06-07 19:48:58
|
On 06/07/2011 01:37 AM, Daniel Mader wrote: > Hi Eric, > > > 2011/6/6 Eric Firing<ef...@ha...>: >> It's not quite clear to me yet, but I assume you want to use a call to >> imshow with a different data set in the second subplot, but have the >> color scale and colorbar be identical to those in the first subplot. Is >> that correct? If so, all you need to do is use the same norm for both >> calls to imshow--that is, define a norm, set the limits you want on it, >> and supply it as a kwarg. > > thanks a lot, you helped me to work around my problem, see code below :) > >> Also, for this sort of comparison, sometimes it is more efficient to use >> a single colorbar for multiple panels, as in this example: >> >> http://matplotlib.sourceforge.net/examples/pylab_examples/multi_image.html > > Very nice example! It's a little too complex for me, though, with all > the calculations for the axes layout -- I prefer subplots :) However, > I think I have found a nice compromise: Attached is a slight modification, much simpler than the example above, but retaining the single colorbar. Alternatively, if you stick with the colorbar for each panel (which is sometimes clearer), it illustrates a slightly clearer way of handling the cmap and norm, explicitly using the same instance of each for both images. Eric > > import pylab > import matplotlib as mpl > > pylab.close('all') > > dat = pylab.array([[1,2,3,4],[5,6,7,8]]) > datT = dat/2 > > fig = pylab.figure() > > ax1 = fig.add_subplot(211) > ax1.set_title('raw data') > im1 = ax1.imshow(dat, interpolation='nearest', > cmap=mpl.cm.get_cmap('rainbow', 20)) > fig.colorbar(im1) > > ax2 = fig.add_subplot(212) > ax2.set_title('leveled') > im2 = ax2.imshow(datT, interpolation='nearest', > cmap=mpl.cm.get_cmap('rainbow', 20)) > ## apply norm: > norm = mpl.colors.Normalize(vmin=dat.min(), vmax=dat.max()) > im2.set_norm(norm) > fig.colorbar(im2) > > ## doesn't really work :/ > cax = fig.add_axes([0.25, 0.04, 0.5, 0.02]) > fig.colorbar(im2, cax, orientation='horizontal') > > pylab.show() > > Thanks a lot, > best regards, > > Daniel |
|
From: Jonno <jon...@gm...> - 2011-06-07 18:51:37
|
I've been looking at the matplotlib wx example here: http://matplotlib.sourceforge.net/examples/user_interfaces/embedding_in_wx5.html I was trying to remove the close buttons from the tabs and from what I can tell they shouldn't be there since the default style isn't supposed to have close buttons. Can anyone help? |
|
From: Daniel M. <dan...@go...> - 2011-06-07 11:37:59
|
Hi Eric, 2011/6/6 Eric Firing <ef...@ha...>: > It's not quite clear to me yet, but I assume you want to use a call to > imshow with a different data set in the second subplot, but have the > color scale and colorbar be identical to those in the first subplot. Is > that correct? If so, all you need to do is use the same norm for both > calls to imshow--that is, define a norm, set the limits you want on it, > and supply it as a kwarg. thanks a lot, you helped me to work around my problem, see code below :) > Also, for this sort of comparison, sometimes it is more efficient to use > a single colorbar for multiple panels, as in this example: > > http://matplotlib.sourceforge.net/examples/pylab_examples/multi_image.html Very nice example! It's a little too complex for me, though, with all the calculations for the axes layout -- I prefer subplots :) However, I think I have found a nice compromise: import pylab import matplotlib as mpl pylab.close('all') dat = pylab.array([[1,2,3,4],[5,6,7,8]]) datT = dat/2 fig = pylab.figure() ax1 = fig.add_subplot(211) ax1.set_title('raw data') im1 = ax1.imshow(dat, interpolation='nearest', cmap=mpl.cm.get_cmap('rainbow', 20)) fig.colorbar(im1) ax2 = fig.add_subplot(212) ax2.set_title('leveled') im2 = ax2.imshow(datT, interpolation='nearest', cmap=mpl.cm.get_cmap('rainbow', 20)) ## apply norm: norm = mpl.colors.Normalize(vmin=dat.min(), vmax=dat.max()) im2.set_norm(norm) fig.colorbar(im2) ## doesn't really work :/ cax = fig.add_axes([0.25, 0.04, 0.5, 0.02]) fig.colorbar(im2, cax, orientation='horizontal') pylab.show() Thanks a lot, best regards, Daniel |
|
From: Scott S. <sco...@gm...> - 2011-06-07 10:20:42
|
On 7 June 2011 11:32, Klonuo Umom <kl...@gm...> wrote: > I have very simple XY graph, and I want to display X grid only, and only > on values of X variable, which are lets say [10, 11, 12, 15, 20] This is a question for the Matplotlib list (https://lists.sourceforge.net/lists/listinfo/matplotlib-users). In any case, this should do what you want: import numpy as np import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) ax.plot(range(5)) ticks = [1.2, 2.3, 3.1, 4] ax.xaxis.set_ticks(ticks) ax.xaxis.grid() plt.show() Cheers, Scott |
|
From: Benjamin R. <ben...@ou...> - 2011-06-07 05:06:57
|
On Monday, June 6, 2011, Bruce Ford <br...@cl...> wrote:
> Does anyone have an example of nested grids.
> I need to (for instance), plot a global grid in filled contours, then plot another, higher resolution grid over the US.The global grid could work something like this, but I'm not sure where to start with the 2nd (nested) grid to go atop.
>
>
> fig=plt.figure()m = Basemap(resolution='c',projection='cyl',llcrnrlon=lon1,llcrnrlat=lat1,\ urcrnrlon=lon2,urcrnrlat=lat2)# make a filled contour plot.
>
> x, y = m(lons, lats)CS = m.contour(x,y,hgt,15,linewidths=0.5,colors='k')CS = m.contourf(x,y,hgt,15,cmap=plt.cm.jet)m.drawcoastlines()m.drawmapboundary()
> m.fillcontinents()
> # draw parallels and meridians.parallels = np.arange(-90,90,10)#m.drawparallels(parallels,labels=[1,0,0,1])m.drawparallels(parallels,labels=[1,0,0,1])meridians = np.arange(-180.,180.,10.)
>
> m.drawmeridians(meridians,labels=[1,0,0,1])plt.title('Plotted Grid')plt.show()
> Thanks!
> Bruce
> ---------------------------------------
> Bruce W. Ford
> Clear Science, Inc.
> br...@cl...
>
>
>
>
>
It should just work as you expect. Do the global contour with the
coarser x/y data, and then do the US contour with finer x/y data.
Ben Root
|