Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PolyCollection path closing is projected incorrectly by add_collection3d #2045

Closed
cgevans opened this issue May 22, 2013 · 3 comments
Closed

Comments

@cgevans
Copy link
Contributor

cgevans commented May 22, 2013

This is in reference to this StackOverflow question, where I describe the issue.

PolyCollection has a closed option, which is set to True by default. In True, the paths it uses are explicitly created with a CLOSEPATH code at the end, closing the path. If False, the path does not have this final code, and should not be closed. This works correctly for 2D.

In converting a PolyCollection to a Poly3DCollection, this option is ignored. In path_to_3d_segment, the codes of each vertex are ignored, meaning that, for closed paths, the 0,0 final vertex is interpreted as an actual vertex. Thus this only works correctly for paths that are not closed.

Then, these vertexes, after projection, are sent to Poly3DCollection.set_verts with closed=True. The result is that if the user sets closed=True, the Poly3DCollection has an extra point at the origin, and if the user sets closed=False, the Poly3DCollection is closed.

@WeatherGod
Copy link
Member

Hmmm, this has given me a different perspective on a long running issue.
Let me hack away at something for a few minutes and I might have a partial
solution for you.

On Tue, May 21, 2013 at 8:37 PM, Constantine Evans <notifications@github.com

wrote:

This is in reference to this StackOverflow questionhttp://stackoverflow.com/questions/16305256/couldnt-remove-origin-point-in-matplotlib-polycollection/16681073#16681073,
where I describe the issue.

PolyCollection has a closed option, which is set to True by default. In
True, the paths it uses are explicitly created with a CLOSEPATH code at the
end, closing the path. If False, the path does not have this final code,
and should not be closed. This works correctly for 2D.

In converting a PolyCollection to a Poly3DCollection, this option is
ignored. In path_to_3d_segment, the codes of each vertex are ignored,
meaning that, for closed paths, the 0,0 final vertex is interpreted as an
actual vertex. Thus this only works correctly for paths that are not closed.

Then, these vertexes, after projection, are sent to
Poly3DCollection.set_verts with closed=True. The result is that if the
user sets closed=True, the Poly3DCollection has an extra point at the
origin, and if the user sets closed=False, the Poly3DCollection is closed.


Reply to this email directly or view it on GitHubhttps://github.com//issues/2045
.

@WeatherGod
Copy link
Member

Ok, didn't fix as much as I was hoping to, but might be a step forward.
I'll dig a little more and see if I can get a proposed tricontourf feature
working with minimal intervention.

On Tue, May 21, 2013 at 9:08 PM, Benjamin Root ben.root@ou.edu wrote:

Hmmm, this has given me a different perspective on a long running issue.
Let me hack away at something for a few minutes and I might have a partial
solution for you.

On Tue, May 21, 2013 at 8:37 PM, Constantine Evans <
notifications@github.com> wrote:

This is in reference to this StackOverflow questionhttp://stackoverflow.com/questions/16305256/couldnt-remove-origin-point-in-matplotlib-polycollection/16681073#16681073,
where I describe the issue.

PolyCollection has a closed option, which is set to True by default. In
True, the paths it uses are explicitly created with a CLOSEPATH code at the
end, closing the path. If False, the path does not have this final code,
and should not be closed. This works correctly for 2D.

In converting a PolyCollection to a Poly3DCollection, this option is
ignored. In path_to_3d_segment, the codes of each vertex are ignored,
meaning that, for closed paths, the 0,0 final vertex is interpreted as an
actual vertex. Thus this only works correctly for paths that are not closed.

Then, these vertexes, after projection, are sent to
Poly3DCollection.set_verts with closed=True. The result is that if the
user sets closed=True, the Poly3DCollection has an extra point at the
origin, and if the user sets closed=False, the Poly3DCollection is closed.


Reply to this email directly or view it on GitHubhttps://github.com//issues/2045
.

@tacaswell
Copy link
Member

closed by #3239

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants