File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 16
16
import matplotlib .transforms as mtransforms
17
17
import matplotlib .units as munits
18
18
import numpy as np
19
+ import warnings
19
20
20
21
GRIDLINE_INTERPOLATION_STEPS = 180
21
22
@@ -981,13 +982,19 @@ def _update_ticks(self, renderer):
981
982
interval_expanded = interval [1 ], interval [0 ]
982
983
983
984
if hasattr (self , '_get_pixel_distance_along_axis' ):
985
+ # normally, one does not want to catch all exceptions that could possibly happen, but it
986
+ # is not clear exactly what exceptions might arise from a user's projection (their rendition
987
+ # of the Axis object). So, we catch all, with the idea that one would rather potentially
988
+ # lose a tick from one side of the axis or another, rather than see a stack trace.
984
989
try :
985
990
ds1 = self ._get_pixel_distance_along_axis (interval_expanded [0 ], - 0.5 )
986
991
except :
992
+ warnings .warn ("Unable to find pixel distance along axis for interval padding; assuming no interval padding needed." )
987
993
ds1 = 0.0
988
994
try :
989
995
ds2 = self ._get_pixel_distance_along_axis (interval_expanded [1 ], + 0.5 )
990
996
except :
997
+ warnings .warn ("Unable to find pixel distance along axis for interval padding; assuming no interval padding needed." )
991
998
ds2 = 0.0
992
999
interval_expanded = (interval [0 ] - ds1 , interval [1 ] + ds2 )
993
1000
You can’t perform that action at this time.
0 commit comments