@@ -157,25 +157,26 @@ def get_axislabel_pos_angle(self, axes):
157
157
158
158
if self .nth_coord == 0 :
159
159
xx0 = self .value
160
- yy0 = (extremes [2 ]+ extremes [3 ])/ 2.
161
- dxx , dyy = 0. , abs (extremes [2 ]- extremes [3 ])/ 1000.
160
+ yy0 = (extremes [2 ] + extremes [3 ]) / 2
161
+ dxx = 0
162
+ dyy = abs (extremes [2 ] - extremes [3 ]) / 1000
162
163
elif self .nth_coord == 1 :
163
- xx0 = (extremes [0 ]+ extremes [1 ])/ 2.
164
+ xx0 = (extremes [0 ] + extremes [1 ]) / 2
164
165
yy0 = self .value
165
- dxx , dyy = abs (extremes [0 ]- extremes [1 ])/ 1000. , 0.
166
+ dxx = abs (extremes [0 ] - extremes [1 ]) / 1000
167
+ dyy = 0
166
168
167
169
grid_finder = self .grid_helper .grid_finder
168
- xx1 , yy1 = grid_finder .transform_xy ([xx0 ], [yy0 ])
170
+ ( xx1 ,), ( yy1 ,) = grid_finder .transform_xy ([xx0 ], [yy0 ])
169
171
170
172
trans_passingthrough_point = axes .transData + axes .transAxes .inverted ()
171
- p = trans_passingthrough_point .transform_point ([xx1 [ 0 ] , yy1 [ 0 ] ])
173
+ p = trans_passingthrough_point .transform_point ([xx1 , yy1 ])
172
174
173
175
if 0 <= p [0 ] <= 1 and 0 <= p [1 ] <= 1 :
174
- xx1c , yy1c = axes .transData .transform_point ([xx1 [0 ], yy1 [0 ]])
175
- xx2 , yy2 = grid_finder .transform_xy ([xx0 + dxx ], [yy0 + dyy ])
176
- xx2c , yy2c = axes .transData .transform_point ([xx2 [0 ], yy2 [0 ]])
177
-
178
- return (xx1c , yy1c ), np .arctan2 (yy2c - yy1c , xx2c - xx1c )/ np .pi * 180.
176
+ xx1c , yy1c = axes .transData .transform_point ([xx1 , yy1 ])
177
+ (xx2 ,), (yy2 ,) = grid_finder .transform_xy ([xx0 + dxx ], [yy0 + dyy ])
178
+ xx2c , yy2c = axes .transData .transform_point ([xx2 , yy2 ])
179
+ return (xx1c , yy1c ), np .rad2deg (np .arctan2 (yy2c - yy1c , xx2c - xx1c ))
179
180
else :
180
181
return None , None
181
182
0 commit comments