On Mon, Nov 22, 2010 at 3:30 AM, Ian Thomas <ianthoma...@gmail.com> wrote:

> I've found a bug in mplot3d's rendering of filled contours.  Attached is a
> simple test script to reproduce the error and an example of the output: the
> 2D plot on the left shows the desired result, the 3D plot on the right shows
> the holes in the contour are not rendered correctly.
>
> Digging around in axes3d.py and art3d.py, I think the problem is that
> mplot3d ignores the 'codes' that are produced by the 2D contourf routine.  I
> am probably not using the correct terminology, but I understand that these
> codes allow a polygon to be composed of multiple line loops, some of which
> may be holes within other line loops.  By ignoring the codes, the 3D routine
> renders a single polygon by concatenating all the points together regardless
> of whether they correspond to a hole or not.
>
> In revision 8806 of lib/mpl_toolkits/mplot3d/art3d.py, lines 136-7:
>
>    for (((x, y), code), z) in zip(pathsegs, zs):
>         seg.append((x, y, z))
>
> The codes are extracted from the pathsegs (which come from the 2D contourf
> routine), but then ignored.
>
> I've taken a look at trying to fix this, but it was not obvious to me how
> to propagate the 'codes' rendering functionality from the 2D to 3D source
> code.  Perhaps someone more familiar with mplot3d could look at it.
>
> Thanks,
> Ian
>
>
Confirmed.  Ian, would you mind filing a bug report on this at mpl's
tracker?

http://sourceforge.net/tracker/?atid=560720&group_id=80706&func=browse

Thank you very much for your insightful analysis as well.  It will be
helpful in finding a fix for this.

Ben Root
------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to