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) |
2
(4) |
3
(16) |
4
(4) |
5
(15) |
6
(16) |
7
(6) |
8
(4) |
9
(9) |
10
(5) |
11
(8) |
12
(14) |
13
(19) |
14
(21) |
15
(8) |
16
(6) |
17
(10) |
18
(22) |
19
(15) |
20
(7) |
21
(21) |
22
(1) |
23
(6) |
24
(16) |
25
(12) |
26
(11) |
27
(27) |
28
(7) |
29
|
30
(4) |
31
(5) |
|
|
|
|
|
(warning, this may not be directly a matplotlib question, but I thought that someone may have run across this) I have a colleague with a macbook pro, and I was showing him matplotlib. Downloaded an example from the gallery, and ran it. No windows showed up, but we did get the little bouncing "python rocket" on the dock. Clicking the rocket showed us the plot window, and everything was fine. But does anyone know why the plot window just doesn't show up directly? So, every time he runs his script to generate a result and a plot, he has to go click the rocket to be able to see anything. I have a mac at home, and it doesn't do this as far as I know. Using the python.org 2.6.6, all paths set correctly, and matplotlib 1.0.0; both installed from appropriate dmg's from the respective web sites. It was just weird, and I thought maybe someone else had run into the same thing. -- Daniel Hyams dh...@gm...
----- Original Message ---- From: Friedrich Romstedt <fri...@gm...> To: Lou Pecora <lou...@ya...> Cc: mat...@li... Sent: Tue, January 25, 2011 7:40:23 AM Subject: Re: [Matplotlib-users] How to get a Mac OS X version of Tcl/Tk rather than X11 version. 2011年1月24日 Lou Pecora <lou...@ya...>: > I have an installation of Python 2.6.4 on my MacBook Pro (OS X 10.6) that by > default uses X11 windows and dialogs rather than the Mac version of those GUI > items. In my googling and exchanges on other support groups I've come down to > the problem may be with the Tcl/Tk installation using the "generic" X11 GUI > rather than the Mac version. Does anyone know how I can change that in the Tk > part of the python framework? > > I think this problem came up in the iPython email list, but I didn't get enough > info from the messages there. > > More Info: The python framework is part of the SAGE package which I installed > from source. I did this on my Mac Pro (system 10.4) and it works well with Mac > windows for matplotlib and Mac open/save dialogs for Tk calls. But on my > MacBook Pro I get X11 windows and dialogs. I want the Mac versions. > > Even more info: > > If you're interested, here's the original message I put up on the SAGE support > group and was told it's a problem with the type of Tcl/Tk installed. > > -- Lou Pecora [cut] I have a self-compiled Python 2.6.5 on Mac OS X 10.6.6, with self-compiled matplotlib. It shouldn't matter if mpl is self-compiled or not, since the TkAgg backend just uses the Python Tkinter module. mpl uses some blitter extension, but this shouldn't matter here too. I don't have Sage installed, and I know little about Sage. My Tkinter widgets, irrespective of mpl or not, have the Aqua look-and-feel. I know that, using the binary distribution package of Python 2.x I used before, I got *not real* Aqua look-and-feel, but it wasn't either X11 iirc (i.e. no X11 spawned; assumed that spawning X11 implies that is shows up in the Dock). With that binary, text boxes did not have Aqua boundaries, but I do not remember precisely how buttons looked like. Save dialogs were also not as you might want them to have; with the self-compiled Python, they are like in any other Mac app. I remeber vaguely that the Python binary Mac OS X packages are compiled agains an older Tcl/Tk, for support of Mac OS X 10.4. Anyway, all this is long ago. I tried this on my system: n0877:lib-dynload Friedrich$ pwd /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload n0877:lib-dynload Friedrich$ otool -L _tkinter.so _tkinter.so: /System/Library/Frameworks/Tcl.framework/Versions/8.5/Tcl (compatibility version 8.5.0, current version 8.5.7) /System/Library/Frameworks/Tk.framework/Versions/8.5/Tk (compatibility version 8.5.0, current version 8.5.7) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 438.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0) It tells you what Tcl/Tk frameworks the Tkinter binary module is linked against. Be warned that compiling mpl on Mac OS X 10.6 is a bit cumbersome due to compiler issues. Friedrich ------------------------------------------------------ Hi, Friedrich, You have given me the key to the solution to my problem. Thank you. The problem was that I had separate Tcl and Tk Frameworks installed and SAGE was using those. The solution is to remove those and re-build SAGE which then is smart enough to use the Apple supplied Tcl and Tk Frameworks. That gives what looks like the Aqua interface. However, it does not add in the Default Folder add-on that I have for open and save dialogs. But I can live without that. The X11 interface is gone. Below are instructions for others who might have this problem. Thanks, again. I ran your otool command on my Apple python installation down in /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload and got this output: _tkinter.so: /System/Library/Frameworks/Tcl.framework/Versions/8.5/Tcl (compatibility version 8.5.0, current version 8.5.7) /System/Library/Frameworks/Tk.framework/Versions/8.5/Tk (compatibility version 8.5.0, current version 8.5.7) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0) So my Apple python is under /System not /Library like yours. When I go to the SAGE folder and run otool on its lib-dynload folder I got _tkinter.so: /Library/Frameworks/Tcl.framework/Versions/8.5/Tcl (compatibility version 8.5.0, current version 8.5.9) /Library/Frameworks/Tk.framework/Versions/8.5/Tk (compatibility version 8.5.0, current version 8.5.9) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.1) Note, these frameworks are down in the /Library folder which shows SAGE is building the Tk library on the Tcl and Tk frameworks I had installed earlier, not on the Apple versions down in /System folder. These solution is to remove the /Library Tcl and Tk frameworks and re-install SAGE. The only problem for some people might be that they might have built other things bases on the non-Apple Tcl and Tk frameworks. -- Lou Pecora
Hi Eric, You solved my problem; I called axis after the call to plot and the min-max obeyed my explicit definition. The version of matplotlib that I am running is "python-matplotlib - 0.99.0-1ubuntu1 (amd64)". Sorry for the incomplete code snippet that I submitted with my initial request. In the future I will submit working code. Thank you for your swift response and thanks to all the matplotlib developers. Sincerely, Lee > On 01/24/2011 02:49 PM, Lionel (Lee) Brooks 3rd wrote: >> > Hello Gentlepeople, >> > >> > I am plotting an integer array using: matplotlib.pyplot.plot(). >> > For my purposes it is imperative that the x-axis be explicitly defined. >> > I have tried to achieve this by using: matplotlib.pyplot.axis(v). >> > Where v is a list of integer values corresponding to the desired axes >> > limits [xmin, xmax, ymin, ymax]. >> > However, the x-axis that is displayed does not obey my explicit xmax >> > declaration; the value is rounded up. >> > > > > I am not seeing the problem when I try what I think is a minimal > example; what version of mpl are you using? And have you tried calling > axis after the call to plot? This might have been necessary in some > earlier versions; I don't recall. > > (In ipython -pylab, my example was this: > > ax1 = gca() > ax1.axis([0,9.9,0,9.9]) > ax1.plot([1,2]) > draw() > > in which no rounding occurs.) > >
I recently bought a new Macbook Air, with OS X 10.6. I started using a new package manager called homebrew (http://mxcl.github.com/homebrew/) which is simple, clean, and git-based. I find it incredibly easy to use, and my numpy/scipy/mpl stack (using repo MPL) installed very smoothly. The package will build everything from scratch, and it builds python2.7 for you. Here is what I did on my new computer. (NOTE: I had some trouble replicating this on an older computer, but eventually got it working. If this doesn't work for you, let me know, and I'll give you info on the other install I did with homebrew.) brew install python brew install pip # install gfortran from here: # http://r.research.att.com/tools/ brew install fftw brew install suite-sparse # based on: http://mail.scipy.org/pipermail/numpy-discussion/2010-August/052227.html # download numpy 1.5.1 # download scipy 0.8.0 # tarballs # set the following environment vars: export MACOSX_DEPLOYMENT_TARGET=10.6 export CFLAGS="-arch i386 -arch x86_64" export FFLAGS="-m32 -m64" export LDFLAGS="-Wall -undefined dynamic_lookup -bundle -arch i386 -arch x86_64 -framework Accelerate" # in numpy directory: python setup.py build --fcompiler=gnu95 python setup.py install # in scipy directory: python setup.py build --fcompiler=gnu95 sudo python setup.py install # fresh shell pip install ipython Uri ................................................................................... Uri Laserson Graduate Student, Biomedical Engineering Harvard-MIT Division of Health Sciences and Technology M +1 917 742 8019 las...@mi... On Tue, Jan 25, 2011 at 05:09, Peter Smale <pet...@gm...> wrote: > Hi, > I am using Matplotlib with python 2.6 on a MacBook Pro (Mac OS X 10.6): > > Darwin Peters-MacBook-Pro.local 10.6.0 Darwin Kernel Version 10.6.0: Wed > Nov 10 18:13:17 PST 2010; root:xnu-1504年9月26日~3/RELEASE_I386 i386 > > I had a hard job getting matplotlib going, but eventually managed it using > an easy_install script that installed scipy and numpy as well. Matplotlib > would not work with the EPD distribution on my machine. I also tried > installing python 2.7 on my mac and working with that but it didn't work > either. So I deleted all (I hope) the python stuff I had tried to get going, > including environment variables, keeping just the default python 2.6 that > comes with Mac OS X 10.6. Now matplotlib works just fine. > > But now when I run port selfupdate and then port -v upgrade outdated i get > the following error: > > ... > ---> Activating python26 @2.6.6_1 > Error: Target org.macports.activate returned: Image error: > /opt/local/bin/python2.6 already exists and does not belong to a registered > port. Unable to activate port python26. Use 'port -f activate python26' to > force the activation. > Error: Failed to install python26 > Log for python26 is at: > /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_python26/main.log > Error: The following dependencies were not installed: python26 > Error: Unable to upgrade port: 1 > To report a bug, see <http://guide.macports.org/#project.tickets> > > I wonder if this is due to an old failed install that I tried with > macports. > My question is: can I force this activation and know that my matplotlib etc > will still work? > If this is nothing to do with updating the shipped python, how can I stop > macports trying to upgrade python 2.6? > > I really don't want to do anything that will break my lovely matplotlib > again. > > This might be more of a macports question, but I'm interested to hear of > others' experiences with matplotlib on mac OS X 10.6 anyway. > > Cheers, > Peter > > ------------------------------------------------------------------------------ > Special Offer-- Download ArcSight Logger for FREE (a 49ドル USD value)! > Finally, a world-class log management solution at an even better > price-free! > Download using promo code Free_Logger_4_Dev2Dev. Offer expires > February 28th, so secure your free ArcSight Logger TODAY! > http://p.sf.net/sfu/arcsight-sfd2d > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
I think this was a bug in the PSD function in matplotlib 0.98.1 (Debian lenny). This was making me crazy. I took newer source code of this function from the project and all is going well. So to get the RMS power from PSD : y, x = pylab.psd(data, NFFT = nfft, Fs = samplerate) freqbandwith = x[1] y = y*freqbandwith rms = scipy.sqrt(y.sum()) It should be the same as : rms = data**2 rms = scipy.sqrt(rms.sum()/len(data))
2011年1月24日 Lou Pecora <lou...@ya...>: > I have an installation of Python 2.6.4 on my MacBook Pro (OS X 10.6) that by > default uses X11 windows and dialogs rather than the Mac version of those GUI > items. In my googling and exchanges on other support groups I've come down to > the problem may be with the Tcl/Tk installation using the "generic" X11 GUI > rather than the Mac version. Does anyone know how I can change that in the Tk > part of the python framework? > > I think this problem came up in the iPython email list, but I didn't get enough > info from the messages there. > > More Info: The python framework is part of the SAGE package which I installed > from source. I did this on my Mac Pro (system 10.4) and it works well with Mac > windows for matplotlib and Mac open/save dialogs for Tk calls. But on my > MacBook Pro I get X11 windows and dialogs. I want the Mac versions. > > Even more info: > > If you're interested, here's the original message I put up on the SAGE support > group and was told it's a problem with the type of Tcl/Tk installed. > > -- Lou Pecora > > ----------------------------------------------------------------------------- > > I have an installation of SAGE (from source) on my Mac laptop in which using the > tcl/tk library to plot (using TKAgg backend) or call tk file open/save dialogs > calls the X11 versions and not the native Mac versions of dialogs and windows. > I want to get the Mac versions. > > I posted about this on this list recently and now after a response here and much > googling I have the sense that the problem is that I have a SAGE package with an > X11 version of the tk library rather than the Mac one. I compiled SAGE from > source on my Mac laptop. That went perfectly. I don't know how I got the X11 > version since I also compiled SAGE from source on my Mac desktop where the > plotting and file dialogs are the correct Mac versions, not X11. The only > difference is that the laptop is Mac OS X 10.6 and the desktop is 10.4. If that > matters, I don't know. > > Does anyone know how to get the Mac version installed in the SAGE source-compile > installation? I have not found an answer to this elsewhere. I'm hoping someone > here knows how this is done with the source installation. I have a self-compiled Python 2.6.5 on Mac OS X 10.6.6, with self-compiled matplotlib. It shouldn't matter if mpl is self-compiled or not, since the TkAgg backend just uses the Python Tkinter module. mpl uses some blitter extension, but this shouldn't matter here too. I don't have Sage installed, and I know little about Sage. My Tkinter widgets, irrespective of mpl or not, have the Aqua look-and-feel. I know that, using the binary distribution package of Python 2.x I used before, I got *not real* Aqua look-and-feel, but it wasn't either X11 iirc (i.e. no X11 spawned; assumed that spawning X11 implies that is shows up in the Dock). With that binary, text boxes did not have Aqua boundaries, but I do not remember precisely how buttons looked like. Save dialogs were also not as you might want them to have; with the self-compiled Python, they are like in any other Mac app. I remeber vaguely that the Python binary Mac OS X packages are compiled agains an older Tcl/Tk, for support of Mac OS X 10.4. Anyway, all this is long ago. I tried this on my system: n0877:lib-dynload Friedrich$ pwd /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload n0877:lib-dynload Friedrich$ otool -L _tkinter.so _tkinter.so: /System/Library/Frameworks/Tcl.framework/Versions/8.5/Tcl (compatibility version 8.5.0, current version 8.5.7) /System/Library/Frameworks/Tk.framework/Versions/8.5/Tk (compatibility version 8.5.0, current version 8.5.7) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 438.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0) It tells you what Tcl/Tk frameworks the Tkinter binary module is linked against. Be warned that compiling mpl on Mac OS X 10.6 is a bit cumbersome due to compiler issues. Friedrich
On Tue, Jan 25, 2011 at 10:43 AM, Russell Hewett <rhe...@il...> wrote: > Though, the top and right side are technically on the outside too. Perhaps > that should be an available or the default setting? Perhaps the top row > should default to labeling on the top, the right column default to labeling > on the right, etc? > As the mode name "L" implies, it means "left" and "bottom" side (of the whole grid). Maybe we can have an "outer" mode. Any contribution will be welcomed. Regards, -JJ
> On Thursday, January 20, 2011, Jeff Whitaker <js...@fa...> wrote: >> On 1/20/11 2:31 PM, R. Mitra wrote: >>> Hi >>> ? ? ?I have a set of records with known lat long. ?I want to show the >>> concentration of the records with a contour diagram on a world map in >>> any projection. It cannot spill over to the oceans. I know I have to >>> use basemap. ?Is there a quick recipe somewhere I can follow to give >>> me a desired output. ?I have gone through earlier posts on this board >>> but cannot find the right one. ?Any pointers would be very helpful. >>> Many thanks. >>> Best >>> Mitra >> >> >> Mitra: ?The basic procedure is this: >> >> 1) load you data into 2d numpy arrays (lats, lons, data). ?lats and lons >> must be in degrees (not radians). >> 2) create a Basemap instance (called "map") for the desired projection. >> 3) calculate the map projection coordinates of your grid with x,y = >> map(lons,lats) >> 4) contour your data with the contourf method (map.contourf). >> 5) draw coastlines with the coastlines method. >> 6) draw lat/lon lines with the drawparallels and drawmeridians methods. >> >> There are many examples of this in the basemap examples directory. >> >> -Jeff >> > >In order to contour, you will need some sort z-value to contour. This >means you need to bin your data. You could use numpy's hist2d, or (I >prefer) matplotlib's hexbin(). > >I hope that helps! >Ben Root Hi, its been a while but it might help to make Ben's description more specific w.r.t. binning the data to obtain a z-value array of suitable dimension from irregular data. Starting point are the following variables: gmax, gmay: lists (or arrays) of irregular data point coordinates (possibly already in the desired projection) gmaVal: list of respective z-values. The following snippet creates a contour line plot with interpolating colours between the contour lines: SNIPPET: xi = numpy.linspace(min(gmax),max(gmax),500) yi = numpy.linspace(min(gmay),max(gmay),500) zi = griddata(gmax,gmay,gmaVal,xi,yi,interp='nn') CS = pyplot.contour (xi,yi,zi,15,colors='grey',linewidths=0.1) CS = pyplot.contourf(xi,yi,zi,15,cmap=cm.get_cmap("jet")) The number 500 is arbitrary and should suit your desired resolution. Look up the function "griddata" in: from matplotlib.mlab import griddata for which you quickly find descriptions in the web under the key words "irregularly spaced data". This is a topic in itself. In most (non-pathologic) cases it probably makes no differerence whether interpolating in projected coords or in lon-lat. Regards Daniel
Hi, I am using Matplotlib with python 2.6 on a MacBook Pro (Mac OS X 10.6): Darwin Peters-MacBook-Pro.local 10.6.0 Darwin Kernel Version 10.6.0: Wed Nov 10 18:13:17 PST 2010; root:xnu-1504年9月26日~3/RELEASE_I386 i386 I had a hard job getting matplotlib going, but eventually managed it using an easy_install script that installed scipy and numpy as well. Matplotlib would not work with the EPD distribution on my machine. I also tried installing python 2.7 on my mac and working with that but it didn't work either. So I deleted all (I hope) the python stuff I had tried to get going, including environment variables, keeping just the default python 2.6 that comes with Mac OS X 10.6. Now matplotlib works just fine. But now when I run port selfupdate and then port -v upgrade outdated i get the following error: ... ---> Activating python26 @2.6.6_1 Error: Target org.macports.activate returned: Image error: /opt/local/bin/python2.6 already exists and does not belong to a registered port. Unable to activate port python26. Use 'port -f activate python26' to force the activation. Error: Failed to install python26 Log for python26 is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_python26/main.log Error: The following dependencies were not installed: python26 Error: Unable to upgrade port: 1 To report a bug, see <http://guide.macports.org/#project.tickets> I wonder if this is due to an old failed install that I tried with macports. My question is: can I force this activation and know that my matplotlib etc will still work? If this is nothing to do with updating the shipped python, how can I stop macports trying to upgrade python 2.6? I really don't want to do anything that will break my lovely matplotlib again. This might be more of a macports question, but I'm interested to hear of others' experiences with matplotlib on mac OS X 10.6 anyway. Cheers, Peter
On 01/24/2011 02:49 PM, Lionel (Lee) Brooks 3rd wrote: > Hello Gentlepeople, > > I am plotting an integer array using: matplotlib.pyplot.plot(). > For my purposes it is imperative that the x-axis be explicitly defined. > I have tried to achieve this by using: matplotlib.pyplot.axis(v). > Where v is a list of integer values corresponding to the desired axes > limits [xmin, xmax, ymin, ymax]. > However, the x-axis that is displayed does not obey my explicit xmax > declaration; the value is rounded up. > > Here is the relevant portion of my code: It is always better to provide a minimal but complete self-contained example illustrating the problem. > > fig = pyplot.figure(figsize=(16,8)) > ax1 = fig.add_axes([0.05, 0.15, 0.9, 0.8]) > v = [0, len(myintvector), 0, max(myintvector, key=int)] > ax1.axis(v) > ax1.plot(myintvector, 'r--') I am not seeing the problem when I try what I think is a minimal example; what version of mpl are you using? And have you tried calling axis after the call to plot? This might have been necessary in some earlier versions; I don't recall. (In ipython -pylab, my example was this: ax1 = gca() ax1.axis([0,9.9,0,9.9]) ax1.plot([1,2]) draw() in which no rounding occurs.) Eric > > The reason that I need the x-axis to match the length of my integer > vector is because I am also drawing a colorbar immediately below the > plot, the values of which describe the same integer vector. Therefore I > need the colorbar coordinates to match the x-axis coordinates of my plot. > > I hope that I have described my issue coherently. Please be kind (N00b > alert). > Any help is greatly appreciated! > > Sincerely, > Lionel 'Lee' Brooks 3rd > Dartmouth Genetics Grad Student
This is indeed correct. Somehow I missed this. Setting label_mode = 'all' gets the behavior I wanted. Though, the top and right side are technically on the outside too. Perhaps that should be an available or the default setting? Perhaps the top row should default to labeling on the top, the right column default to labeling on the right, etc? -r On Mon, Jan 24, 2011 at 5:56 PM, Benjamin Root <ben...@ou...> wrote: > > > Isn't it a feature? Axes_grid lets you choose the label mode which is > 'L' by default. This means that only the outer labels are shown. Or > am I missing something in the description of the problem? > > Ben Root > -- Russell J. Hewett Ph.D. Candidate Department of Computer Science University of Illinois at Urbana-Champaign www.russellhewett.com
Hello Gentlepeople, I am plotting an integer array using: matplotlib.pyplot.plot(). For my purposes it is imperative that the x-axis be explicitly defined. I have tried to achieve this by using: matplotlib.pyplot.axis(v). Where v is a list of integer values corresponding to the desired axes limits [xmin, xmax, ymin, ymax]. However, the x-axis that is displayed does not obey my explicit xmax declaration; the value is rounded up. Here is the relevant portion of my code: fig = pyplot.figure(figsize=(16,8)) ax1 = fig.add_axes([0.05, 0.15, 0.9, 0.8]) v = [0, len(myintvector), 0, max(myintvector, key=int)] ax1.axis(v) ax1.plot(myintvector, 'r--') The reason that I need the x-axis to match the length of my integer vector is because I am also drawing a colorbar immediately below the plot, the values of which describe the same integer vector. Therefore I need the colorbar coordinates to match the x-axis coordinates of my plot. I hope that I have described my issue coherently. Please be kind (N00b alert). Any help is greatly appreciated! Sincerely, Lionel 'Lee' Brooks 3rd Dartmouth Genetics Grad Student