9
9
Module containing Axes3D, an object which can plot 3D objects on a
10
10
2D matplotlib figure.
11
11
"""
12
+
12
13
from collections import defaultdict
13
14
from functools import reduce
14
15
import math
@@ -140,14 +141,6 @@ def set_axis_on(self):
140
141
self ._axis3don = True
141
142
self .stale = True
142
143
143
- def have_units (self ):
144
- """
145
- Return *True* if units are set on the *x*, *y*, or *z* axes
146
-
147
- """
148
- return (self .xaxis .have_units () or self .yaxis .have_units () or
149
- self .zaxis .have_units ())
150
-
151
144
def convert_zunits (self , z ):
152
145
"""
153
146
For artists in an axes, if the zaxis has units support,
@@ -187,11 +180,10 @@ def _process_unit_info(self, xdata=None, ydata=None, zdata=None,
187
180
def set_top_view (self ):
188
181
# this happens to be the right view for the viewing coordinates
189
182
# moved up and to the left slightly to fit labels and axes
190
- xdwl = (0.95 / self .dist )
191
- xdw = (0.9 / self .dist )
192
- ydwl = (0.95 / self .dist )
193
- ydw = (0.9 / self .dist )
194
-
183
+ xdwl = 0.95 / self .dist
184
+ xdw = 0.9 / self .dist
185
+ ydwl = 0.95 / self .dist
186
+ ydw = 0.9 / self .dist
195
187
# This is purposely using the 2D Axes's set_xlim and set_ylim,
196
188
# because we are trying to place our viewing pane.
197
189
super ().set_xlim (- xdwl , xdw , auto = None )
@@ -328,7 +320,7 @@ def get_axis_position(self):
328
320
def _on_units_changed (self , scalex = False , scaley = False , scalez = False ):
329
321
"""
330
322
Callback for processing changes to axis units.
331
-
323
+ 
332
324
Currently forces updates of data limits and view limits.
333
325
"""
334
326
self .relim ()
@@ -1093,12 +1085,8 @@ def can_pan(self):
1093
1085
return False
1094
1086
1095
1087
def cla (self ):
1096
- """
1097
- Clear axes
1098
- """
1099
- # Disabling mouse interaction might have been needed a long
1100
- # time ago, but I can't find a reason for it now - BVR (2012-03)
1101
- #self.disable_mouse_rotation()
1088
+ # docstring inherited.
1089
+
1102
1090
super ().cla ()
1103
1091
self .zaxis .cla ()
1104
1092
@@ -1121,12 +1109,10 @@ def cla(self):
1121
1109
self .grid (rcParams ['axes3d.grid' ])
1122
1110
1123
1111
def disable_mouse_rotation (self ):
1124
- """Disable mouse button callbacks.
1125
- """
1112
+ """Disable mouse button callbacks."""
1126
1113
# Disconnect the various events we set.
1127
1114
for cid in self ._cids :
1128
1115
self .figure .canvas .mpl_disconnect (cid )
1129
-
1130
1116
self ._cids = []
1131
1117
1132
1118
def _button_press (self , event ):
0 commit comments