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 17 results of 17

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
From: Jouni K. S. <jk...@ik...> - 2009年03月17日 06:55:21
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
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: Jouni K. S. <jk...@ik...> - 2009年03月17日 06:50:57
Pablo Romero <rom...@ho...> writes:
> 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.
Looks like the same problem as this one:
http://thread.gmane.org/gmane.comp.python.matplotlib.general/16225
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: Pablo R. <rom...@ho...> - 2009年03月17日 06:40:27
Im having an issue with the plotting of contours using basemap.
 
My contours are incorrectly being plotted on top of my basemap coastlines&continents.
 
Ive attached an image as an example:
Note that the red contour lines near land areas are OVERLAPPING the coastlines & continents, instead of being plotted BELOW them.
 
Here are the commands that I used to create this image (in the same order that I called them...)
 
m=basemap(...)
Z=create_my_data_array(...)
 
...
 
cs=m.contour(X,Y,Z,linewidths=1.25)
m.drawcoastlines()
m.fillcontinents(color='grey')
 
Since I am calling the 'm.drawcoastlines()' and 'm.fillcontinents()' functions AFTER having plotted my contours, I would expect that the coastlines & continents would be plotted ON TOP of the previously drawn contours. 
Is this correct?
 
This appears to work fine for the 'basemap.contourf()' but not for the 'basemap.contour()' function.
 
Is this a bug, or by design?
 
How can I go about correcting this, so that the 'basemap.contour()' function draws the contours BEFORE drawing the coastlines & filled continents?
 
Please help,
Thanks,
 
P.Romero
_________________________________________________________________
Windows LiveTM: Life without walls.
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_allup_1a_explore_032009 
From: Pablo R. <rom...@ho...> - 2009年03月17日 06:28:40
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.
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 
From: Jeff W. <js...@fa...> - 2009年03月17日 00:54:26
Brian Granger wrote:
> Hi,
>
> matplotlib 0.98.3 runs fine on my system. However, when I do "ipython
> -pylab" with 0.98.5.2 on OS X, I get:
>
> from matplotlib import ft2font
> ImportError: dlopen(/Users/bgranger/Library/Python/2.5/site-packages/matplotlib/ft2font.so,
> 2): Symbol not found: _FT_Get_PS_Font_Info
> Referenced from:
> /Users/bgranger/Library/Python/2.5/site-packages/matplotlib/ft2font.so
> Expected in: /usr/local/lib/libfreetype.6.dylib
>
> I am using the system freetype lib. Does anyone have any hints on
> hunting this one down?
>
> Thanks,
>
> Brian
> 
Brian: The "system" freetype lib (that comes with Apple X11) is in 
/usr/X11/lib, not /usr/local/lib. You must have installed an older 
version of freetype in /usr/local, which matplotlib linked against.
-Jeff
From: Brian G. <ell...@gm...> - 2009年03月17日 00:09:26
Hi,
matplotlib 0.98.3 runs fine on my system. However, when I do "ipython
-pylab" with 0.98.5.2 on OS X, I get:
 from matplotlib import ft2font
ImportError: dlopen(/Users/bgranger/Library/Python/2.5/site-packages/matplotlib/ft2font.so,
2): Symbol not found: _FT_Get_PS_Font_Info
 Referenced from:
/Users/bgranger/Library/Python/2.5/site-packages/matplotlib/ft2font.so
 Expected in: /usr/local/lib/libfreetype.6.dylib
I am using the system freetype lib. Does anyone have any hints on
hunting this one down?
Thanks,
Brian

Showing 17 results of 17

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