-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Description
Bug summary
Axes3D.set_frame_on
is documented as "Set whether the 3D axes panels are drawn.". However, this is really what set_axis_on
and set_axis_off
does (and set_frame_on
doesn't do). (There is also get_frame_on
.)
matplotlib/lib/mpl_toolkits/mplot3d/axes3d.py
Lines 1337 to 1350 in 4fda5ff
def get_frame_on(self): | |
"""Get whether the 3D axes panels are drawn.""" | |
return self._frameon | |
def set_frame_on(self, b): | |
""" | |
Set whether the 3D axes panels are drawn. | |
Parameters | |
---------- | |
b : bool | |
""" | |
self._frameon = bool(b) | |
self.stale = True |
matplotlib/lib/mpl_toolkits/mplot3d/axes3d.py
Lines 176 to 182 in 4fda5ff
def set_axis_off(self): | |
self._axis3don = False | |
self.stale = True | |
def set_axis_on(self): | |
self._axis3don = True | |
self.stale = True |
Code for reproduction
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import axes3d
X, Y, Z = axes3d.get_test_data(0.05)
ax1 = plt.subplot(1, 2, 1, projection="3d")
ax1.plot_wireframe(X, Y, Z)
ax2 = plt.subplot(1, 2, 2, projection="3d")
ax2.plot_wireframe(X, Y, Z)
ax2.set_frame_on(False)
Actual outcome
Nothing is affected by set_frame_on
.
Expected outcome
It should do as documented.
Additional information
self._frameon
is set to False
in draw
. However removing this line does not change anything anyway.
matplotlib/lib/mpl_toolkits/mplot3d/axes3d.py
Line 445 in 4fda5ff
self._frameon = False |
I think that there are a few options:
- Remove
Axes3D.set_frame_on
andget_frame_on
. However, these will then be inherited fromAxes
, so not a good idea (although nothing is changed, documentation just more confusing). - Make
Axes3D.set_frame_on
callset_axis_on/off
, keep both. - Make
Axes3D.set_frame_on
modifyself._axison
instead and deprecateset_axis_on/off
.
The documentation for *_frame_on
should be adapted to set_axis_*
if kept and a get_axis_on
method should probably be added.
Operating system
No response
Matplotlib Version
main
Matplotlib Backend
No response
Python version
No response
Jupyter version
No response
Installation
git checkout