SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

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)





Showing results of 315

<< < 1 2 3 4 5 .. 13 > >> (Page 3 of 13)
From: Paul I. <piv...@gm...> - 2011年01月26日 06:51:18
Eric Firing, on 2011年01月25日 19:52, wrote:
> On 01/25/2011 06:58 PM, Shrividya Ravi wrote:
> [...]
> > On the same topic of the colorbar, how can I readjust the colors such
> > that it only goes between user-specified values? For example, I have one
> > imshow plot where the values range between 0 and 350. However, I only
> > want to look at the values between 300 and 350.
> 
> z = np.arange(25)
> z.shape = 5,5
> imshow(z, vmin=10, vmax=20, interpolation='nearest')
> colorbar(extend='both')
> 
> Does that give the desired result?
Hi Shrividya,
Here's how I interpreted what was being asked, in case that
helps. 
Also, Eric, is there a reason we make an outline instead of
just cbar.ax.set_frame_on? - My manual adjustments screw up and
confuse whatever data cbar.outline depends on
x = np.random.rand(100)
y = np.random.rand(100)
z = np.random.rand(100)
collection = plt.scatter(x, y, c=z*350, vmin=0, vmax=350)
cbar = plt.colorbar()
cbar.ax.set_ylim(cbar.norm((300,350)))
cbar.ax.set_xlim(cbar.norm((300,350))) # maintain aspect ratio
cbar.set_ticks(np.linspace(300,350,6))
# didn't see a quick way to fix the outline
cbar.outline.set_visible(False) 
cbar.ax.set_frame_on(True)
plt.draw()
best,
-- 
Paul Ivanov
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 
From: Eric F. <ef...@ha...> - 2011年01月26日 05:52:35
On 01/25/2011 06:58 PM, Shrividya Ravi wrote:
[...]
> On the same topic of the colorbar, how can I readjust the colors such
> that it only goes between user-specified values? For example, I have one
> imshow plot where the values range between 0 and 350. However, I only
> want to look at the values between 300 and 350.
z = np.arange(25)
z.shape = 5,5
imshow(z, vmin=10, vmax=20, interpolation='nearest')
colorbar(extend='both')
Does that give the desired result?
Eric
>
> Any help would be greatly appreciated!
>
> Thanks a lot!
> Shrividya
From: Shrividya R. <pen...@gm...> - 2011年01月26日 04:59:04
Hi there,
I too want a log scale on the colorbar for an imshow plot. I have tried the
solution proposed by Jae-Joon but I cannot get the ticklabels to show. I
have tried to dynamically change the matplotlibrc settings in ipython using
mpl.rc('text',usetex=True) - where mpl = matplotlib. When I run the script I
get a whole series of errors (see in italics below) and the figure doesn't
show.
*
RuntimeError: Could not obtain dvipng version
Exception in Tkinter callback
*
Is there another way to get a colorbar with a log scale?
On the same topic of the colorbar, how can I readjust the colors such that
it only goes between user-specified values? For example, I have one imshow
plot where the values range between 0 and 350. However, I only want to look
at the values between 300 and 350.
Any help would be greatly appreciated!
Thanks a lot!
Shrividya
Hi Paul,
Sorry for the delayed response....
On Fri, Jan 21, 2011 at 5:20 PM, Paul Ivanov <piv...@gm...> wrote:
> ok, much clearer now - what you want is for your text to not be
> cut-off the way it is in the 8x8 80dpi plot? In other words,
> there's not enough space left in the figure for the axis labels
> to be completely displayed.
Even if the text was displayed, it appears to be rather smaller than
it could be.
> At the moment, I don't think there's a simple way of doing it,
> and the quick way I find myself doing is by adjusting the subplot
> parameters using:
Thanks for helping me so much with this. I'll continue to use my
convert hack until better things come down the pipe. Sorry that I am
not able to write patches to help this situation. :(
daryl
From: Daniel H. <dh...@gm...> - 2011年01月25日 21:58:42
(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
 
From: Lionel (L. B. 3. <Lio...@da...> - 2011年01月25日 16:50:37
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.)
> 
> 
From: Uri L. <las...@mi...> - 2011年01月25日 15:43:59
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
>
From: E <pu...@je...> - 2011年01月25日 14:06:57
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))
From: Friedrich R. <fri...@gm...> - 2011年01月25日 12:40:30
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
From: Jae-Joon L. <lee...@gm...> - 2011年01月25日 11:32:15
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
From: Daniel F. <dan...@we...> - 2011年01月25日 10:28:28
> 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
From: Peter S. <pet...@gm...> - 2011年01月25日 10:09:25
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
From: Eric F. <ef...@ha...> - 2011年01月25日 04:57:37
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
From: Russell H. <rhe...@il...> - 2011年01月25日 01:43:42
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
From: Lionel (L. B. 3. <Lio...@da...> - 2011年01月25日 01:12:45
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
From: Benjamin R. <ben...@ou...> - 2011年01月24日 23:59:52
On Monday, January 24, 2011, Daniel Mader
<dan...@go...> wrote:
> Dear Paul,
>
> thank you very much for the quick reply! Unfortunately, I don't seem to get things right with your snippet of code:
>
>
>
> # prevent the automatic rotation caused by view changes
> ax.yaxis.set_rotate_label(False)
> ax.yaxis.label.set_rotation(45)
> Traceback (most recent call last):
>  File "example_mpl3D_spiral.py", line 41, in <module>
>   ax.yaxis.set_rotate_label(False)
> AttributeError: 'YAxis' object has no attribute 'set_rotate_label'
>
> Am I missing something?
>
> Thanks in advance,
> best regards from a snowed up Salzburg,
>
> Daniel
>
This problem with poorly rotated labels was fixed a couple of months
ago in the development branch and I believe it is also in 1.0.1. Just
to make sure, what version are you running?
Ben Root
From: Benjamin R. <ben...@ou...> - 2011年01月24日 23:56:52
On Monday, January 24, 2011, Russell Hewett <rhe...@il...> wrote:
> Worked great, thanks!
>
> -r
>
> On Mon, Jan 24, 2011 at 2:32 PM, Paul Ivanov <piv...@gm...> wrote:
>
> Russell Hewett, on 2011年01月24日 13:56, wrote:
>> Hi All,
>>
>> I can't get the x label on the top row of an ImageGrid to display if there
>> is more than one row in the grid. I suspect that something is being clipped
>> somewhere, but have no idea what to do to fix it. (Note, this also happens
>> on the right edge of a ride-sided y axis label.)
>>
>> I have included some minimal sample code below. I'd appreciate it if anyone
>> can point me in the right direction.
>>
>>
>> Cheers,
>> Russ
>
> Hi Russ,
>
> thanks for the report - at a glance, it appears to be a bug in
> AxesGrid removing redundant labels for shared axis when they
> align. I've included a temporary workaround for your script, but
> don't have time to look into it further at the moment. By the
> way, calling grid[0].axes is redundant, so I just modified it to
> use grid[0].xaxis, which is equivalent.
>
> #-------------------------------
> import matplotlib.pyplot as plt
> import matplotlib.cm as cm
> import mpl_toolkits.axes_grid1 as ag
>
> import numpy as np
>
> fig1 = plt.figure()
>
> grid1 = ag.AxesGrid( fig1, 111, nrows_ncols = (1,2), axes_pad = 0.5)
>
> grid1[0].xaxis.set_label_position('top')
> grid1[0].xaxis.set_label_text('foo')
>
> grid1[1].xaxis.set_label_position('top')
> grid1[1].xaxis.set_label_text('bar')
>
> grid1[0].yaxis.set_label_position('right')
> grid1[0].yaxis.set_label_text('foo')
>
> grid1[1].yaxis.set_label_position('right')
> grid1[1].yaxis.set_label_text('bar')
> grid1[1].yaxis.label.set_visible(True) # tmp workaround
>
>
> fig2 = plt.figure()
> grid2 = ag.AxesGrid( fig2, 111, nrows_ncols = (2,1), axes_pad = 0.5)
>
> grid2[0].xaxis.set_label_position('top')
> grid2[0].xaxis.set_label_text('bar')
> grid2[0].xaxis.label.set_visible(True) # tmp workaround
>
> grid2[1].xaxis.set_label_position('top')
> grid2[1].xaxis.set_label_text('bar')
>
> grid2[0].yaxis.set_label_position('right')
> grid2[0].yaxis.set_label_text('foo')
>
> grid2[1].yaxis.set_label_position('right')
> grid2[1].yaxis.set_label_text('bar')
>
> plt.show()
> #-------------------------------
>
> best,
> --
> Paul Ivanov
> 314 address only used for lists, off-list direct email at:
> http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
>
> iEYEARECAAYFAk094eYACgkQe+cmRQ8+KPc/qACePreDR4ThGj/2PttN6OaMXm0K
> 17YAmwbIpf+++7fYVqI3asKiBf8Z3zlT
> =eG7W
> -----END PGP SIGNATURE-----
>
> ------------------------------------------------------------------------------
> 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
>
>
>
> --
> Russell J. Hewett
> Ph.D. Candidate
> Department of Computer Science
> University of Illinois at Urbana-Champaign
> www.russellhewett.com
>
>
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
From: johanngoetz <jg...@uc...> - 2011年01月24日 23:06:07
Hello,
A common task I have is to histogram one variable of a multidimensional
dataset as a function of two (or more) variables. I have attached an example
which shows exactly what I would like to do.
The problem I would like to solve is the zoomed in x-axis which is the last
part of the script attached. I start by copying one of the subplots with
Axes.twiny() and proceed to adjust it and label it. The results are quite
nice but as soon as I start adjusting the plotted window or any of the
subplot spacing parameters, this "copy of an axis" does not transform
properly. Could anyone make a suggestion as to which transformations I
should use to shift and zoom the new axes? Or perhaps there is a better
method for drawing a zoomed in version of an axis?
I would like to submit this to the examples/gallery page but feel that these
details need to be addressed, and I am not sure I know how to fix them.
Hopefully, I have commented this example enough that someone could follow
what I am doing.
Thank you,
Johann
http://old.nabble.com/file/p30748088/grid_plot.png 
http://old.nabble.com/file/p30748088/grid_plot.py grid_plot.py 
-- 
View this message in context: http://old.nabble.com/zoomed-copy-of-axis-for-grid-of-subplots-tp30748088p30748088.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: C M <cmp...@gm...> - 2011年01月24日 22:30:21
On Mon, Jan 24, 2011 at 4:42 PM, Paul Ivanov <piv...@gm...> wrote:
> C M, on 2011年01月24日 16:27, wrote:
>> I looked through the gallery, but didn't see this one and am not sure
>> how to create it. It would be a "floating bar chart" (or floating
>> column chart), like what is seen here:
>>
>> http://peltiertech.com/Excel/pix1/BloodSugarFloater.gif
>
> Hi Che,
>
> just specify the 'bottom' keyword argument to bar. Note that the
> second parameter is height of the bar, *not* the top of the bar
>
> plt.bar([1,2,3,4], [2,2.5,5,3], bottom=[0,-1,1,2])
>
> best,
> --
> Paul Ivanov
Thanks, Paul! Easy enough.
-Che
From: Daniel M. <dan...@go...> - 2011年01月24日 21:50:20
Dear Paul,
thank you very much for the quick reply! Unfortunately, I don't seem to get
things right with your snippet of code:
# prevent the automatic rotation caused by view changes
> ax.yaxis.set_rotate_label(False)
> ax.yaxis.label.set_rotation(45)
>
Traceback (most recent call last):
 File "example_mpl3D_spiral.py", line 41, in <module>
 ax.yaxis.set_rotate_label(False)
AttributeError: 'YAxis' object has no attribute 'set_rotate_label'
Am I missing something?
Thanks in advance,
best regards from a snowed up Salzburg,
Daniel
From: Russell H. <rhe...@il...> - 2011年01月24日 21:46:31
Worked great, thanks!
-r
On Mon, Jan 24, 2011 at 2:32 PM, Paul Ivanov <piv...@gm...> wrote:
> Russell Hewett, on 2011年01月24日 13:56, wrote:
> > Hi All,
> >
> > I can't get the x label on the top row of an ImageGrid to display if
> there
> > is more than one row in the grid. I suspect that something is being
> clipped
> > somewhere, but have no idea what to do to fix it. (Note, this also
> happens
> > on the right edge of a ride-sided y axis label.)
> >
> > I have included some minimal sample code below. I'd appreciate it if
> anyone
> > can point me in the right direction.
> >
> >
> > Cheers,
> > Russ
>
> Hi Russ,
>
> thanks for the report - at a glance, it appears to be a bug in
> AxesGrid removing redundant labels for shared axis when they
> align. I've included a temporary workaround for your script, but
> don't have time to look into it further at the moment. By the
> way, calling grid[0].axes is redundant, so I just modified it to
> use grid[0].xaxis, which is equivalent.
>
> #-------------------------------
> import matplotlib.pyplot as plt
> import matplotlib.cm as cm
> import mpl_toolkits.axes_grid1 as ag
>
> import numpy as np
>
> fig1 = plt.figure()
>
> grid1 = ag.AxesGrid( fig1, 111, nrows_ncols = (1,2), axes_pad = 0.5)
>
> grid1[0].xaxis.set_label_position('top')
> grid1[0].xaxis.set_label_text('foo')
>
> grid1[1].xaxis.set_label_position('top')
> grid1[1].xaxis.set_label_text('bar')
>
> grid1[0].yaxis.set_label_position('right')
> grid1[0].yaxis.set_label_text('foo')
>
> grid1[1].yaxis.set_label_position('right')
> grid1[1].yaxis.set_label_text('bar')
> grid1[1].yaxis.label.set_visible(True) # tmp workaround
>
>
> fig2 = plt.figure()
> grid2 = ag.AxesGrid( fig2, 111, nrows_ncols = (2,1), axes_pad = 0.5)
>
> grid2[0].xaxis.set_label_position('top')
> grid2[0].xaxis.set_label_text('bar')
> grid2[0].xaxis.label.set_visible(True) # tmp workaround
>
> grid2[1].xaxis.set_label_position('top')
> grid2[1].xaxis.set_label_text('bar')
>
> grid2[0].yaxis.set_label_position('right')
> grid2[0].yaxis.set_label_text('foo')
>
> grid2[1].yaxis.set_label_position('right')
> grid2[1].yaxis.set_label_text('bar')
>
> plt.show()
> #-------------------------------
>
> best,
> --
> Paul Ivanov
> 314 address only used for lists, off-list direct email at:
> http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
>
> iEYEARECAAYFAk094eYACgkQe+cmRQ8+KPc/qACePreDR4ThGj/2PttN6OaMXm0K
> 17YAmwbIpf+++7fYVqI3asKiBf8Z3zlT
> =eG7W
> -----END PGP SIGNATURE-----
>
>
> ------------------------------------------------------------------------------
> 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
>
>
-- 
Russell J. Hewett
Ph.D. Candidate
Department of Computer Science
University of Illinois at Urbana-Champaign
www.russellhewett.com
From: Paul I. <piv...@gm...> - 2011年01月24日 21:42:31
C M, on 2011年01月24日 16:27, wrote:
> I looked through the gallery, but didn't see this one and am not sure
> how to create it. It would be a "floating bar chart" (or floating
> column chart), like what is seen here:
> 
> http://peltiertech.com/Excel/pix1/BloodSugarFloater.gif
Hi Che,
just specify the 'bottom' keyword argument to bar. Note that the
second parameter is height of the bar, *not* the top of the bar
plt.bar([1,2,3,4], [2,2.5,5,3], bottom=[0,-1,1,2])
best,
-- 
Paul Ivanov
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 
From: C M <cmp...@gm...> - 2011年01月24日 21:27:49
I looked through the gallery, but didn't see this one and am not sure
how to create it. It would be a "floating bar chart" (or floating
column chart), like what is seen here:
http://peltiertech.com/Excel/pix1/BloodSugarFloater.gif
Thanks,
Che
From: Paul I. <piv...@gm...> - 2011年01月24日 21:27:42
Daniel Mader, on 2011年01月24日 20:55, wrote:
> Hi,
> 
> I have seen this ever since I use mpl_toolkits.mplot3d.Axes3D but it never
> bothered me too much until now: the labels are not aligned in paralled to
> the axes so that with longer labels or small figsizes, they run into the
> tick labels, besides looking odd.
 
Hi Daniel,
it does appear like a bug, though only for some views on the
axes, thanks for the report. I'm not very familiar with this
code, so I'll leave the bugfix for someone else, but here's the
temporary workaround:
> Is there anything I can do to change the angle manually?
# prevent the automatic rotation caused by view changes
ax.yaxis.set_rotate_label(False) 
ax.yaxis.label.set_rotation(45)
Beware that you'll have to adjust that angle on a per-view basis
to get things to look right.
best,
-- 
Paul Ivanov
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 
6 messages has been excluded from this view by a project administrator.

Showing results of 315

<< < 1 2 3 4 5 .. 13 > >> (Page 3 of 13)
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /