Michael Droettboom wrote:
> This is a long-standing known issue with the contour code.  The 
> contouring library we are using (in cntr.c) was written for a graphics 
> library that did not support compound paths, so to draw a donut-shaped 
> objects it creates "cut paths" from the inner to outer edge.  A number 
> of the matplotlib developers have taken stabs at changing this behavior 
> over the years, but it is a very opaque chunk of code, and none of us 
> have managed it without introducing new more serious errors.  A fresh 
> set of eyes may be able to sort it out, and we do have compound path 
> support in all backends (save the mostly obsolete Gdk) now.  Replacing 
> the contouring code with something else that is license-compatible is 
> also an option, but I wasn't able to find anything suitable last time I 
> looked (which was a long time ago now).

I have been looking about every 6 months for years, with absolutely no 
success.  There are remarkably few filled-contouring codes (or detailed 
algorithm descriptions) out there, under any license.  Note also that 
the code Matlab uses (or at least used a long time ago when I last 
looked) handles the problem by layering the contour patches, not by 
leaving holes, so it is an example of a class of algorithms that would 
not work with non-unit alpha. I have also thought a bit about 
manipulating the paths generated by the present code to remove the cuts, 
or manipulating the non-filled contour output to generate patch 
boundaries, but I haven't gone into it deeply.  I suspect it would 
quickly become very complicated.  And, on top of all that, even if we 
solved the cut problem, there would still be backend-dependent artifacts 
involved in rendering the boundaries.

Eric

> 
> Cheers,
> Mike
> 
> Joseph Smidt wrote:
>> I am making contourf  plots with some transparency as I want to
>> eventually overlay such plots. When I plot such plots I see artifacts
>> or lines that shouldn't be there as seen here:
>> http://josephsmidt.googlepages.com/ex.png
>>
>>     Is this a bug or am I plotting incorrectly?  My script is here:
>> http://josephsmidt.googlepages.com/plotex.py and the data needed for
>> the plot is here: http://josephsmidt.googlepages.com/exCHI.txt
>>
>> However, the relevant part of the code for plotting I'll just cut and
>> paste here:
>>
>> levels = [x0, x1, x2, x3]
>> contourf(Y,X,transpose(CHI),levels,alpha=0.7)
>> show()
>>
>>       Thanks.
>>
>>                        Joseph Smidt
>>
>>
>>   
> 


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to