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
AttributeError: 'Patch3DCollection' object has no attribute 'set_sizes' #2732
Conversation
Thanks @glyg - confirming this bug. I was worried that this was a result of a PR which I merged recently, but it seems that this has been broken since July:
@mdboom - any ideas. Pinging @WeatherGod also. |
mplot3d seems to do some funky things like changing the class of the Collection on the fly (as weird as that is, it's probably the best way available). Unfortunately, it seems to convert everything to a Patch3DCollection, regardless of the original class, and I've attached a possible fix to this issue. It is not ready to merge, as it needs a test and some renaming of functions and updating of docstrings etc. but I want to run it through Travis to make sure it's a viable solution before proceeding further. |
@@ -343,7 +343,7 @@ def do_3d_projection(self, renderer): | |||
self._alpha = None | |||
self.set_facecolors(zalpha(self._facecolor3d, vzs)) | |||
self.set_edgecolors(zalpha(self._edgecolor3d, vzs)) | |||
PatchCollection.set_offsets(self, list(zip(vxs, vys))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just looking at the github diffs, so don't have full context of the class, but this looks like it is in a method called do_3d_projection
. In which case, can you not just call self.set_offsets
?
Hi, Just so you now, this PR fixes the issue for me, so thanks a lot!! |
@WeatherGod: Does my suggested fix make sense to you? |
This PR fixes the initial issue for me as well, but I've also found a related issue for the same minimal example:
It's possible that this particular problem is specific to the OSX backend. |
@perimosocordiae: Your suggested fix makes sense. I think the OS-X backend did not get updated when the transforms was changed to a single numpy array. I'm going to add it here. |
AttributeError: 'Patch3DCollection' object has no attribute 'set_sizes'
Hi,
I'm running into a bug with
scatter3D
in mplot3d when ran from python 3.3I'm using the latest build from github (#e6f899338cb311ad80e89968271944fbdc7b7d7b)
Here is a minimal example:
It fails with the following error:
Looks like the
Patch3DCollection
instance doesn't inherits properly from_CollectionWithSizes
Best,
Guillaume