@@ -1052,50 +1052,8 @@ def _update_ticks(self, renderer):
1052
1052
ihigh = locs [- 1 ]
1053
1053
tick_tups = [ti for ti in tick_tups if ilow <= ti [1 ] <= ihigh ]
1054
1054
1055
- # so that we don't lose ticks on the end, expand out the interval ever
1056
- # so slightly. The "ever so slightly" is defined to be the width of a
1057
- # half of a pixel. We don't want to draw a tick that even one pixel
1058
- # outside of the defined axis interval.
1059
- if interval [0 ] <= interval [1 ]:
1060
- interval_expanded = interval
1061
- else :
1062
- interval_expanded = interval [1 ], interval [0 ]
1063
-
1064
- if hasattr (self , '_get_pixel_distance_along_axis' ):
1065
- # normally, one does not want to catch all exceptions that
1066
- # could possibly happen, but it is not clear exactly what
1067
- # exceptions might arise from a user's projection (their
1068
- # rendition of the Axis object). So, we catch all, with
1069
- # the idea that one would rather potentially lose a tick
1070
- # from one side of the axis or another, rather than see a
1071
- # stack trace.
1072
- # We also catch users warnings here. These are the result of
1073
- # invalid numpy calculations that may be the result of out of
1074
- # bounds on axis with finite allowed intervals such as geo
1075
- # projections i.e. Mollweide.
1076
- with np .errstate (invalid = 'ignore' ):
1077
- try :
1078
- ds1 = self ._get_pixel_distance_along_axis (
1079
- interval_expanded [0 ], - 0.5 )
1080
- except Exception :
1081
- warnings .warn ("Unable to find pixel distance along axis "
1082
- "for interval padding of ticks; assuming no "
1083
- "interval padding needed." )
1084
- ds1 = 0.0
1085
- if np .isnan (ds1 ):
1086
- ds1 = 0.0
1087
- try :
1088
- ds2 = self ._get_pixel_distance_along_axis (
1089
- interval_expanded [1 ], + 0.5 )
1090
- except Exception :
1091
- warnings .warn ("Unable to find pixel distance along axis "
1092
- "for interval padding of ticks; assuming no "
1093
- "interval padding needed." )
1094
- ds2 = 0.0
1095
- if np .isnan (ds2 ):
1096
- ds2 = 0.0
1097
- interval_expanded = (interval_expanded [0 ] - ds1 ,
1098
- interval_expanded [1 ] + ds2 )
1055
+ if interval [1 ] <= interval [0 ]:
1056
+ interval = interval [1 ], interval [0 ]
1099
1057
1100
1058
ticks_to_draw = []
1101
1059
for tick , loc , label in tick_tups :
@@ -1105,7 +1063,7 @@ def _update_ticks(self, renderer):
1105
1063
tick .update_position (loc )
1106
1064
tick .set_label1 (label )
1107
1065
tick .set_label2 (label )
1108
- if not mtransforms .interval_contains (interval_expanded , loc ):
1066
+ if not mtransforms .interval_contains (interval , loc ):
1109
1067
continue
1110
1068
ticks_to_draw .append (tick )
1111
1069
0 commit comments