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 <efir...@hawaii.edu> 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/matplotlib-users@lists.sourceforge.net/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
>> Matplotlib-users@lists.sourceforge.net
>> 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
> Matplotlib-users@lists.sourceforge.net
> 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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to