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




Showing results of 394

<< < 1 .. 6 7 8 9 10 .. 16 > >> (Page 8 of 16)
From: Michael D. <md...@st...> - 2009年03月19日 14:43:23
They're actually different fonts. The one on the left is Vera Sans, the 
one on right is Stix Sans. There is a bug where regular (meaning Vera) 
text in math was getting mapping to Stix Sans when mathtext.fontset is 
set to stixsans. (This should now be fixed in SVN).
All that said, fixing this "bug" will mean it's now fairly easy to get 
an unintended mix of Vera Sans and Stix Sans in math expressions. For 
example, "$A \bf{A}$" will draw the first A in Vera and the second in 
STIX. There's no easy way around that, since we don't currently support 
rich text for non-math fonts. To avoid this mix of fonts within the $ 
,ドル you would probably want to set mathtext.default to "rm".
Mike
Ryan May wrote:
> Mike,
>
> Is there supposed to be a difference in the size of text printed with 
> and without mathtext? Here's a simple script that shows what I'm 
> talking about:
>
> import matplotlib.pyplot as plt
> f = plt.figure()
> ax1 = f.add_subplot(1,2,1)
> ax1.set_title('Hello')
> ax2 = f.add_subplot(1,2,2)
> ax2.set_title('$Hello$')
> plt.show()
>
> And here's my matplotlibrc:
>
> backend : GtkAgg
> mathtext.fontset : stixsans
> font.size : 10.0
> savefig.dpi : 100 # figure dots per inch
> mathtext.default : regular
>
> I've attached a copy of what that looks like on my system.
>
> Sorry I keep finding these things. :) 
>
> Ryan
>
> -- 
> Ryan May
> Graduate Research Assistant
> School of Meteorology
> University of Oklahoma
> Sent from: Norman Oklahoma United States.
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
> software that enables intelligent coding and step-through debugging.
> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
> ------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Ryan M. <rm...@gm...> - 2009年03月19日 14:10:58
That fixed it for me, thanks.
Ryan
On Thu, Mar 19, 2009 at 7:54 AM, Michael Droettboom <md...@st...> wrote:
> Thanks. I think I have this fixed in SVN again...
>
> Basically what's happening is that Freetype's hinting imposes a vertical
> scale on the glyph that wasn't being taken into account.
>
> Mike
>
> Ryan May wrote:
>
>> Mike,
>>
>> I've found another case of the funk baseline:
>>
>> import matplotlib.pyplot as plt
>> plt.title('$Z_{DR}$ (from ts)')
>> plt.show()
>>
>> I've attached an image of what I see. Here's my matplotlibrc:
>>
>> backend : GtkAgg
>> mathtext.fontset : stixsans
>> mathtext.default : regular
>> font.size : 10.0
>> savefig.dpi : 100
>>
>> Ryan
>>
>> --
>> Ryan May
>> Graduate Research Assistant
>> School of Meteorology
>> University of Oklahoma
>> Sent from: Norman Oklahoma United States.
>> ------------------------------------------------------------------------
>>
>> ------------------------------------------------------------------------
>>
>>
>> ------------------------------------------------------------------------------
>> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
>> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
>> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
>> software that enables intelligent coding and step-through debugging.
>> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
> --
> Michael Droettboom
> Science Software Branch
> Operations and Engineering Division
> Space Telescope Science Institute
> Operated by AURA for NASA
>
>
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
Sent from: Norman Oklahoma United States.
From: Michael D. <md...@st...> - 2009年03月19日 12:54:16
Thanks. I think I have this fixed in SVN again...
Basically what's happening is that Freetype's hinting imposes a vertical 
scale on the glyph that wasn't being taken into account.
Mike
Ryan May wrote:
> Mike,
>
> I've found another case of the funk baseline:
>
> import matplotlib.pyplot as plt
> plt.title('$Z_{DR}$ (from ts)')
> plt.show()
>
> I've attached an image of what I see. Here's my matplotlibrc:
>
> backend : GtkAgg
> mathtext.fontset : stixsans
> mathtext.default : regular
> font.size : 10.0
> savefig.dpi : 100
>
> Ryan
>
> -- 
> Ryan May
> Graduate Research Assistant
> School of Meteorology
> University of Oklahoma
> Sent from: Norman Oklahoma United States.
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
> software that enables intelligent coding and step-through debugging.
> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
> ------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Eric F. <ef...@ha...> - 2009年03月19日 02:34:32
cneff wrote:
> Hi guys,
> 
> I've tried to google this and look through the examples but its not quite
> working for me. Say I have two sets of data I want to make contour plots out
> of
> 
> from pylab import *
> 
> x=arange(-3.0,3.0,.025)
> 
> y=arange(-2.0,2.0,.025)
> 
> X,Y = meshgrid(x,y)
> 
> Z1 = mlab.bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
> Z2 = mlab.bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
> 
> Now if I would go
> 
> plt1 = subplot(211)
> contourf(X,Y,Z1)
> colorbar()
> 
> plt2 = subplot(212)
> contourf(X,Y,Z2)
> colorbar()
> 
> we would see that the same colors correspond to different numerical values,
> because the ranges of Z1 and Z2 are different. I want it to be defined on
> the same range, so that red on plt1 corresponds to the same numerical Z
> value as red on plt2. How do I go about doing that?
Instead of relying on autoscaling to set the color levels, set them 
explicitly to the same set of values in both calls to contourf by adding 
a fourth argument.
e.g.
levs = arange(0,1.01,0.1)
...
contourf(X, Y, Z1, levs)
...
contourf(X, Y, Z2, levs)
...
Eric
From: cneff <ca...@gm...> - 2009年03月19日 02:01:24
Hi guys,
I've tried to google this and look through the examples but its not quite
working for me. Say I have two sets of data I want to make contour plots out
of
from pylab import *
x=arange(-3.0,3.0,.025)
y=arange(-2.0,2.0,.025)
X,Y = meshgrid(x,y)
Z1 = mlab.bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
Z2 = mlab.bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
Now if I would go
plt1 = subplot(211)
contourf(X,Y,Z1)
colorbar()
plt2 = subplot(212)
contourf(X,Y,Z2)
colorbar()
we would see that the same colors correspond to different numerical values,
because the ranges of Z1 and Z2 are different. I want it to be defined on
the same range, so that red on plt1 corresponds to the same numerical Z
value as red on plt2. How do I go about doing that?
-- 
View this message in context: http://www.nabble.com/Using-the-same-color-range-for-multiple-plots-tp22592487p22592487.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Hatch, S. J <sar...@jp...> - 2009年03月19日 00:57:35
Matplotlib Folks,
How do I turn off all clipping when making a plot? It seems like everything has a set_clip_on argument, but I couldn't figure out how to set all of these to False without explicitly doing so in every plot call. I would assume that there is a way to do this using an rcParam or the matplotlibrc file?
Any help would be appreciated!
Thanks,
Sara
-------------------------------------------------------------------
Sara Jean Hatch
Inner Planet Mission Analysis Group
Guidance, Navigation, & Control Section
NASA - Jet Propulsion Laboratory
4800 Oak Grove Drive
M/S: 301-150
Pasadena, CA 91109
Phone: (818) 354-8723
-------------------------------------------------------------------
From: Christopher B. <Chr...@no...> - 2009年03月19日 00:15:28
crwe crwe wrote:
> Looking at the implementation, it's really simple and i will do
> without matplotlib altogether and roll my own. 
It sounds like you have a solution, but if you need to test a LOT of 
points, it can be efficient to rasterize, and then get a lightning fast 
check.
It that case, though, I'd be inclined to use something like PIL's 
ImageDraw, rather than MPL -- all of MPL's scaling, anti-aliasing, etc. 
will just make it harder.
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: crwe c. <cr...@po...> - 2009年03月18日 22:36:11
> hi, did you find this?
> http://matplotlib.sourceforge.net/faq/howto_faq.html?highlight=codex%20nxutils#test-whether-a-point-is-inside-a-polygon
I used the search function but no, i didn't find that link :) Shame on me and thank you Brent.
Looking at the implementation, it's really simple and i will do without matplotlib altogether and roll my own. In case anyone else needs this, the code is:
def insidePoly(x, y, xs, ys):
 """Decide whether point (x, y) lies inside the 2d polygon defined by its vertices zip(xs, ys).
 """
 result = False
 for now in xrange(len(xs)):
 if (ys[now] < y and ys[now - 1] >= y) or (ys[now - 1] < y and ys[now] >= y):
 if xs[now] + 1.0 * (y - ys[now]) * (xs[now - 1] - xs[now]) / (ys[now - 1] - ys[now]) < x:
 result = not result
 return result
