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: 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. |
|
From: Paul I. <piv...@gm...> - 2012-01-19 05:44:22
|
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 |