8000 Merge pull request #4553 from grlee77/axes3D_clear · matplotlib/matplotlib@44ee7f9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 44ee7f9

Browse files
committed
Merge pull request #4553 from grlee77/axes3D_clear
BUG fix: prevent 2D axis from showing up after calling Axes3D.cla()
2 parents 42f09b6 + 7d11149 commit 44ee7f9

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ def cla(self):
963963
self.patch.set_linewidth(0)
964964
self.patch.set_transform(self.transAxes)
965965

966-
self.axison = True
966+
self.set_axis_on()
967967

968968
self.xaxis.set_clip_path(self.patch)
969969
self.yaxis.set_clip_path(self.patch)
Loading

lib/mpl_toolkits/tests/test_mplot3d.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,15 @@ def test_axes3d_labelpad():
257257
tick.set_pad(tick.get_pad() - i * 5)
258258

259259

260+
@image_comparison(baseline_images=['axes3d_cla'], extensions=['png'])
261+
def test_axes3d_cla():
262+
# fixed in pull request 4553
263+
fig = plt.figure()
264+
ax = fig.add_subplot(1,1,1, projection='3d')
265+
ax.set_axis_off()
266+
ax.cla() # make sure the axis displayed is 3D (not 2D)
267+
268+
260269
if __name__ == '__main__':
261270
import nose
262271
nose.runmodule(argv=['-s', '--with-doctest'], exit=False)

0 commit comments

Comments
 (0)
0