Jae-Joon Lee wrote:
> My understanding is that MOVETO in the middle of the path serve as a
> CLOSEPOLY when the path is filled. So, I don't think it actually
> matters how holes are connected each other. And as you can see, the
> largest hole is actually composed of three different polygons that
> overlaps, and the funny pattern is due to this overlaps.
> 
> The attached is my attempt to solve this problem. "remove_cuts"
> removes the cuts in a way that a hole becomes a single closed polygon,
> although I'm not sure if the code is rigorous enough. It seems to work
> okay for your sample data. It assumes that cuts are always vertical
> lines but this assumption can be dropped if we do bookkepping of all
> the path segments.
> I hope the code turns out to be work okay in general.
> 
> Ideally, it would be better if something similar would be done inside
> the contouring routine.

An implementation of the path conversion is now in the reorder() 
function in cntr.c; as of svn r7422, it is used by contourf (and by 
contour, although for line contours it is merely copying data into the 
output arrays).  In addition to the contourf_demo.py, I have tested it 
with basemap's simpletest.py and with random data, without detecting any 
obvious artifacts.  More testing is welcome, of course.

Eric

> 
> -JJ
> 
> 
> 
> On Thu, Aug 6, 2009 at 1:58 PM, Eric Firing<efir...@hawaii.edu> wrote:
>> Mike,
>>
>> When I eliminate the cuts from filled contour paths, I do find pathological
>> cases where the filling works correctly with the cuts in place, but not
>> without them.  Attached are a data file and a script to plot it,
>> illustrating the problem.  Is this due to a known limitation of filled
>> paths?  In the example, the top two holes are connected to the lower hole,
>> instead of being connected directly to the outer boundary of the filled
>> region.  Is this illegal?  If so, I think we are stuck, because rearranging
>> the paths that cntr makes to eliminate this type of case would likely be
>> very difficult.
>>
>> Eric
>>
>> ------------------------------------------------------------------------------
>> 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-devel mailing list
>> Matplotlib-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>>
>>
>>
>> ------------------------------------------------------------------------
>>


------------------------------------------------------------------------------
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-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to