Skip to content

Commit 6e13a10

Browse files
committed
Deprecate Axes3D.w_{x,y,z}axis in favor of .{x,y,z}axis.
1 parent 6665bc7 commit 6e13a10

File tree

4 files changed

+26
-12
lines changed

4 files changed

+26
-12
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ The following modules are deprecated:
1111
The following classes, methods, functions, and attributes are deprecated:
1212

1313
- ``afm.parse_afm``,
14+
- ``axes3d.Axes3D.w_xaxis``, ``.w_yaxis``, and ``.w_zaxis`` (use ``.xaxis``,
15+
``.yaxis``, and ``.zaxis`` instead),
1416
- ``backend_pgf.get_texcommand``,
1517
- ``backend_ps.get_bbox``,
1618
- ``backend_qt5.error_msg_qt``, ``backend_qt5.exception_handler``,

examples/mplot3d/surface3d_3.py

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

3939
# Customize the z axis.
4040
ax.set_zlim(-1, 1)
41-
ax.w_zaxis.set_major_locator(LinearLocator(6))
41+
ax.zaxis.set_major_locator(LinearLocator(6))
4242

4343
plt.show()

examples/pyplots/whats_new_1_subplot3d.py

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

26-
#ax.w_zaxis.set_major_locator(LinearLocator(10))
27-
#ax.w_zaxis.set_major_formatter(FormatStrFormatter('%.03f'))
26+
#ax.zaxis.set_major_locator(LinearLocator(10))
27+
#ax.zaxis.set_major_formatter(FormatStrFormatter('%.03f'))
2828

2929
fig.colorbar(surf, shrink=0.5, aspect=5)
3030

lib/mpl_toolkits/mplot3d/axes3d.py

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

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

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

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

0 commit comments

Comments
 (0)