From: Brent P. <bpe...@gm...> - 2009年03月18日 21:58:02
On Wed, Mar 18, 2009 at 2:48 PM, crwe crwe <cr...@po...> wrote:
> Hi all,
>
> i need to draw a polygon (non-convex) into memory, so that i can query which pixels are inside the polygon and which not. I came across matplotlib which has some Polygon class in it so i presume i could use this (although so far, i didn't understand the terminology behind the library and how to string things together... patches? artists? O_O)
>
> What is the easiest way to draw the filled polygon, defined by a sequence of points, into some 1bit raster, so that i can answer queries like "Is the pixel at [10, 12] inside the polygon?"
>
> Cheers!
>
> ------------------------------------------------------------------------------
> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
> software that enables intelligent coding and step-through debugging.
> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
hi, did you find this?
http://matplotlib.sourceforge.net/faq/howto_faq.html?highlight=codex%20nxutils#test-whether-a-point-is-inside-a-polygon
From: crwe c. <cr...@po...> - 2009年03月18日 21:48:29
Hi all,
i need to draw a polygon (non-convex) into memory, so that i can query which pixels are inside the polygon and which not. I came across matplotlib which has some Polygon class in it so i presume i could use this (although so far, i didn't understand the terminology behind the library and how to string things together... patches? artists? O_O) 
What is the easiest way to draw the filled polygon, defined by a sequence of points, into some 1bit raster, so that i can answer queries like "Is the pixel at [10, 12] inside the polygon?"
Cheers!
From: Pablo R. <rom...@ho...> - 2009年03月18日 08:27:21
Thank you, and I apologize if the question wasnt appropriate for this list.
P.Romero
----------------------------------------
> To: mat...@li...
> From: jk...@ik...
> Date: 2009年3月18日 07:44:33 +0200
> Subject: Re: [Matplotlib-users] quick numpy question
>
> Pablo Romero writes:
>
>> quick numpy-related question.
>
> Not the best mailing list then, but...
>
>> I want to use numpy.arange() to create multiple arrays, and then I
>> want to join these arrays (or individual elements) to the final array
>> without repeating existing elements (create a 'union' from 2 or more
>> arrays or individual elements).
>
> Try np.union1d (and note that the numpy book has been in the public
> domain since August: http://www.tramy.us/guidetoscipy.html )
>
> --
> Jouni K. Seppänen
> http://www.iki.fi/jks
>
>
> ------------------------------------------------------------------------------
> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
> software that enables intelligent coding and step-through debugging.
> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
_________________________________________________________________
Hotmail® is up to 70% faster. Now good news travels really fast. 
http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_HM_70faster_032009
From: Jouni K. S. <jk...@ik...> - 2009年03月18日 05:45:04
Pablo Romero <rom...@ho...> writes:
> quick numpy-related question.
Not the best mailing list then, but...
> I want to use numpy.arange() to create multiple arrays, and then I
> want to join these arrays (or individual elements) to the final array
> without repeating existing elements (create a 'union' from 2 or more
> arrays or individual elements).
Try np.union1d (and note that the numpy book has been in the public
domain since August: http://www.tramy.us/guidetoscipy.html )
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: <bre...@un...> - 2009年03月18日 03:28:29
Use Python set and then convert to numpy array?
Pablo Romero <rom...@ho...> 
18/03/2009 01:50 PM
To
<mat...@li...>
cc
Subject
[Matplotlib-users] quick numpy question
quick numpy-related question.
 
I want to use numpy.arange() to create multiple arrays, and then I want to 
join these arrays (or individual elements) to the final array without 
repeating existing elements (create a 'union' from 2 or more arrays or 
individual elements).
example:
 
lev=np.arange(0,20,2)
# lev=(0,2,4,6,8,...,20)
 
lev1=np.arange(0,18,3)
#lev1=(0,3,6,9,12,15,18)
 
#I want something like...
 
lev3=lev1+lev2 
 
#WITHOUT repeating elements (i.e., only one '12' in resulting array), 
i.e., I want:
#lev3=(0,2,3,4,6,8,9,10,12,14,15,16,18,20)
 
#or, add just a unique element(s)
 
lev4=lev3+(50,60)
 
#so I would want lev4 to look like this:
#lev4=(0,2,3,4,6,8,9,10,12,14,15,16,18,20,50,60)
 
 
are these types of operations possible using numpy?
How can this be done?
 
Please help
 
Thanks,
 
P.Romero
_________________________________________________________________
Windows Live? Contacts: Organize your contact list. 
http://windowslive.com/connect/post/marcusatmicrosoft.spaces.live.com-Blog-cns!503D1D86EBB2B53C!2285.entry?ocid=TXT_TAGLM_WL_UGC_Contacts_032009
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Matplotlib-users mailing list
Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________
UNITED GROUP
This email message is the property of United Group. The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorised. If you are not the intended recipient, you may not disclose, copy or distribute this email, nor take or omit to take any action in reliance on it. United Group accepts no liability for any damage caused by this email or any attachments due to viruses, interference, interception, corruption or unauthorised access.
If you have received this email in error, please notify United Group immediately by email to the sender's email address and delete this document.
From: Pablo R. <rom...@ho...> - 2009年03月18日 02:50:51
quick numpy-related question.
 
I want to use numpy.arange() to create multiple arrays, and then I want to join these arrays (or individual elements) to the final array without repeating existing elements (create a 'union' from 2 or more arrays or individual elements).
example:
 
lev=np.arange(0,20,2)
# lev=(0,2,4,6,8,...,20)
 
lev1=np.arange(0,18,3)
#lev1=(0,3,6,9,12,15,18)
 
#I want something like...
 
lev3=lev1+lev2 
 
#WITHOUT repeating elements (i.e., only one '12' in resulting array), i.e., I want:
#lev3=(0,2,3,4,6,8,9,10,12,14,15,16,18,20)
 
#or, add just a unique element(s)
 
lev4=lev3+(50,60)
 
#so I would want lev4 to look like this:
#lev4=(0,2,3,4,6,8,9,10,12,14,15,16,18,20,50,60)
 
 
are these types of operations possible using numpy?
How can this be done?
 
Please help
 
Thanks,
 
P.Romero
_________________________________________________________________
Windows LiveTM Contacts: Organize your contact list. 
http://windowslive.com/connect/post/marcusatmicrosoft.spaces.live.com-Blog-cns!503D1D86EBB2B53C!2285.entry?ocid=TXT_TAGLM_WL_UGC_Contacts_032009
From: Eric F. <ef...@ha...> - 2009年03月17日 20:03:33
Jae-Joon Lee wrote:
> Reading Eric's reply on the previous email, my impression is that
> contourf is not supposed to draw the boundary (no stroke!). But it
> seems it still does.
> 
> for c in cs.collections:
> c.set_edgecolor("none")
> 
> After this, I can get rid of the vertical lines.
> I can see slight gaps between filled regions, though.
I am not sure they are really gaps, but it looks to me like there is no 
perfect way to get the region boundaries rendered under all 
conditions--any combination of settings of antialiasing, boundary 
stroking, and alpha, can produce visual artifacts of the rendering or 
errors in the representation of data. Different renderers handle the 
same boundaries in different ways, so that sometimes an artifact will be 
annoying with one renderer and absent with another.
> 
> While contourf create PolyCollection with edgecolors="none", the
> edgecolor are overridden later by the set_color call inside the
> ContourSet.changed method.
> 
> It may be better to draw the boundary for alpha=1, but better not otherwise.
It looks to me like there are always compromises, but overall it is best 
 for contour not to draw the boundaries at all. I think that was my 
intention all along, and I suspect it was accidentally thwarted along 
the way by some change--but I have not tried to track down the history. 
 What matters is only how we can get the best behavior and the best 
API. I have made some minimal changes to fix what seem to me to be 
blatent bugs (so I made the changes in the 98.5 maint and propagated 
them via svnmerge). The code could benefit from a much more thorough 
review and testing, and probably some substantial changes. It may be 
that some tweaking of antialiased on/off, whether and how to draw 
boundaries, etc. will always have to be left to the user, depending on 
backend used and the characteristics of the plot.
> 
> Anyhow, there is a little bug in how alpha value is treated in the
> contourf(maybe contour also).
I fixed this also--the problem was in colors.py, so it was quite general.
Thanks for finding these problems! I was completely wrong in my 
original diagnosis of the contourf problem with alpha. The solution I 
had in mind, which is to process the path information so as to generate 
multiply-connected regions instead of using branch cuts, may still have 
some advantages--in particular, it would make it possible to stroke the 
boundaries, and/or to use the same boundaries for selected line 
contours, instead of having to calculate them independently (and 
sometimes differently) with a call to contour. It is my understanding 
that all backends now should be able to handle multiply-connected regions.
Eric
> 
> In [2]: CS = plt.contourf(X, Y, Z,alpha = .7)
> 
> In [3]: print CS.collections[0].get_facecolor()
> [[ 0. 0. 0.82085561 0.49 ]]
> 
> Note that the alpha of the resulting facecolor is 0.7**2.
> It seems that both PolygonCollection and ContourSet are applying the
> alpha value.
> I may able to look at this sometime tomorrow, but feel free to take over.
> 
> Regards,
> 
> -JJ
> 
From: GKalman <kal...@ms...> - 2009年03月17日 16:39:19
John Hunter-4 wrote:
> 
> On Mon, Mar 16, 2009 at 1:52 PM, GKalman <kal...@ms...> wrote:
> 
>>
>> I need a reference to a "How to..." (or a sample code) to changing the
>> color
>> (Default or otherwise) of the Canvas, when plotting with matplotlib,
>> using
>> Python 2.5 on Windows.
> 
> Thanks John,
> 
> I was asking the WRONG question.
> What is should have asked: How to set the color of the "axisbg" 
> Luckily I found an example under matplotlib examples: color_demo.py.
> 
> Please consider this Thread closed
> 
> 
> 
> When creating your figure, just pass the facecolor you want in
> 
> fig = figure(facecolor='red')
> 
> With an existing figure instance, you can set the facecolor property of
> the
> rectangle patch
> 
> fig.patch.set_facecolor('green')
> 
> or you can set the default 'figure.facecolor' property in your
> matplotlibrc
> config file
> 
> http://matplotlib.sourceforge.net/users/customizing.html
> 
> 
> JDH
> 
> ------------------------------------------------------------------------------
> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
> software that enables intelligent coding and step-through debugging.
> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
-- 
View this message in context: http://www.nabble.com/pylab-matplotlib-canvas-background-color-change...-tp22541479p22563253.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: John H. <jd...@gm...> - 2009年03月17日 16:23:45
On Sat, Mar 14, 2009 at 12:22 PM, per freem <per...@gm...> wrote:
> hi all,
>
> i have a set of about 100-500 points that i'd like to color in different
> colors. i tried the following, using the c= argument to the scatter command:
>
> x = rand(200)
> scatter(x, x, c=xrange(1,201))
>
> however, only a handful of colors seem to be used and the points look very
> similar. what i am looking for is a different color for every point -- it
> can even be different shades, as in this example:
>
>
> http://matplotlib.sourceforge.net/examples/pylab_examples/ellipse_collection.html
>
> does anyone know how to create this?
>
The following works for me
 In [13]: x, y = np.random.rand(2, 100)
 In [14]: c = np.random.rand(100)
 In [15]: scatter(x, y, c=c)
 Out[15]: <matplotlib.collections.RegularPolyCollection object at
0x905e3ec>
> also, more complex, is there a way to do this where every point gets not
> only a different color but a different symbol? e.g. '^', 's', 'x', etc. ? i
> know there aren't 200 different symbols but it'd be nice if it cycled
> through the different symbols as much as possible (e.g. one point might be
> blue '^' and another might be red '^') to distinguish the points
This isn't supported with scatter -- you could make multiple calls to
scatter or plot if you want different symbols, but if you need *every*
symbol to be different this would be slow. In that case, you might want to
write your own matplotlib.collections.PolygonCollection.
JDH
From: John H. <jd...@gm...> - 2009年03月17日 16:19:43
On Mon, Mar 16, 2009 at 1:52 PM, GKalman <kal...@ms...> wrote:
>
> I need a reference to a "How to..." (or a sample code) to changing the
> color
> (Default or otherwise) of the Canvas, when plotting with matplotlib, using
> Python 2.5 on Windows.
When creating your figure, just pass the facecolor you want in
 fig = figure(facecolor='red')
With an existing figure instance, you can set the facecolor property of the
rectangle patch
 fig.patch.set_facecolor('green')
or you can set the default 'figure.facecolor' property in your matplotlibrc
config file
 http://matplotlib.sourceforge.net/users/customizing.html
JDH
From: John H. <jd...@gm...> - 2009年03月17日 16:06:51
On Tue, Mar 17, 2009 at 2:18 AM, David Simpson <dav...@ch...>wrote:
>
> Now (from ipython):
> In [41]: plotfile("tester.txt",cols=(0,1))
> ---------------------------------------------------------------------------
> IndexError Traceback (most recent call last)
>
> ....
>
> )
> 1436 return identifier, r[identifier]
> 1437 elif is_numlike(identifier):
> -> 1438 name = r.dtype.names[int(identifier)]
> 1439 return name, r[name]
> 1440 else:
>
> IndexError: tuple index out of range
The default delimiter is ','. You need space. Eg
 plotfile("tester.txt", cols=(0,1), delimiter=' ' )
From: Michael D. <md...@st...> - 2009年03月17日 11:48:09
Just getting back to work after an illness...
Eric's assessment is 100% correct: the transform kwarg is ignored by 
images. It probably could be, but it would not be trivial, particularly 
in the way the Agg backend is currently architected. This should 
probably be added as a feature request to the tracker, so we don't 
forget about it.
As for selective rasterization, IIRC we never really got past the API 
discussion. That's all that really needs to be done -- have a 
consistent sensical API for it -- other than that, I believe it works in 
PDF, PS and SVG backends already (probably not Cairo ATM, though).
Mike
Eric Firing wrote:
> Thomas Robitaille wrote:
> 
>>>> It looks like rotation/translation should be easy to do with 
>>>> Affine2D, so I tried using it, but I can't seem to get it to work as 
>>>> expected - here is an example of how I am using it:
>>>> 
>>> Based on a quick look at image.py and _image.cpp, it appears that 
>>> there is a low-level capability to rotate an image in the latter, but 
>>> no support at higher levels. It also looks to me like adding that 
>>> support would not be trivial--doing it right would take more than just 
>>> calling the low-level apply_rotation method. Mike D. would be the 
>>> expert on this, though.
>>> 
>> Does this mean that the transform= keyword has no effect on imshow in 
>> general?
>> 
>
> It does look like it is ignored. It is a kwarg for Artists that is not 
> supported by all. The fact that one can specify it and get no feedback 
> is a bug.
>
>
> 
>> I attempted to use the pcolormesh() method, which worked, but is 
>> impractical, as a 1000x1000 image produces a 300Mb EPS file when plotted 
>> in this way.
>> 
>
> There is some infrastructure for handling this via selective 
> rasterization of artists, but I can never remember exactly what its 
> status is; I don't see anything in the examples. The topic comes up on 
> the list at perhaps 6-month intervals. Personally, I would very much 
> like to see the selective rasterization capability fully developed and 
> exposed, complete with documentation and examples; it is important for 
> exactly the reason you note above. It is not something I will be able 
> to work on myself, unfortunately.
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Pablo R. <rom...@ho...> - 2009年03月17日 09:03:06
Thanks,
Its good to know that it IS possible to set the Z-order for contours (I didnt think it was possible).
 
In any case, I solved this by setting the Z-order in my fillcontinents() and drawcoastlines() calls, and setting them to '100' and '101' respectively (assuming these numbers were high enough to overlap anything else on the plot).
 
Thanks again,
P.Romero
----------------------------------------
> Date: 2009年3月16日 21:06:18 -1000
> From: ef...@ha...
> To: mat...@li...
> Subject: Re: [Matplotlib-users] problem with contour() & basemap; contours overlapping map
>
> Jouni K. Seppänen wrote:
>> Pablo Romero writes:
>>
>>> How can I go about correcting this, so that the 'basemap.contour()'
>>> function draws the contours BEFORE drawing the coastlines & filled
>>> continents?
>>
>> Use appropriate zorder arguments in your method calls:
>>
>> http://matplotlib.sourceforge.net/examples/pylab_examples/zorder_demo.html
>>
>
> Contour does not pass on the zorder argument, so you need to do
> something like this:
>
> CS = contour(x,y,z, levs)
> for c in CS.collections:
> c.set_zorder(0.5) # less than patch, which is 1.0
>
> Eric
>
>
> ------------------------------------------------------------------------------
> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
> software that enables intelligent coding and step-through debugging.
> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
_________________________________________________________________
Windows LiveTM: Life without walls.
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_allup_1a_explore_032009
From: Jae-Joon L. <lee...@gm...> - 2009年03月17日 08:44:35
Reading Eric's reply on the previous email, my impression is that
contourf is not supposed to draw the boundary (no stroke!). But it
seems it still does.
for c in cs.collections:
 c.set_edgecolor("none")
After this, I can get rid of the vertical lines.
I can see slight gaps between filled regions, though.
While contourf create PolyCollection with edgecolors="none", the
edgecolor are overridden later by the set_color call inside the
ContourSet.changed method.
It may be better to draw the boundary for alpha=1, but better not otherwise.
Anyhow, there is a little bug in how alpha value is treated in the
contourf(maybe contour also).
In [2]: CS = plt.contourf(X, Y, Z,alpha = .7)
In [3]: print CS.collections[0].get_facecolor()
[[ 0. 0. 0.82085561 0.49 ]]
Note that the alpha of the resulting facecolor is 0.7**2.
It seems that both PolygonCollection and ContourSet are applying the
alpha value.
I may able to look at this sometime tomorrow, but feel free to take over.
Regards,
-JJ
On Tue, Mar 17, 2009 at 2:55 AM, Eric Firing <ef...@ha...> wrote:
> Pablo Romero wrote:
>>
>> Im having an issue where contourf is producing visible defects in the shaded contours (within png output) with alpha values that are less then 1.0.
>>
>
> Pablo,
>
> See
> http://www.mail-archive.com/mat...@li.../msg10245.html
> and my reply to that.
>
> I have an idea about how to solve the problem, but it is not trivial and
> won't happen soon--unless someone else wants to work on it.
>
> Filled contours are surprisingly hard to get right!
>
> Eric
>
>> Ive attached two images.
>> - the first image,contourf_no_alpha.png, shows my contour plot with the alpha value left at its default
>> (i.e.,alpha is not set, so alpha=1.0).
>>
>> - the second image, contourf_with_alpha.png, shows the same contoured data, yet with the alpha set to 0.75.
>> There are vertical lines visible where the contours are apparently being closed/joined?
>>
>> I added pink contour lines in order to show that these vertical lines are NOT actually part of the contour.
>>
>> these are the commands that I used:
>>
>> Z=create_my_data()
>>
>> ...
>>
>> # image 1 (contourf_no_alpha.png)
>> cs=m.contourf(X,Y,Z,lev)
>> cs=m.contour(X,Y,Z,lev,colors='pink'linewidths=1.5)
>>
>> # image 2 (contourf_with_alpha.png)
>> cs=m.contourf(X,Y,Z,lev,alpha=0.75)
>> cs=m.contour(X,Y,Z,lev,colors='pink',linewidths=1.5)
>>
>> Im running the latest versions of basemap&matplotlib.
>>
>> How can I remove these vertical defects while still being able to use "semi-transparent" alpha values?
>>
>> Please help,
>>
>> Thanks,
>>
>> P.Romero
>> _________________________________________________________________
>> Hotmail® is up to 70% faster. Now good news travels really fast.
>> http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_HM_70faster_032009
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>> ------------------------------------------------------------------------
>>
>> ------------------------------------------------------------------------------
>> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
>> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
>> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
>> software that enables intelligent coding and step-through debugging.
>> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
>
> ------------------------------------------------------------------------------
> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
> software that enables intelligent coding and step-through debugging.
> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: David S. <dav...@ch...> - 2009年03月17日 07:18:24
Hi,
I can't get the plotfile command to work on a simple file. I have
a file"tester.txt" which looks like:
 1 0.2137 0.2139 0.2138
 2 0.3969 0.3970 0.4003
 3 0.4391 0.4396 0.4382
 4 1.0020 1.0040 1.0020
 5 0.4892 0.4893 0.4903
 6 0.1593 0.1595 0.1589
 7 0.1658 0.1659 0.1665
Now (from ipython):
In [41]: plotfile("tester.txt",cols=(0,1))
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
....
)
 1436 return identifier, r[identifier]
 1437 elif is_numlike(identifier):
-> 1438 name = r.dtype.names[int(identifier)]
 1439 return name, r[name]
 1440 else:
IndexError: tuple index out of range
There must be a very simple explanation for this, but I haven't found 
it. (By the way, I tied with and without column headers, no difference).
I'm running MPL 0.98.3 on an Ubuntu 8.10 system.
Thanks,
Dave
From: Eric F. <ef...@ha...> - 2009年03月17日 07:07:02
Jouni K. Seppänen wrote:
> Pablo Romero <rom...@ho...> writes:
> 
>> How can I go about correcting this, so that the 'basemap.contour()'
>> function draws the contours BEFORE drawing the coastlines & filled
>> continents?
> 
> Use appropriate zorder arguments in your method calls:
> 
> http://matplotlib.sourceforge.net/examples/pylab_examples/zorder_demo.html
> 
Contour does not pass on the zorder argument, so you need to do 
something like this:
CS = contour(x,y,z, levs)
for c in CS.collections:
 c.set_zorder(0.5) # less than patch, which is 1.0
Eric
From: Eric F. <ef...@ha...> - 2009年03月17日 06:56:59
Pablo Romero wrote:
> 
> Im having an issue where contourf is producing visible defects in the shaded contours (within png output) with alpha values that are less then 1.0.
> 
Pablo,
See 
http://www.mail-archive.com/mat...@li.../msg10245.html
and my reply to that.
I have an idea about how to solve the problem, but it is not trivial and 
won't happen soon--unless someone else wants to work on it.
Filled contours are surprisingly hard to get right!
Eric
> Ive attached two images.
> - the first image,contourf_no_alpha.png, shows my contour plot with the alpha value left at its default
> (i.e.,alpha is not set, so alpha=1.0).
> 
> - the second image, contourf_with_alpha.png, shows the same contoured data, yet with the alpha set to 0.75.
> There are vertical lines visible where the contours are apparently being closed/joined?
> 
> I added pink contour lines in order to show that these vertical lines are NOT actually part of the contour.
> 
> these are the commands that I used:
> 
> Z=create_my_data()
> 
> ...
> 
> # image 1 (contourf_no_alpha.png)
> cs=m.contourf(X,Y,Z,lev)
> cs=m.contour(X,Y,Z,lev,colors='pink'linewidths=1.5)
> 
> # image 2 (contourf_with_alpha.png)
> cs=m.contourf(X,Y,Z,lev,alpha=0.75)
> cs=m.contour(X,Y,Z,lev,colors='pink',linewidths=1.5)
> 
> Im running the latest versions of basemap&matplotlib.
> 
> How can I remove these vertical defects while still being able to use "semi-transparent" alpha values?
> 
> Please help,
> 
> Thanks,
> 
> P.Romero
> _________________________________________________________________
> Hotmail® is up to 70% faster. Now good news travels really fast. 
> http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_HM_70faster_032009
> 
> 
> ------------------------------------------------------------------------
> 
> 
> ------------------------------------------------------------------------
> 
> 
> ------------------------------------------------------------------------
> 
> ------------------------------------------------------------------------------
> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
> software that enables intelligent coding and step-through debugging.
> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
15 messages has been excluded from this view by a project administrator.

Showing results of 394

<< < 1 .. 6 7 8 9 10 .. 16 > >> (Page 8 of 16)
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 によって変換されたページ (->オリジナル) /