File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -283,17 +283,22 @@ def labelLines(
283
283
else :
284
284
converter = ax .xaxis .get_converter ()
285
285
time_classes = (_SwitchableDateConverter , DateConverter , ConciseDateConverter )
286
- if isinstance (converter , time_classes ):
286
+ if xvals is None :
287
+ raise ValueError (
288
+ "xvals must be a tuple of two floats or a list of floats."
289
+ f"Got { xvals } instead."
290
+ )
291
+ elif isinstance (converter , time_classes ):
287
292
xvals_dates = []
288
- for x in xvals : # type: ignore
293
+ for x in xvals :
289
294
if isinstance (x , datetime ):
290
295
x_datetime = x
291
296
elif isinstance (x , np .datetime64 ):
292
297
x_datetime = x .astype (datetime )
293
298
else :
294
299
x_datetime = num2date (x )
295
300
xvals_dates .append (x_datetime .replace (tzinfo = ax .xaxis .get_units ()))
296
- xvals = xvals_dates # type: ignore
301
+ xvals = xvals_dates
297
302
298
303
txts = []
299
304
try :
You can’t perform that action at this time.
0 commit comments