@@ -526,8 +526,8 @@ def _set_lim_and_transforms(self):
526
526
self ._yaxis_text_transform = mtransforms .TransformWrapper (
527
527
self ._r_label_position + self .transData )
528
528
529
- def get_xaxis_transform (self ,which = 'grid' ):
530
- if which not in ['tick1' ,'tick2' ,'grid' ]:
529
+ def get_xaxis_transform (self , which = 'grid' ):
530
+ if which not in ['tick1' , 'tick2' , 'grid' ]:
531
531
msg = "'which' must be one of [ 'tick1' | 'tick2' | 'grid' ]"
532
532
raise ValueError (msg )
533
533
return self ._xaxis_transform
@@ -538,8 +538,8 @@ def get_xaxis_text1_transform(self, pad):
538
538
def get_xaxis_text2_transform (self , pad ):
539
539
return self ._xaxis_text2_transform , 'center' , 'center'
540
540
541
- def get_yaxis_transform (self ,which = 'grid' ):
542
- if which not in ['tick1' ,'tick2' ,'grid' ]:
541
+ def get_yaxis_transform (self , which = 'grid' ):
542
+ if which not in ['tick1' , 'tick2' , 'grid' ]:
543
543
msg = "'which' must be on of [ 'tick1' | 'tick2' | 'grid' ]"
544
544
raise ValueError (msg )
545
545
return self ._yaxis_transform
@@ -686,7 +686,7 @@ def set_theta_zero_location(self, loc, offset=0.0):
686
686
'S' : np .pi * 1.5 ,
687
687
'SE' : np .pi * 1.75 ,
688
688
'E' : 0 ,
689
- 'NE' : np .pi * 0.25 }
689
+ 'NE' : np .pi * 0.25 }
690
690
return self .set_theta_offset (mapping [loc ] + np .deg2rad (offset ))
691
691
692
692
def set_theta_direction (self , direction ):
@@ -707,7 +707,8 @@ def set_theta_direction(self, direction):
707
707
elif direction in (1 , - 1 ):
708
708
mtx [0 , 0 ] = direction
709
709
else :
710
- raise ValueError ("direction must be 1, -1, clockwise or counterclockwise" )
710
+ raise ValueError (
711
+ "direction must be 1, -1, clockwise or counterclockwise" )
711
712
self ._direction .invalidate ()
712
713
713
714
def get_theta_direction (self ):
@@ -773,6 +774,7 @@ def set_yscale(self, *args, **kwargs):
773
774
774
775
def set_rscale (self , * args , ** kwargs ):
775
776
return Axes .set_yscale (self , * args , ** kwargs )
777
+
776
778
def set_rticks (self , * args , ** kwargs ):
777
779
return Axes .set_yticks (self , * args , ** kwargs )
778
780
@@ -857,7 +859,8 @@ def set_rgrids(self, radii, labels=None, angle=None, fmt=None,
857
859
858
860
def set_xscale (self , scale , * args , ** kwargs ):
859
861
if scale != 'linear' :
860
- raise NotImplementedError ("You can not set the xscale on a polar plot." )
862
+ raise NotImplementedError (
863
+ "You can not set the xscale on a polar plot." )
861
864
862
865
def format_coord (self , theta , r ):
863
866
"""
@@ -868,7 +871,9 @@ def format_coord(self, theta, r):
868
871
# \u03b8: lower-case theta
869
872
# \u03c0: lower-case pi
870
873
# \u00b0: degree symbol
871
- return '\u03b8 =%0.3f\u03c0 (%0.3f\u00b0 ), r=%0.3f' % (theta , theta * 180.0 , r )
874
+ return '\u03b8 =%0.3f\u03c0 (%0.3f\u00b0 ), r=%0.3f' % (theta ,
875
+ theta * 180.0 ,
876
+ r )
872
877
873
878
def get_data_ratio (self ):
874
879
'''
@@ -877,7 +882,7 @@ def get_data_ratio(self):
877
882
'''
878
883
return 1.0
879
884
880
- ## # Interactive panning
885
+ # # # Interactive panning
881
886
882
887
def can_zoom (self ):
883
888
"""
@@ -887,7 +892,7 @@ def can_zoom(self):
887
892
"""
888
893
return False
889
894
890
- def can_pan (self ) :
895
+ def can_pan (self ):
891
896
"""
892
897
Return *True* if this axes supports the pan/zoom button functionality.
893
898
@@ -909,14 +914,13 @@ def start_pan(self, x, y, button):
909
914
mode = 'zoom'
910
915
911
916
self ._pan_start = cbook .Bunch (
912
- rmax = self .get_rmax (),
913
- trans = self .transData .frozen (),
914
- trans_inverse = self .transData .inverted ().frozen (),
915
- r_label_angle = self .get_rlabel_position (),
916
- x = x ,
917
- y = y ,
918
- mode = mode
919
- )
917
+ rmax = self .get_rmax (),
918
+ trans = self .transData .frozen (),
919
+ trans_inverse = self .transData .inverted ().frozen (),
920
+ r_label_angle = self .get_rlabel_position (),
921
+ x = x ,
922
+ y = y ,
923
+ mode = mode )
920
924
921
925
def end_pan (self ):
922
926
del self ._pan_start
@@ -987,7 +991,8 @@ def drag_pan(self, button, key, x, y):
987
991
# vertices = self.transform(vertices)
988
992
989
993
# result = np.zeros((len(vertices) * 3 - 2, 2), np.float_)
990
- # codes = mpath.Path.CURVE4 * np.ones((len(vertices) * 3 - 2, ), mpath.Path.code_type)
994
+ # codes = mpath.Path.CURVE4 * np.ones((len(vertices) * 3 - 2, ),
995
+ # mpath.Path.code_type)
991
996
# result[0] = vertices[0]
992
997
# codes[0] = mpath.Path.MOVETO
993
998
@@ -1024,8 +1029,8 @@ def drag_pan(self, button, key, x, y):
1024
1029
1025
1030
# result[3::3] = p1
1026
1031
1027
- # print vertices[-2:]
1028
- # print result[-2:]
1032
+ # print( vertices[-2:])
1033
+ # print( result[-2:])
1029
1034
1030
1035
# return mpath.Path(result, codes)
1031
1036
@@ -1039,12 +1044,13 @@ def drag_pan(self, button, key, x, y):
1039
1044
# maxtd = td.max()
1040
1045
# interpolate = np.ceil(maxtd / halfpi)
1041
1046
1042
- # print "interpolate", interpolate
1047
+ # print( "interpolate", interpolate)
1043
1048
# if interpolate > 1.0:
1044
1049
# vertices = self.interpolate(vertices, interpolate)
1045
1050
1046
1051
# result = np.zeros((len(vertices) * 3 - 2, 2), np.float_)
1047
- # codes = mpath.Path.CURVE4 * np.ones((len(vertices) * 3 - 2, ), mpath.Path.code_type)
1052
+ # codes = mpath.Path.CURVE4 * np.ones((len(vertices) * 3 - 2, ),
1053
+ # mpath.Path.code_type)
1048
1054
# result[0] = vertices[0]
1049
1055
# codes[0] = mpath.Path.MOVETO
1050
1056
@@ -1066,16 +1072,19 @@ def drag_pan(self, button, key, x, y):
1066
1072
1067
1073
# result[1::3, 0] = t0 + (tkappa * td_scaled)
1068
1074
# result[1::3, 1] = r0*hyp_kappa
1069
- # # result[1::3, 1] = r0 / np.cos(tkappa * td_scaled) # np.sqrt(r0*r0 + ravg_kappa*ravg_kappa)
1075
+ # # result[1::3, 1] = r0 / np.cos(tkappa * td_scaled)
1076
+ # # np.sqrt(r0*r0 + ravg_kappa*ravg_kappa)
1070
1077
1071
1078
# result[2::3, 0] = t1 - (tkappa * td_scaled)
1072
1079
# result[2::3, 1] = r1*hyp_kappa
1073
- # # result[2::3, 1] = r1 / np.cos(tkappa * td_scaled) # np.sqrt(r1*r1 + ravg_kappa*ravg_kappa)
1080
+ # # result[2::3, 1] = r1 / np.cos(tkappa * td_scaled)
1081
+ # # np.sqrt(r1*r1 + ravg_kappa*ravg_kappa)
1074
1082
1075
1083
# result[3::3, 0] = t1
1076
1084
# result[3::3, 1] = r1
1077
1085
1078
- # print vertices[:6], result[:6], t0[:6], t1[:6], td[:6], td_scaled[:6], tkappa
1086
+ # print(vertices[:6], result[:6], t0[:6], t1[:6], td[:6],
1087
+ # td_scaled[:6], tkappa)
1079
1088
# result = self.transform(result)
1080
1089
# return mpath.Path(result, codes)
1081
1090
# transform_path_non_affine = transform_path
0 commit comments