-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Patch3D constructor fundamentally incorrect. #23624
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
Comments
We have never noticed this before because I do not think we ever actually call this Given that matplotlib/lib/mpl_toolkits/mplot3d/art3d.py Lines 371 to 383 in a68f21f
super().__init__ is done ) maybe the right thing to do (version of 3).
|
I haven't looked into the issue or the proposed solutions. I just want to note: If we never use |
Raising |
To be precise, we’d need to raise |
Uh oh!
There was an error while loading. Please reload this page.
Summary
Consider the following code:
matplotlib/lib/mpl_toolkits/mplot3d/art3d.py
Lines 327 to 334 in a68f21f
set_3d_properties
should be passed averts
argument, but is not passed that in the constructor.It is not clear how to get rid of that.
A few points worth considering:
DeprecationWarning
when usingPatch3D
#21740verts=None
inset_3d_properties
and then set it toget_verts
may be a feasible solution, but will break as_path2s
is not set here. For subclasses defining their ownget_path
or_path2d
it would make sense though.set_3d_properties
with an empty verts, but the only benefit is that_segment3d
is set (to an empty list.This seems to have been the case since the very first commit of mplot3d.
Proposed fix
I see a few possible solutions:
__init__
method completely. A bit weird since one can passzs
andzdir
to all other 3D methods.verts
kw args so that one can construct the patch directly. This seems to not be the case forPatch
though which must be subclassed(?).verts=self.get_verts()
which will allow subclasses to work properly, but disallows instantiating aPatch3D
directly.get_verts()
4 is probably the safest.
The text was updated successfully, but these errors were encountered: