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
(47)
2
(13)
3
(12)
4
(16)
5
(3)
6
(6)
7
(20)
8
(45)
9
(24)
10
(30)
11
(14)
12
(4)
13
(1)
14
(6)
15
(6)
16
(10)
17
(15)
18
(13)
19
(4)
20
21
(14)
22
(13)
23
(9)
24
(19)
25
(24)
26
27
(4)
28
(20)
29
(17)
30
(7)



Showing 15 results of 15

From: Eamon C. <eam...@gm...> - 2010年06月17日 23:49:18
On Wed, Jun 16, 2010 at 4:06 PM, Malte Dik <mal...@we...> wrote:
> Hi,
>
> Eamon Caddigan <eam...@gm...>
>> The reason my initial attempts failed was because I (erroneously)
>> assumed that the default axis spanned (0, 0), (1, 1). Now I that I
>> know better, I can place an axis for each image in the right place and
>> everything looks fine.
>>
>> However, I'm still interested in knowing how to query the pixel size
>> of the figure, so I can translate normalized axis coordinates to pixel
>> coordinates.
>
> http://matplotlib.sourceforge.net/users/transforms_tutorial.html
>
> Maybe something along the lines
> ax.transAxes.transform((0, 0)) - ax.transAxes.transform((1, 1))
transAxes.transform() was exactly what I was looking for. Thanks!
-Eamon
From: Eric F. <ef...@ha...> - 2010年06月17日 17:53:41
On 06/17/2010 07:35 AM, Ryan May wrote:
> On Thu, Jun 17, 2010 at 11:39 AM, Benjamin Root<ben...@ou...> wrote:
>> Try "ax.set_xticks([])", I think that works for 2D plots.
>
> Nope, labels disappear.
>
> Jeff, try this:
>
> ax.xaxis.set_ticks_position('none')
>
> Ryan
>
In [1]:plot([1,2])
Out[1]:[<matplotlib.lines.Line2D object at 0x3e11510>]
In [2]:ax = gca()
In [3]:for t in ax.xaxis.get_ticklines(): t.set_visible(False)
 ...:
In [4]:draw()
From: Eric F. <ef...@ha...> - 2010年06月17日 17:50:22
On 06/17/2010 05:52 AM, Ryan May wrote:
> On Thu, Jun 17, 2010 at 10:52 AM, Andreas Hilboll<li...@hi...> wrote:
>> Hi there,
>>
>> I just noticed today that when I call hist() on a masked_array, also those
>> values which are masked out are displayed (with their fill_value). Is that
>> really the desired behaviour?
>>
>> I'm working in an environment where we're mostly using masked_array, but
>> also sometimes the 'normal' ndarray. So I would need to do something like
>>
>> try:
>> data = data.compressed()
>> except:
>> pass
>> hist(data)
>>
>> all the time ... Is there any easier solution?
>
> Unfortunately, these lines in Axes.hist():
>
> # TODO: support masked arrays;
> x = np.asarray(x)
>
> say it all. I think changing to asanyarray() should work (I'm not sure
> what, if anything, this would break), but there's no way for you to
> get this behavior without editing your local copy of axes.py.
It takes considerably more than that. Nothing terribly difficult, but 
more than a couple lines.
Eric
>
> Ryan
>
From: Ryan M. <rm...@gm...> - 2010年06月17日 17:35:48
On Thu, Jun 17, 2010 at 11:39 AM, Benjamin Root <ben...@ou...> wrote:
> Try "ax.set_xticks([])", I think that works for 2D plots.
Nope, labels disappear.
Jeff, try this:
ax.xaxis.set_ticks_position('none')
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: Jonathan S. <js...@cf...> - 2010年06月17日 17:25:11
I've been using Axes3D to make plots and I like the output very much --
with the one exception being the faintness of the 3-D grid that is put
in the background. The light gray used is quite difficult to see. Is
there some way to specify the color of the grid and/or background? I'd
be satisfied with having the grid lines darker. I've been looking
through the axes3d.py file under mpl_toolkits/mplot3d but haven't
figured it out yet.
By the way, anyone looking to specify an initial non-default orientation
for the grid, I discovered that you can do this when instantiating your
Axes3D object this way:
ax = Axes3D(fig,elev=e,azim=a)
where e and a are the elevation about the x-axis and azimuthal rotation
about the z-axis (both in degrees). 0 azimuthal rotation has the y-z
plane in the plane of the screen; azim. rotation is defined as clockwise
as viewed from above.
From: Benjamin R. <ben...@ou...> - 2010年06月17日 16:39:31
Try "ax.set_xticks([])", I think that works for 2D plots.
Ben Root
On Thu, Jun 17, 2010 at 11:22 AM, Jeff Perry <je...@gm...> wrote:
> can someone tell me how to turn off the tick marks on my plot?
>
> i tried this
>
> [line.set_marker('None') for line in ax.get_xticklines()]
>
> but this turns off the labels too. i don't want to turn off the
> labels, just the tick marks.
>
> someone also suggested this
>
> ax.xaxis.set_major_locator(pylab.NullLocator())
>
> but it also turns off the labels
>
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit. See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Jeff P. <je...@gm...> - 2010年06月17日 16:22:52
can someone tell me how to turn off the tick marks on my plot?
i tried this
 [line.set_marker('None') for line in ax.get_xticklines()]
