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
|
2
(13) |
3
(5) |
4
(5) |
5
(21) |
6
(10) |
7
(9) |
|
8
(4) |
9
(11) |
10
(9) |
11
(11) |
12
(25) |
13
(5) |
14
(2) |
|
15
(5) |
16
(8) |
17
(16) |
18
(11) |
19
(15) |
20
(5) |
21
(8) |
|
22
(4) |
23
(24) |
24
(9) |
25
(14) |
26
(5) |
27
(28) |
28
(2) |
|
29
(13) |
30
(14) |
31
(11) |
|
|
|
|
|
From: Jason S. <jm...@gm...> - 2012-01-21 17:18:57
|
Please post a binary .dmg or .egg file for matplotlib for OSX 10.6 and Python 2.7. There doesn't appear to be one on the downloads page; the closest I could find for anything under OSX 10.6 was http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99.3/ which only includes Python 2.6 support. |
|
From: Tony Yu <ts...@gm...> - 2012-01-21 17:05:17
|
On Sat, Jan 21, 2012 at 11:31 AM, Gousios George <gg...@wi...>wrote: > ** > Στις 21/01/2012 04:54 μμ, ο/η Tony Yu έγραψε: > > > > On Sat, Jan 21, 2012 at 9:07 AM, Gousios George <gg...@wi...>wrote: > >> Hello , i have the following code in matlab and trying to do it in >> matplotlib. >> >> I have this code in matlab (in a function showGraphs): >> ... >> m = size(myList, 3); >> for k = 1:m >> g = myList(:, :, k); >> image(g + 1) >> axis off >> axis square >> M(k) = getframe; >> end; >> >> and in another file (another function): >> ... >> M = showGraphs(grids) >> movie(M, 1) >> >> >> >> I did so far: >> >> def showGraphs(data): >> data=sc.array([data]) >> n=sc.shape(data)[2] >> for k in range(n): >> mydata=data[:,:,k] >> #plt.imshow(mydata+1) -->> this doesn't work >> >> Also ,in order to do the animation : >> >> grids=...(result from another function) >> result=showGraph(grids) >> fig=plt.figure() >> ani=animation.FuncAnimation(fig,result,interval=30,blit=True) >> plt.show() >> >> Right now the program says "TypeError: 'NoneType' object is not >> callable" (it has errors in the animation call) >> >> What should be my approach to this in order to have the animation? >> >> Thank you! >> >> > You're getting that error because the second argument to FuncAnimation > (`result` in your example) should be a function (not always; see example 2 > linked below). Right now, if your `showGraphs` function is defined in full, > it returns a value of None, which gets saved to `result` (hence the error). > > You should take a look at some of the image animation examples (ex1<http://matplotlib.sourceforge.net/examples/animation/dynamic_image.html>, > ex2<http://matplotlib.sourceforge.net/examples/animation/dynamic_image2.html> > ). > > -Tony > > > I did now : > > > def showGraphs(data): > data=sc.array([data]) > n=sc.shape(data)[2] > ims=[] > > for k in range(n): > mydata=data[:,:,k] > im=plt.imshow(mydata+1) > ims.append([im]) > return ims > > and now it gives me "TypeError: Invalid dimensions for image data. > > Please post short, but executable examples when possible. I'm not sure what your data looks like, but your call to `sc.array` is strange (I'm not sure why you have square brackets, which effectively adds an unnecessary dimension to your data). The code attached below should work. Cheers, -Tony import numpy as np import matplotlib.pyplot as plt from matplotlib.animation import ArtistAnimation fig = plt.figure() def showGraphs(data): data = np.asarray(data) # unnecessary in this example n = np.shape(data)[2] ims = [] #for mydata in np.rollaxis(data, -1): for k in range(n): mydata = data[:, :, k] im = plt.imshow(mydata) ims.append([im]) return ims # 5 frames of a random 20 x 20 image data = np.random.uniform(size=(20, 20, 5)) ims = showGraphs(data) ani = ArtistAnimation(fig, ims) plt.show() |
|
From: Gousios G. <gg...@wi...> - 2012-01-21 16:33:38
|
???? 21/01/2012 04:54 ??, ?/? Tony Yu ??????: > > > On Sat, Jan 21, 2012 at 9:07 AM, Gousios George <gg...@wi... > <mailto:gg...@wi...>> wrote: > > Hello , i have the following code in matlab and trying to do it in > matplotlib. > > I have this code in matlab (in a function showGraphs): > ... > m = size(myList, 3); > for k = 1:m > g = myList(:, :, k); > image(g + 1) > axis off > axis square > M(k) = getframe; > end; > > and in another file (another function): > ... > M = showGraphs(grids) > movie(M, 1) > > > > I did so far: > > def showGraphs(data): > data=sc.array([data]) > n=sc.shape(data)[2] > for k in range(n): > mydata=data[:,:,k] > #plt.imshow(mydata+1) -->> this doesn't work > > Also ,in order to do the animation : > > grids=...(result from another function) > result=showGraph(grids) > fig=plt.figure() > ani=animation.FuncAnimation(fig,result,interval=30,blit=True) > plt.show() > > Right now the program says "TypeError: 'NoneType' object is not > callable" (it has errors in the animation call) > > What should be my approach to this in order to have the animation? > > Thank you! > > > You're getting that error because the second argument to FuncAnimation > (`result` in your example) should be a function (not always; see > example 2 linked below). Right now, if your `showGraphs` function is > defined in full, it returns a value of None, which gets saved to > `result` (hence the error). > > You should take a look at some of the image animation examples (ex1 > <http://matplotlib.sourceforge.net/examples/animation/dynamic_image.html>, > ex2 > <http://matplotlib.sourceforge.net/examples/animation/dynamic_image2.html>). > > -Tony > I did now : def showGraphs(data): data=sc.array([data]) n=sc.shape(data)[2] ims=[] for k in range(n): mydata=data[:,:,k] im=plt.imshow(mydata+1) ims.append([im]) return ims and now it gives me "TypeError: Invalid dimensions for image data. |
|
From: Luke J. <ubu...@go...> - 2012-01-21 15:33:24
|
Hello Paul, Sorry for the late reply I have been away for a couple of days. Thanks for filing the issue, I would very much appreciate it if you manage to track it down. Luke On Tue, Jan 17, 2012 at 1:47 AM, Paul Hobson <pmh...@gm...> wrote: > Luke, > > I don't have an answer to your question, but I can confirm what your > seeing with the attached image. I generated this figure with MPL > 1.1.0, Python 2.7.1, on Windows 7 with ipythonqt and the inline > backend. I filed an issue here: > https://github.com/matplotlib/matplotlib/issues/680. If I find time > tonight, I'll take a stab at tracking this down. > > Thanks, > > -paul > > On Sun, Jan 15, 2012 at 8:17 AM, Luke Jennings > <ubu...@go...> wrote: > > > > Hello > > > > I sent this email just after Christmas and would appreciate it if anyone > has > > any suggestions. I am unsure if I have missed a parameter or should I > file a > > bug? > > > > Thanks > > > > Luke > > > > ---------- Forwarded message ---------- > > From: Luke Jennings <ubu...@go...> > > Date: Mon, Dec 26, 2011 at 8:52 PM > > Subject: Polar graph radial labels > > To: mat...@li... > > > > > > Hello, > > > > I am plotting polar graphs for a university project, the data is > > confidential but I based the work on this > > example > http://matplotlib.sourceforge.net/examples/pylab_examples/polar_demo.html > and fortunately > > the same problem occurs with this. If you take that code and change the > last > > four lines from: > > > > ax.set_rmax(2.0) > > grid(True) > > > > ax.set_title("And there was much rejoicing!", fontsize=20) > > show() > > > > To: > > > > ax.set_rmax(3.01) > > ax.set_rmin(2.91) > > grid(True) > > ax.set_title("And there was much rejoicing!", fontsize=20) > > show() > > > > and then run the script. > > > > The min and max needs to be very tight so that the data I am looking at > can > > be displayed properly. With the tight axis range, the labels end up of to > > the top right, they are just visible on my screen (1920x1080) when the > graph > > is maximised. > > > > After some experimenting the smaller the range between the maximum and > > minimum values the further to the right the labels go. I have not looked > > into the coding of the polar module as my python knowledge is not great, > but > > my guess is that the labels are a set distance from the radial markers. > > > > So my question is how do I move the radial labels back to the correct > > location? > > > > I hope I have not missed the answer in the documentation. I have > installed > > version 1.1.0 of matplotlib and its still a problem in it, thanks for the > > good instructions on how to do it on ubuntu. > > > > I look forward to any help. > > > > Luke > > > > > > > ------------------------------------------------------------------------------ > > RSA(R) Conference 2012 > > Mar 27 - Feb 2 > > Save $400 by Jan. 27 > > Register now! > > http://p.sf.net/sfu/rsa-sfdev2dev2 > > _______________________________________________ > > Matplotlib-users mailing list > > Mat...@li... > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > |
|
From: Tony Yu <ts...@gm...> - 2012-01-21 14:54:44
|
On Sat, Jan 21, 2012 at 9:07 AM, Gousios George <gg...@wi...>wrote: > Hello , i have the following code in matlab and trying to do it in > matplotlib. > > I have this code in matlab (in a function showGraphs): > ... > m = size(myList, 3); > for k = 1:m > g = myList(:, :, k); > image(g + 1) > axis off > axis square > M(k) = getframe; > end; > > and in another file (another function): > ... > M = showGraphs(grids) > movie(M, 1) > > > > I did so far: > > def showGraphs(data): > data=sc.array([data]) > n=sc.shape(data)[2] > for k in range(n): > mydata=data[:,:,k] > #plt.imshow(mydata+1) -->> this doesn't work > > Also ,in order to do the animation : > > grids=...(result from another function) > result=showGraph(grids) > fig=plt.figure() > ani=animation.FuncAnimation(fig,result,interval=30,blit=True) > plt.show() > > Right now the program says "TypeError: 'NoneType' object is not > callable" (it has errors in the animation call) > > What should be my approach to this in order to have the animation? > > Thank you! > > You're getting that error because the second argument to FuncAnimation (`result` in your example) should be a function (not always; see example 2 linked below). Right now, if your `showGraphs` function is defined in full, it returns a value of None, which gets saved to `result` (hence the error). You should take a look at some of the image animation examples (ex1<http://matplotlib.sourceforge.net/examples/animation/dynamic_image.html>, ex2<http://matplotlib.sourceforge.net/examples/animation/dynamic_image2.html> ). -Tony |
|
From: Gousios G. <gg...@wi...> - 2012-01-21 14:19:44
|
Hello , i have the following code in matlab and trying to do it in
matplotlib.
I have this code in matlab (in a function showGraphs):
...
m = size(myList, 3);
for k = 1:m
g = myList(:, :, k);
image(g + 1)
axis off
axis square
M(k) = getframe;
end;
and in another file (another function):
...
M = showGraphs(grids)
movie(M, 1)
I did so far:
def showGraphs(data):
data=sc.array([data])
n=sc.shape(data)[2]
for k in range(n):
mydata=data[:,:,k]
#plt.imshow(mydata+1) -->> this doesn't work
Also ,in order to do the animation :
grids=...(result from another function)
result=showGraph(grids)
fig=plt.figure()
ani=animation.FuncAnimation(fig,result,interval=30,blit=True)
plt.show()
Right now the program says "TypeError: 'NoneType' object is not
callable" (it has errors in the animation call)
What should be my approach to this in order to have the animation?
Thank you!
|
|
From: MQMQ <maq...@ho...> - 2012-01-20 22:31:09
|
Dear all, Could you guys share your experience on: How to adjust the size and scale of the x-y axis of the plot (e.g. how to resize the "0 1 2" on x axis ), Thanks? And special commands in matplotlib? Thank you so much in advanced. MQMQ -- View this message in context: http://old.nabble.com/MQMQ%3A-How-to-adjust-the-size-and-scale-of-the-x-y-axis-of-the-graph.Thanks.-tp33177496p33177496.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Mathew T. <mat...@ed...> - 2012-01-20 14:44:53
|
The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. |
|
From: Jeff W. <jef...@no...> - 2012-01-20 13:23:54
|
On 1/20/12 3:12 AM, Mathew Topper wrote: > Hi Jeff, > > Sorry, an XYZ file is simply an ASCII file which can have either > LON,LAT,HEIGHT entries or Cartesian X,Y,HEIGHT entries. I think I have > confused myself a little here, as all I need to do is print the > LON,LAT,HEIGHT data to a file and I've finished, and basemap is not > required for this. The original question was whether once a basemap > had been defined is there an easy way to extract the Cartesian > coordinates to produce an XYZ file containing the Cartesian > coordinates for the chosen projection rather than the geographic ones? > > Thanks > > Mat > > PS. This is in all in the context of converting data for use in a > software package called MIKE. It sadly lacks the ability to deal with > NetCDF files directly. Mat: If you have the longitudes and latitudes in numpy arrays lons, lats, and m is a Basemap instance, x,y = m(lons,lats) gives you the projection coordinates. -Jeff > > On 19/01/12 16:54, Jeff Whitaker wrote: >> On 1/19/12 5:55 AM, Mathew Topper wrote: >>> Hi, >>> >>> I was wondering how hard it would be to generate xyz format files >>> from netcdf files using python-netcdf4 and basemap? It seems that >>> basemap has the capabilities to do those sort of conversions, but I >>> am a bit of a novice to map data and I'm not sure what would be the >>> correct approach to this. >>> >>> Many Thanks >>> >>> Mat >> Mat: >> >> What's an xyz file? >> >> -Jeff >> -- >> Jeffrey S. Whitaker Phone : (303)497-6313 >> Meteorologist FAX : (303)497-6449 >> NOAA/OAR/PSD R/PSD1 Email :Jef...@no... >> 325 Broadway Office : Skaggs Research Cntr 1D-113 >> Boulder, CO, USA 80303-3328 Web :http://tinyurl.com/5telg > > -- > Dr. Mathew Topper > Institute for Energy Systems > School of Engineering > The University of Edinburgh > Faraday Building > The King’s Buildings > Edinburgh EH9 3JL > Tel: +44 (0)131 650 5570 > School fax: +44 (0)131 650 6554 > mat...@ed... <mailto:mat...@ed...> > http://www.see.ed.ac.uk <http://www.see.ed.ac.uk/> > > > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. |
|
From: Mathew T. <mat...@ed...> - 2012-01-20 10:12:28
|
The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. |
|
From: Michiel de H. <mjl...@ya...> - 2012-01-20 06:12:44
|
The animation code is currently not fully implemented in the MacOSX backend because the way the general framework of animations is set up in Matplotlib (at least last time I checked) is not compatible with drawing on Mac OS X. In particular, the problem is that on Mac OS X all drawing should be done from inside the event loop; the animations code also tries to draw outside of the event loop. Somebody would have to go through the animations code in matplotlib to sort this out. See e.g. this previous thread on the devel mailing list: http://sourceforge.net/mailarchive/forum.php?thread_name=989472.4458.qm%40web62407.mail.re1.yahoo.com&forum_name=matplotlib-devel Best, -Michiel. --- On Sun, 1/15/12, Nathan Salomonis <nsa...@gm...> wrote: From: Nathan Salomonis <nsa...@gm...> Subject: [Matplotlib-users] Animation example error on Mac after installation To: mat...@li... Date: Sunday, January 15, 2012, 2:14 AM Greetings, I just installed matplotlib on my Mac OS 10.6 Machine (64bit) with default Python 2.7.1 (easy_install). While the initial 2D graph examples work great, when testing any of the animations, such as: http://matplotlib.sourceforge.net/examples/animation/simple_anim.html I always get the same error: File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/animation.py", line 248, in _blit_clear a.figure.canvas.restore_region(bg_cache[a]) AttributeError: 'FigureCanvasMac' object has no attribute 'restore_region' Since "restore_region" is only in backend_agg.py and not in backend_macosx.py, After reading more on this, I thought this might be corrected by re-installing from source and setting the setup.cfg to macosx = True and backend = MacOSX prior to building, but this did not correct the issue. Also, changing backend: Agg to backend: MacOSX in: /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc didn't work either. Does anyone have experience with this or further insight? Thanks, Nathan -----Inline Attachment Follows----- ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d -----Inline Attachment Follows----- _______________________________________________ Matplotlib-users mailing list Mat...@li... https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: Jeff W. <jef...@no...> - 2012-01-19 19:39:16
|
On 1/19/12 10:02 AM, Alexis Praga wrote: > Hi, > > Trying the code at > http://matplotlib.sourceforge.net/basemap/doc/html/users/ortho.html , > for zooming in a certain region on a globe, I have found some issues > with the approach provided. > For example, it does not work on the poles. > Here is my suggestion for a zoom with a factor = coef. > > ######################################################################### > > from mpl_toolkits.basemap import Basemap > import numpy as np > import matplotlib.pyplot as plt > > fig = plt.figure() > # global ortho map centered on lon_0,lat_0 > lat_0=90.; lon_0=0. > # resolution = None means don't process the boundary datasets. > m1 = Basemap(projection='ortho',lon_0=lon_0,lat_0=lat_0,resolution=None) > > width = m1.urcrnrx - m1.llcrnrx > height = m1.urcrnry - m1.llcrnry > > coef = 0.5 > width = width*coef > height = height*coef > m = Basemap(projection='ortho',lon_0=lon_0,lat_0=lat_0,resolution='l',\ > llcrnrx=-0.5*width,llcrnry=-0.5*height,urcrnrx=0.5*width,urcrnry=0.5*height) > > m.drawcoastlines() > m.drawcountries() > # draw parallels and meridians. > m.drawparallels(np.arange(-90.,120.,30.)) > m.drawmeridians(np.arange(0.,360.,60.)) > m.drawmapboundary() > plt.show() Alexis: This is now fixed in github master (https://github.com/matplotlib/basemap). -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: Michael R. <raw...@ya...> - 2012-01-19 18:24:42
|
________________________________
From: Benjamin Root <ben...@ou...>
To: Michael Rawlins <raw...@ya...>
Cc: "mat...@li..." <mat...@li...>
Sent: Thursday, January 19, 2012 10:07 AM
Subject: Re: [Matplotlib-users] placing colorbar when using subplot command
On Thursday, January 19, 2012, Michael Rawlins <raw...@ya...> wrote:
>
>
>
> Forum:
>
> Still unable to get a colorbar alongside the panels in this simple example. One last request for assistance. Thanks.
>
> Mike
>
> import sys,getopt
> from mpl_toolkits.basemap import Basemap, shiftgrid, cm
> #from netCDF3 import Dataset as NetCDFFile
> from mpl_toolkits.basemap import NetCDFFile
> from pylab import *
> import matplotlib.pyplot as plt
>
> cmap = cm.get_cmap('jet', 10) # 10 discrete colors
>
> m = Basemap(llcrnrlon=-80.6,llcrnrlat=38.4,urcrnrlon=-66.0,urcrnrlat=47.7,\
> resolution='l',area_thresh=1000.,projection='lcc',\
> lat_1=65.,lon_0=-73.3)
> xtxt=200000. #offset for text
> ytxt=200000.
> parallels = arange(38.,48.,2.)
> meridians = arange(-80.,-64.,2.)
>
> xsize = rcParams['figure.figsize'][0]
> fig=figure(figsize=(xsize,m.aspect*xsize))
>
> ############################################################################################
> subplots_adjust(left=None, bottom=None, right=None, top=None, wspace=0.15, hspace=0.11)
> # Make the first map
> plt.subplot(1,2,1)
>
> # draw coastlines and political boundaries.
> m.drawcoastlines()
> m.drawcountries()
> m.drawstates()
>
> # Here make a colorbar.
> cax = axes([0.88, 0.1, 0.06, 0.81]) # colorbar axes for map w/ graticule
> #colorbar(format='%3.1f', ticks=[-1.5, -1.2, -0.9, -0.6, -0.3, 0.0, 0.3, 0.6, 0.9, 1.2, 1.5], cax=cax)
> #colorbar(cax=cax)
>
> # Make the second map #########################################################################
> plt.subplot(1,2,2)
> # draw coastlines and political boundaries.
> m.drawcoastlines()
> m.drawcountries()
> m.drawstates()
>
> plt.show()
> plt.savefig("map.eps")
> plt.clf() # Clears the figure object
>
> ------------------------------------------------------------------------------
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
>
I recommend upgrading to v1.1.0. There are some PPAs out there that has a more recent version of mpl available as a package. Or you can install from source. Instructions for doing that is in the FAQ.
Ben Root
Have upgraded to v1.2.x. The example above runs fine. Ideally would like to place a colorbar to right of each panel or below each panel or one single colorbar spanning across both maps. Pointers to specific examples or edits to the code much appreciated. Note: basemap is required to run the example.
Mike |
|
From: Moore, E. (NIH/N. [F] <eri...@ni...> - 2012-01-19 18:05:23
|
> -----Original Message----- > From: alw46 [mailto:ama...@gm...] > Sent: Thursday, January 19, 2012 11:31 AM > To: mat...@li... > Subject: [Matplotlib-users] Plotting contour in X-Z plane > > > Hi All, > > I have a question similar to one posted on Aug 30, 2011 titled > "Plotting 2D > contourf in Axes3D X-Z plane instead of X-Y plane". In fact, it is the > same > question, and I can't seem to find a satisfactory answer anywhere. > > I've attached an image of what I've done in the X-Y plane for > reference. > Like the other post, I'd like to do something similar to what I've done > in > the X-Y direction, but in the X-Z and Y-Z planes. Since I've set up a > grid > of points throughout the space, this effectively allows me to take > "section > cuts" in different directions in the space. But I can't seem to figure > out > how to do it. I've switched around the "z-dir", as well as replacing X > and > Y with Z in ax.contourf. For reference, I'm using matplotlib 1.1.0. > > I'm trying to achieve a similar affect to Mayavi's 'image_plane_widget' > to > take volume slices, but using matplotlib. > > http://old.nabble.com/file/p33168965/contours_xy.png > -- > View this message in context: http://old.nabble.com/Plotting-contour- > in-X-Z-plane-tp33168965p33168965.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > I've attached a function that I think does something similar to what you want, although without quite all of the bells and whistles you're looking for. I'm sure there are better ways than just plotting so many lines, but it worked for quickly looking at some data for me. Eric |
|
From: Tony Yu <ts...@gm...> - 2012-01-19 17:23:26
|
On Thu, Jan 19, 2012 at 12:07 PM, Bruno Santos <bac...@gm...> wrote: > Hello everyone, > > I have been using matplotlib 0.99.3 to write some down. But I had to > upgrade my OS and so installed the last version of the library 1.1.0. But > unfortunately when I try to run my code I get the following error: > raise ValueError, 'Path lacks initial MOVETO' > ValueError: Path lacks initial MOVETO > > I have been goggling it and saw some reports about it when using a vector > containing zeros for which I apply a log and then trying to plot this. But > the reports seem to indicate this was fixed in a svn version I can't access > anymore. > Can anyone point me on the correct direction to solve this problem? > > Thank you very much in advance, > Bruno Santos > > Could you provide a bit more information: Are you calling `Path` directly? If not, do you know what in your code is calling it? A minimal, runnable example would be very helpful. Cheers, -Tony |
|
From: Bruno S. <bac...@gm...> - 2012-01-19 17:07:17
|
Hello everyone,
I have been using matplotlib 0.99.3 to write some down. But I had to
upgrade my OS and so installed the last version of the library 1.1.0. But
unfortunately when I try to run my code I get the following error:
raise ValueError, 'Path lacks initial MOVETO'
ValueError: Path lacks initial MOVETO
I have been goggling it and saw some reports about it when using a vector
containing zeros for which I apply a log and then trying to plot this. But
the reports seem to indicate this was fixed in a svn version I can't access
anymore.
Can anyone point me on the correct direction to solve this problem?
Thank you very much in advance,
Bruno Santos
|
|
From: Benjamin R. <ben...@ou...> - 2012-01-19 17:05:37
|
On Thu, Jan 19, 2012 at 10:30 AM, alw46 <ama...@gm...> wrote: > > Hi All, > > I have a question similar to one posted on Aug 30, 2011 titled "Plotting 2D > contourf in Axes3D X-Z plane instead of X-Y plane". In fact, it is the > same > question, and I can't seem to find a satisfactory answer anywhere. > > I've attached an image of what I've done in the X-Y plane for reference. > Like the other post, I'd like to do something similar to what I've done in > the X-Y direction, but in the X-Z and Y-Z planes. Since I've set up a grid > of points throughout the space, this effectively allows me to take "section > cuts" in different directions in the space. But I can't seem to figure out > how to do it. I've switched around the "z-dir", as well as replacing X and > Y with Z in ax.contourf. For reference, I'm using matplotlib 1.1.0. > > I'm trying to achieve a similar affect to Mayavi's 'image_plane_widget' to > take volume slices, but using matplotlib. > > http://old.nabble.com/file/p33168965/contours_xy.png > -- > View this message in context: > http://old.nabble.com/Plotting-contour-in-X-Z-plane-tp33168965p33168965.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > What you want is slightly different from what contourf3d does. Most likely, you have a 3D matrix and what you want is to plot representative 2D slices of that matrix with x, y, and z all being spatial coordinates. What contourf3d does is plots 2D data with x and y being spatial and z being the "intensity" value, not the spatial value. I have an idea of how to do what you want, but I need to test it a bit first. I will get back to you on that. Ben Root |
|
From: Alexis P. <ale...@fr...> - 2012-01-19 17:02:20
|
Hi, Trying the code at http://matplotlib.sourceforge.net/basemap/doc/html/users/ortho.html , for zooming in a certain region on a globe, I have found some issues with the approach provided. For example, it does not work on the poles. Here is my suggestion for a zoom with a factor = coef. ######################################################################### from mpl_toolkits.basemap import Basemap import numpy as np import matplotlib.pyplot as plt fig = plt.figure() # global ortho map centered on lon_0,lat_0 lat_0=90.; lon_0=0. # resolution = None means don't process the boundary datasets. m1 = Basemap(projection='ortho',lon_0=lon_0,lat_0=lat_0,resolution=None) width = m1.urcrnrx - m1.llcrnrx height = m1.urcrnry - m1.llcrnry coef = 0.5 width = width*coef height = height*coef m = Basemap(projection='ortho',lon_0=lon_0,lat_0=lat_0,resolution='l',\ llcrnrx=-0.5*width,llcrnry=-0.5*height,urcrnrx=0.5*width,urcrnry=0.5*height) m.drawcoastlines() m.drawcountries() # draw parallels and meridians. m.drawparallels(np.arange(-90.,120.,30.)) m.drawmeridians(np.arange(0.,360.,60.)) m.drawmapboundary() plt.show() |
|
From: Jeff W. <jef...@no...> - 2012-01-19 16:54:57
|
On 1/19/12 5:55 AM, Mathew Topper wrote: > Hi, > > I was wondering how hard it would be to generate xyz format files from > netcdf files using python-netcdf4 and basemap? It seems that basemap > has the capabilities to do those sort of conversions, but I am a bit > of a novice to map data and I'm not sure what would be the correct > approach to this. > > Many Thanks > > Mat Mat: What's an xyz file? -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: Michael R. <raw...@ya...> - 2012-01-19 16:54:08
|
________________________________ From: Benjamin Root <ben...@ou...> To: Michael Rawlins <raw...@ya...> Cc: "mat...@li..." <mat...@li...> Sent: Thursday, January 19, 2012 10:07 AM Subject: Re: [Matplotlib-users] placing colorbar when using subplot command On Thursday, January 19, 2012, Michael Rawlins <raw...@ya...> wrote: > > > ________________________________ > From: Michael Rawlins <raw...@ya...> > To: Benjamin Root <ben...@ou...> > Cc: "mat...@li..." <mat...@li...> > Sent: Wednesday, January 18, 2012 10:13 AM > Subject: Re: [Matplotlib-users] placing colorbar when using subplot command > > > > ________________________________ > From: Benjamin Root <ben...@ou...> > To: Michael Rawlins <raw...@ya...> > Cc: "mat...@li..." <mat...@li...> > Sent: Tuesday, January 17, 2012 2:02 PM > Subject: Re: [Matplotlib-users] placing colorbar when using subplot command > > > On Tue, Jan 17, 2012 at 12:37 PM, Michael Rawlins <raw...@ya...> wrote: > > > ________________________________ > From: Benjamin Root <ben...@ou...> > To: Michael Rawlins <raw...@ya...> > Cc: "mat...@li..." <mat...@li...> > Sent: Tuesday, January 17, 2012 10:36 AM > Subject: Re: [Matplotlib-users] placing colorbar when using subplot command > > > On Tue, Jan 17, 2012 at 9:30 AM, Michael Rawlins <raw...@ya...> wrote: > > I'm relatively new to matplotlib. Trying to place a colorbar in a figure. The code below, placed in a file and executed with python, draws 4 maps using basemap. I've been unable to get a colorbar to show up anywhere on the figure. Ideally I would like the option of placing a colorbar across the bottom, spanning across both bottom map panels. Also would need the option of placing a colorbar either to the right of or below each map. Uncommenting the two lines under "Here make a colorbar" cause an error. I've used those commands when creating just one map using the figure command. > TIA, > Mike > > > Mike, > > Try using the axes_grid1 toolkit to produce your axes objects and to allocate enough room for colorbars. > > http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/index.html > > Cheers! > Ben Root > > P.S. - a little history, there used to be an axes_grid toolkit, but has since been superseded by axes_grid1. > > > Clicking on source code on that page produces an error. For several of the graphic on that page, dropping the code into a file and running also produces various errors. Being new to this software, having a specific example that I can run and then incorporate into my code would be a big help. > > Mike > > > > Mike, > > I do apologize for that. We will have to get that fixed on the website (not sure why it is happening). I have attached an example file for you to try. Also, which version of matplotlib are you running? Without the error message you are getting, it would be hard to tell you what is wrong (most likely it is a version issue). > > Ben Root > > > > Version 0.99.1.1 installed through Synaptic package manager on system running Ubuntu 10.04. I'd rather not attempt a fresh install from sources just yet. Adding a colorbar alonside each map panel is possible. Anyone able to modify that code to make that work? I'm assuming it very simple for an experienced user. Also, is it possible to add axes_grid1.py to my directory? If I want to get fancy in the future I will install version 1 and use axes_grid1.py. > > Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) > [GCC 4.4.3] on linux2 > Type "help", "copyright", "credits" or "license" for more information. >>>> import matplotlib >>>> matplotlib.__version__ > '0.99.1.1' >>>> > > > > > Forum: > > Still unable to get a colorbar alongside the panels in this simple example. One last request for assistance. Thanks. > > Mike > > import sys,getopt > from mpl_toolkits.basemap import Basemap, shiftgrid, cm > #from netCDF3 import Dataset as NetCDFFile > from mpl_toolkits.basemap import NetCDFFile > from pylab import * > import matplotlib.pyplot as plt > > cmap = cm.get_cmap('jet', 10) # 10 discrete colors > > m = Basemap(llcrnrlon=-80.6,llcrnrlat=38.4,urcrnrlon=-66.0,urcrnrlat=47.7,\ > resolution='l',area_thresh=1000.,projection='lcc',\ > lat_1=65.,lon_0=-73.3) > xtxt=200000. #offset for text > ytxt=200000. > parallels = arange(38.,48.,2.) > meridians = arange(-80.,-64.,2.) > > xsize = rcParams['figure.figsize'][0] > fig=figure(figsize=(xsize,m.aspect*xsize)) > > ############################################################################################ > subplots_adjust(left=None, bottom=None, right=None, top=None, wspace=0.15, hspace=0.11) > # Make the first map > plt.subplot(1,2,1) > > # draw coastlines and political boundaries. > m.drawcoastlines() > m.drawcountries() > m.drawstates() > > # Here make a colorbar. > cax = axes([0.88, 0.1, 0.06, 0.81]) # colorbar axes for map w/ graticule > #colorbar(format='%3.1f', ticks=[-1.5, -1.2, -0.9, -0.6, -0.3, 0.0, 0.3, 0.6, 0.9, 1.2, 1.5], cax=cax) > #colorbar(cax=cax) > > # Make the second map ######################################################################### > plt.subplot(1,2,2) > # draw coastlines and political boundaries. > m.drawcoastlines() > m.drawcountries() > m.drawstates() > > plt.show() > plt.savefig("map.eps") > plt.clf() # Clears the figure object > > > > > > > > > > > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-d2d > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > I recommend upgrading to v1.1.0. There are some PPAs out there that has a more recent version of mpl available as a package. Or you can install from source. Instructions for doing that is in the FAQ. Ben Root Have no experience with PPAs and couldn't find a package. Installing from sources. Following instructions here: http://matplotlib.sourceforge.net/faq/installing_faq.html#installation I removed matplotlib 0.99.1.1 and numpy 1.3.0 using Synaptic. Issued command: sudo apt-get build-dep python-matplotlibto get dependencies. But the setup command return the below to standard output immediately. numpy 1.4 or later is required. How do I install that dependency? > python setup.py install basedirlist is: ['/usr/local', '/usr'] ============================================================================ BUILDING MATPLOTLIB matplotlib: 1.2.x python: 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) [GCC 4.4.3] platform: linux2 REQUIRED DEPENDENCIES * numpy 1.4 or later is required; you have 1.3.0 |
|
From: alw46 <ama...@gm...> - 2012-01-19 16:30:58
|
Hi All, I have a question similar to one posted on Aug 30, 2011 titled "Plotting 2D contourf in Axes3D X-Z plane instead of X-Y plane". In fact, it is the same question, and I can't seem to find a satisfactory answer anywhere. I've attached an image of what I've done in the X-Y plane for reference. Like the other post, I'd like to do something similar to what I've done in the X-Y direction, but in the X-Z and Y-Z planes. Since I've set up a grid of points throughout the space, this effectively allows me to take "section cuts" in different directions in the space. But I can't seem to figure out how to do it. I've switched around the "z-dir", as well as replacing X and Y with Z in ax.contourf. For reference, I'm using matplotlib 1.1.0. I'm trying to achieve a similar affect to Mayavi's 'image_plane_widget' to take volume slices, but using matplotlib. http://old.nabble.com/file/p33168965/contours_xy.png -- View this message in context: http://old.nabble.com/Plotting-contour-in-X-Z-plane-tp33168965p33168965.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Benjamin R. <ben...@ou...> - 2012-01-19 15:08:07
|
On Thursday, January 19, 2012, Michael Rawlins <raw...@ya...> wrote: > > > ________________________________ > From: Michael Rawlins <raw...@ya...> > To: Benjamin Root <ben...@ou...> > Cc: "mat...@li..." < mat...@li...> > Sent: Wednesday, January 18, 2012 10:13 AM > Subject: Re: [Matplotlib-users] placing colorbar when using subplot command > > > > ________________________________ > From: Benjamin Root <ben...@ou...> > To: Michael Rawlins <raw...@ya...> > Cc: "mat...@li..." < mat...@li...> > Sent: Tuesday, January 17, 2012 2:02 PM > Subject: Re: [Matplotlib-users] placing colorbar when using subplot command > > > On Tue, Jan 17, 2012 at 12:37 PM, Michael Rawlins <raw...@ya...> wrote: > > > ________________________________ > From: Benjamin Root <ben...@ou...> > To: Michael Rawlins <raw...@ya...> > Cc: "mat...@li..." < mat...@li...> > Sent: Tuesday, January 17, 2012 10:36 AM > Subject: Re: [Matplotlib-users] placing colorbar when using subplot command > > > On Tue, Jan 17, 2012 at 9:30 AM, Michael Rawlins <raw...@ya...> wrote: > > I'm relatively new to matplotlib. Trying to place a colorbar in a figure. The code below, placed in a file and executed with python, draws 4 maps using basemap. I've been unable to get a colorbar to show up anywhere on the figure. Ideally I would like the option of placing a colorbar across the bottom, spanning across both bottom map panels. Also would need the option of placing a colorbar either to the right of or below each map. Uncommenting the two lines under "Here make a colorbar" cause an error. I've used those commands when creating just one map using the figure command. > TIA, > Mike > > > Mike, > > Try using the axes_grid1 toolkit to produce your axes objects and to allocate enough room for colorbars. > > http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/index.html > > Cheers! > Ben Root > > P.S. - a little history, there used to be an axes_grid toolkit, but has since been superseded by axes_grid1. > > > Clicking on source code on that page produces an error. For several of the graphic on that page, dropping the code into a file and running also produces various errors. Being new to this software, having a specific example that I can run and then incorporate into my code would be a big help. > > Mike > > > > Mike, > > I do apologize for that. We will have to get that fixed on the website (not sure why it is happening). I have attached an example file for you to try. Also, which version of matplotlib are you running? Without the error message you are getting, it would be hard to tell you what is wrong (most likely it is a version issue). > > Ben Root > > > > Version 0.99.1.1 installed through Synaptic package manager on system running Ubuntu 10.04. I'd rather not attempt a fresh install from sources just yet. Adding a colorbar alonside each map panel is possible. Anyone able to modify that code to make that work? I'm assuming it very simple for an experienced user. Also, is it possible to add axes_grid1.py to my directory? If I want to get fancy in the future I will install version 1 and use axes_grid1.py. > > Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) > [GCC 4.4.3] on linux2 > Type "help", "copyright", "credits" or "license" for more information. >>>> import matplotlib >>>> matplotlib.__version__ > '0.99.1.1' >>>> > > > > > Forum: > > Still unable to get a colorbar alongside the panels in this simple example. One last request for assistance. Thanks. > > Mike > > import sys,getopt > from mpl_toolkits.basemap import Basemap, shiftgrid, cm > #from netCDF3 import Dataset as NetCDFFile > from mpl_toolkits.basemap import NetCDFFile > from pylab import * > import matplotlib.pyplot as plt > > cmap = cm.get_cmap('jet', 10) # 10 discrete colors > > m = Basemap(llcrnrlon=-80.6,llcrnrlat=38.4,urcrnrlon=-66.0,urcrnrlat=47.7,\ > resolution='l',area_thresh=1000.,projection='lcc',\ > lat_1=65.,lon_0=-73.3) > xtxt=200000. #offset for text > ytxt=200000. > parallels = arange(38.,48.,2.) > meridians = arange(-80.,-64.,2.) > > xsize = rcParams['figure.figsize'][0] > fig=figure(figsize=(xsize,m.aspect*xsize)) > > ############################################################################################ > subplots_adjust(left=None, bottom=None, right=None, top=None, wspace=0.15, hspace=0.11) > # Make the first map > plt.subplot(1,2,1) > > # draw coastlines and political boundaries. > m.drawcoastlines() > m.drawcountries() > m.drawstates() > > # Here make a colorbar. > cax = axes([0.88, 0.1, 0.06, 0.81]) # colorbar axes for map w/ graticule > #colorbar(format='%3.1f', ticks=[-1.5, -1.2, -0.9, -0.6, -0.3, 0.0, 0.3, 0.6, 0.9, 1.2, 1.5], cax=cax) > #colorbar(cax=cax) > > # Make the second map ######################################################################### > plt.subplot(1,2,2) > # draw coastlines and political boundaries. > m.drawcoastlines() > m.drawcountries() > m.drawstates() > > plt.show() > plt.savefig("map.eps") > plt.clf() # Clears the figure object > > > > > > > > > > > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-d2d > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > I recommend upgrading to v1.1.0. There are some PPAs out there that has a more recent version of mpl available as a package. Or you can install from source. Instructions for doing that is in the FAQ. Ben Root |
|
From: Michael R. <raw...@ya...> - 2012-01-19 14:59:51
|
________________________________ From: Michael Rawlins <raw...@ya...> To: Benjamin Root <ben...@ou...> Cc: "mat...@li..." <mat...@li...> Sent: Wednesday, January 18, 2012 10:13 AM Subject: Re: [Matplotlib-users] placing colorbar when using subplot command ________________________________ From: Benjamin Root <ben...@ou...> To: Michael Rawlins <raw...@ya...> Cc: "mat...@li..." <mat...@li...> Sent: Tuesday, January 17, 2012 2:02 PM Subject: Re: [Matplotlib-users] placing colorbar when using subplot command On Tue, Jan 17, 2012 at 12:37 PM, Michael Rawlins <raw...@ya...> wrote: > > > > >________________________________ > From: Benjamin Root <ben...@ou...> >To: Michael Rawlins <raw...@ya...> >Cc: "mat...@li..." <mat...@li...> >Sent: Tuesday, January 17, 2012 10:36 AM >Subject: Re: [Matplotlib-users] placing colorbar when using subplot command > > > > >On Tue, Jan 17, 2012 at 9:30 AM, Michael Rawlins <raw...@ya...> wrote: > > >> >>I'm relatively new to matplotlib. Trying to place a colorbar in a figure. The code below, placed in a file and executed with python, draws 4 maps using basemap. I've been unable to get a colorbar to show up anywhere on the figure. Ideally I would like the option of placing a colorbar across the bottom, spanning across both bottom map panels. Also would need the option of placing a colorbar either to the right of or below each map. Uncommenting the two lines under "Here make a colorbar" cause an error. I've used those commands when creating just one map using the figure command. >> >> >>TIA, >>Mike >> >> >> >> > >Mike, > >Try using the axes_grid1 toolkit to produce your axes objects and to allocate enough room for colorbars. > >http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/index.html > >Cheers! >Ben Root > >P.S. - a little history, there used to be an axes_grid toolkit, but has since been superseded by axes_grid1. > > >Clicking on source code on that page produces an error. For several of the graphic on that page, dropping the code into a file and running also produces various errors. Being new to this software, having a specific example that I can run and then incorporate into my code would be a big help. > >Mike > > > Mike, I do apologize for that. We will have to get that fixed on the website (not sure why it is happening). I have attached an example file for you to try. Also, which version of matplotlib are you running? Without the error message you are getting, it would be hard to tell you what is wrong (most likely it is a version issue). Ben Root Version 0.99.1.1 installed through Synaptic package manager on system running Ubuntu 10.04. I'd rather not attempt a fresh install from sources just yet. Adding a colorbar alonside each map panel is possible. Anyone able to modify that code to make that work? I'm assuming it very simple for an experienced user. Also, is it possible to add axes_grid1.py to my directory? If I want to get fancy in the future I will install version 1 and use axes_grid1.py. Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import matplotlib >>> matplotlib.__version__ '0.99.1.1' >>> Forum: Still unable to get a colorbar alongside the panels in this simple example. One last request for assistance. Thanks. Mike import sys,getopt from mpl_toolkits.basemap import Basemap, shiftgrid, cm #from netCDF3 import Dataset as NetCDFFile from mpl_toolkits.basemap import NetCDFFile from pylab import * import matplotlib.pyplot as plt cmap = cm.get_cmap('jet', 10) # 10 discrete colors m = Basemap(llcrnrlon=-80.6,llcrnrlat=38.4,urcrnrlon=-66.0,urcrnrlat=47.7,\ resolution='l',area_thresh=1000.,projection='lcc',\ lat_1=65.,lon_0=-73.3) xtxt=200000. #offset for text ytxt=200000. parallels = arange(38.,48.,2.) meridians = arange(-80.,-64.,2.) xsize = rcParams['figure.figsize'][0] fig=figure(figsize=(xsize,m.aspect*xsize)) ############################################################################################ subplots_adjust(left=None, bottom=None, right=None, top=None, wspace=0.15, hspace=0.11) # Make the first map plt.subplot(1,2,1) # draw coastlines and political boundaries. m.drawcoastlines() m.drawcountries() m.drawstates() # Here make a colorbar. cax = axes([0.88, 0.1, 0.06, 0.81]) # colorbar axes for map w/ graticule #colorbar(format='%3.1f', ticks=[-1.5, -1.2, -0.9, -0.6, -0.3, 0.0, 0.3, 0.6, 0.9, 1.2, 1.5], cax=cax) #colorbar(cax=cax) # Make the second map ######################################################################### plt.subplot(1,2,2) # draw coastlines and political boundaries. m.drawcoastlines() m.drawcountries() m.drawstates() plt.show() plt.savefig("map.eps") plt.clf() # Clears the figure object ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ Matplotlib-users mailing list Mat...@li... https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: Tony Yu <ts...@gm...> - 2012-01-19 14:58:39
|
On Thu, Jan 19, 2012 at 12:44 AM, Paul Ivanov <piv...@gm...> wrote: > Hi David, > > David Perlman, on 2012-01-06 16:57, wrote: > > Am I doing this wrong? I am doing the best I can to follow the > > documentation exactly. > > It doesn't look like you're doing it wrong - and your example > works for me, though I'm not running OS X and can't verify that > it works as it should on your chosen backend. > > Can anyone else who has OS X verify David's error? David, it'd be > useful to know what your matplotlib.__version__ is, as well as > whether or not the error occurs on the latest version, if that's > possible. > > best, > -- > Paul Ivanov > 314 address only used for lists, off-list direct email at: > http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 > It seems to be version-specific. Works on my system (github HEAD). -Tony |
|
From: Mathew T. <mat...@ed...> - 2012-01-19 12:55:44
|
The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. |