File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616import matplotlib .transforms as mtransforms
1717import matplotlib .units as munits
1818import numpy as np
19+ import warnings
1920
2021GRIDLINE_INTERPOLATION_STEPS = 180
2122
@@ -981,13 +982,19 @@ def _update_ticks(self, renderer):
981982 interval_expanded = interval [1 ], interval [0 ]
982983
983984 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.
984989 try :
985990 ds1 = self ._get_pixel_distance_along_axis (interval_expanded [0 ], - 0.5 )
986991 except :
992+ warnings .warn ("Unable to find pixel distance along axis for interval padding; assuming no interval padding needed." )
987993 ds1 = 0.0
988994 try :
989995 ds2 = self ._get_pixel_distance_along_axis (interval_expanded [1 ], + 0.5 )
990996 except :
997+ warnings .warn ("Unable to find pixel distance along axis for interval padding; assuming no interval padding needed." )
991998 ds2 = 0.0
992999 interval_expanded = (interval [0 ] - ds1 , interval [1 ] + ds2 )
9931000
You can’t perform that action at this time.
0 commit comments