but this turns off the labels too. i don't want to turn off the
labels, just the tick marks.
someone also suggested this
 ax.xaxis.set_major_locator(pylab.NullLocator())
but it also turns off the labels
From: Ryan M. <rm...@gm...> - 2010年06月17日 15:56:26
On Thu, Jun 17, 2010 at 10:52 AM, Andreas Hilboll <li...@hi...> wrote:
> Hi there,
>
> I just noticed today that when I call hist() on a masked_array, also those
> values which are masked out are displayed (with their fill_value). Is that
> really the desired behaviour?
>
> I'm working in an environment where we're mostly using masked_array, but
> also sometimes the 'normal' ndarray. So I would need to do something like
>
> try:
> data = data.compressed()
> except:
> pass
> hist(data)
>
> all the time ... Is there any easier solution?
Unfortunately, these lines in Axes.hist():
 # TODO: support masked arrays;
 x = np.asarray(x)
say it all. I think changing to asanyarray() should work (I'm not sure
what, if anything, this would break), but there's no way for you to
get this behavior without editing your local copy of axes.py.
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: Jae-Joon L. <lee...@gm...> - 2010年06月17日 15:52:53
>
> The following gets it done, however:
>
> cb.ax.artists.remove(cb.outline)
>
or
 cb.outline.remove()
-JJ
From: Andreas H. <li...@hi...> - 2010年06月17日 15:45:09
Hi there,
I just noticed today that when I call hist() on a masked_array, also those
values which are masked out are displayed (with their fill_value). Is that
really the desired behaviour?
I'm working in an environment where we're mostly using masked_array, but
also sometimes the 'normal' ndarray. So I would need to do something like
try:
 data = data.compressed()
except:
 pass
hist(data)
all the time ... Is there any easier solution?
Cheers,
Andreas.
From: Ryan M. <rm...@gm...> - 2010年06月17日 15:42:43
On Thu, Jun 17, 2010 at 10:29 AM, Jeff Perry <je...@gm...> wrote:
> can someone tell me how to turn off the frame on the colorbar?
>
> i tried this
>
> ...
> cb=plt.colorbar()
> plt.axes(cb.ax)
> plt.box(on=False)
There's no function or parameter to control this at the moment
unfortunately (I've marked this as a TODO, but I don't see a quick way
to add it at the moment).
The following gets it done, however:
cb.ax.artists.remove(cb.outline)
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: Jeff P. <je...@gm...> - 2010年06月17日 15:29:34
can someone tell me how to turn off the frame on the colorbar?
i tried this
...
cb=plt.colorbar()
plt.axes(cb.ax)
plt.box(on=False)
...
but it has no effect
thanks,
jeff
From: Pablo A. <pab...@ua...> - 2010年06月17日 08:57:18
Thanks again!
El 17/06/10 02:03, Mike Alger escribió:
>
> Pablo,
>
> 
>
> I found the example on the svn
> http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/examples/mplot3d/surface3d_demo3.py?view=log
> it will demonstrate the face colour thing but personally I found
> getting the rgb tuple data into an array a bit too complicated for my
> needs.
>
> 
>
> Regarding that little SNAFU about the matrix size, I was half asleep
> and in a rush when I wrote the reply to your email, so I knew if I
> made a mistake it was in the interpretation there :D
>
> A slice, reshape function may be more efficient/ easier to read but
> I took the loop structure right from the plot surface command to make
> sure it was done exactly the same way as the 3d surface. It may be
> interesting to see which is more efficient computationally and see if
> there is an improvement to be made in the plot surface command
>
> 
>
> 
>
> *From:* Pablo Angulo [mailto:pab...@ua...]
> *Sent:* June-16-10 9:07 AM
> *To:* Mike Alger
> *Cc:* mat...@li...
> *Subject:* Re: [Matplotlib-users] color in plot3d
>
> 
>
> El 15/06/10 01:22, Mike Alger escribió:
>
> The way that color keyword is set up, it is dedsigned to take a color
> word or rgba tuple , (Reinier will know this better than me), however
> if you want to just assign colors based on a colour map you can take
> you color array and reshape the same way the plot surface command
> does then use surf.set_array()
>
>
> If I understand you correctly, you mean there is a way to use directly
> a map from two or three spatial coordinates into the three or four
> components of the color space?
>
> That's interesting. It might be limiting that this map has to factor
> as the composition of an scalar map and a color map, even for 2d plots.
>
>
>
> here is a snippet of the code I use to do this I am pretty sure it
> won’t run the way it is right now but the idea is buried in there
>
> Thanks, I got the idea!
>
> 
>
> note that regmap xyz and costmapz are all the same size and are nxm
> matrices costmapout is a 2x(m.n) if i can do the math correctly
>
>
> One comment: from your code it seems that costmapout is a 1D array of
> lenght roughly equal (m*n)/scale**2 with the data coming from
> costmapz. Why don't you use a slice followed by a reshape command?
>
> 
>
>
>
>
> 
>
> 
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 9.0.829 / Virus Database: 271.1.1/2942 - Release Date:
> 06/16/10 14:35:00
>
From: Hana S. <ha...@cs...> - 2010年06月17日 00:48:05
Hi,
I installed matplotlib-0.99.3-py2.6-macosx10.6.dmg on MacOS X 10.6.3, 
python 2.6.5. But I get an error when running the histogram example from
http://matplotlib.sourceforge.net/examples/api/histogram_demo.html
Exception in Tkinter callback
Traceback (most recent call last):
 File 
