8000 Deprecate Axes3D.w_{x,y,z}axis in favor of .{x,y,z}axis. · matplotlib/matplotlib@b48ac88 · GitHub
[go: up one dir, main page]

Skip to content

Commit b48ac88

Browse files
committed
Deprecate Axes3D.w_{x,y,z}axis in favor of .{x,y,z}axis.
1 parent 13629a4 commit b48ac88

File tree

5 files changed

+29
-71
lines changed

5 files changed

+29
-71
lines changed

doc/api/next_api_changes/2018-02-15-AL-deprecations.rst

Lines changed: 0 additions & 59 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Deprecations
2+
````````````
3+
4+
``axes3d.Axes3D.w_xaxis``, ``.w_yaxis``, and ``.w_zaxis`` are deprecated (use
5+
``.xaxis``, ``.yaxis``, and ``.zaxis`` instead).

examples/mplot3d/surface3d_3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@
3939

4040
# Customize the z axis.
4141
ax.set_zlim(-1, 1)
42-
ax.w_zaxis.set_major_locator(LinearLocator(6))
42+
ax.zaxis.set_major_locator(LinearLocator(6))
4343

4444
plt.show()

examples/pyplots/whats_new_1_subplot3d.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
linewidth=0, antialiased=False)
2626
ax.set_zlim3d(-1.01, 1.01)
2727

28-
#ax.w_zaxis.set_major_locator(LinearLocator(10))
29-
#ax.w_zaxis.set_major_formatter(FormatStrFormatter('%.03f'))
28+
#ax.zaxis.set_major_locator(LinearLocator(10))
29+
#ax.zaxis.set_major_formatter(FormatStrFormatter('%.03f'))
3030

3131
fig.colorbar(surf, shrink=0.5, aspect=5)
3232

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -193,19 +193,31 @@ def set_top_view(self):
193193

194194
def _init_axis(self):
195195
'''Init 3D axes; overrides creation of regular X/Y axes'''
196-
self.w_xaxis = axis3d.XAxis('x', self.xy_viewLim.intervalx,
197-
self.xy_dataLim.intervalx, self)
198-
self.xaxis = self.w_xaxis
199-
self.w_yaxis = axis3d.YAxis('y', self.xy_viewLim.intervaly,
200-
self.xy_dataLim.intervaly, self)
201-
self.yaxis = self.w_yaxis
202-
self.w_zaxis = axis3d.ZAxis('z', self.zz_viewLim.intervalx,
203-
self.zz_dataLim.intervalx, self)
204-
self.zaxis = self.w_zaxis
196+
self.xaxis = axis3d.XAxis('x', self.xy_viewLim.intervalx,
197+
self.xy_dataLim.intervalx, self)
198+
self.yaxis = axis3d.YAxis('y', self.xy_viewLim.intervaly,
199+
self.xy_dataLim.intervaly, self)
200+
self.zaxis = axis3d.ZAxis('z', self.zz_viewLim.intervalx,
201+
self.zz_dataLim.intervalx, self)
205202

206203
for ax in self.xaxis, self.yaxis, self.zaxis:
207204
ax.init3d()
208205

206+
@cbook.deprecated("3.1", alternative="xaxis", removal=False)
207+
@property
208+
def w_xaxis(self):
209+
return self.xaxis
210+
211+
@cbook.deprecated("3.1", alternative="yaxis", removal=False)
212+
@property
213+
def w_yaxis(self):
214+
return self.yaxis
215+
216+
@cbook.deprecated("3.1", alternative="zaxis", removal=False)
217+
@property
218+
def w_zaxis(self):
219+
return self.zaxis
220+
209221
def get_children(self):
210222
return [self.zaxis] + super().get_children()
211223

0 commit comments

Comments
 (0)
0