"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk/Tkinter.py", 
line 1410, in __call__
 return self.func(*args)
 File 
"/Library/Python/2.6/site-packages/matplotlib/backends/backend_tkagg.py", line 
212, in resize
 self.show()
 File 
"/Library/Python/2.6/site-packages/matplotlib/backends/backend_tkagg.py", line 
216, in draw
 tkagg.blit(self._tkphoto, self.renderer._renderer, colormode=2)
 File 
"/Library/Python/2.6/site-packages/matplotlib/backends/tkagg.py", line 
19, in blit
 tk.call("PyAggImagePhoto", photoimage, id(aggimage), colormode, 
id(bbox_array))
TclError
Would anybody know what's wrong?
Thanks,
Hana
From: Mike A. <ma...@ry...> - 2010年06月17日 00:04:02
Pablo, 
 
I found the example on the svn <http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/examples/mplot3d/surface3d_demo3.py?view=log> http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/examples/mplot3d/surface3d_demo3.py?view=log it will demonstrate the face colour thing but personally I found getting the rgb tuple data into an array a bit too complicated for my needs.
 
Regarding that little SNAFU about the matrix size, I was half asleep and in a rush when I wrote the reply to your email, so I knew if I made a mistake it was in the interpretation there :D
A slice, reshape function may be more efficient/ easier to read but I took the loop structure right from the plot surface command to make sure it was done exactly the same way as the 3d surface. It may be interesting to see which is more efficient computationally and see if there is an improvement to be made in the plot surface command
 
 
From: Pablo Angulo [mailto:pab...@ua...] 
Sent: June-16-10 9:07 AM
To: Mike Alger
Cc: mat...@li...
Subject: Re: [Matplotlib-users] color in plot3d
 
El 15/06/10 01:22, Mike Alger escribió: 
The way that color keyword is set up, it is dedsigned to take a color word or rgba tuple , (Reinier will know this better than me), however if you want to just assign colors based on a colour map you can take you color array and reshape the same way the plot surface command does then use surf.set_array()
If I understand you correctly, you mean there is a way to use directly a map from two or three spatial coordinates into the three or four components of the color space? 
That's interesting. It might be limiting that this map has to factor as the composition of an scalar map and a color map, even for 2d plots.
 here is a snippet of the code I use to do this I am pretty sure it won’t run the way it is right now but the idea is buried in there
Thanks, I got the idea!
 
note that regmap xyz and costmapz are all the same size and are nxm matrices costmapout is a 2x(m.n) if i can do the math correctly 
One comment: from your code it seems that costmapout is a 1D array of lenght roughly equal (m*n)/scale**2 with the data coming from costmapz. Why don't you use a slice followed by a reshape command? 
 
 
 
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.829 / Virus Database: 271.1.1/2942 - Release Date: 06/16/10 14:35:00

Showing 15 results of 15

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 によって変換されたページ (->オリジナル) /