File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -185,14 +185,13 @@ def labelLines(
185
185
xvals = (xvals [0 ] + shrinkage , xvals [1 ] - shrinkage )
186
186
187
187
if isinstance (xvals , tuple ) and len (xvals ) == 2 :
188
- xmin , xmax = xvals
189
- xscale = ax .get_xscale ()
190
-
191
188
# Convert datetime objects to numeric values for linspace/geomspace
192
- x_is_datetime = isinstance (xmin , datetime ) or isinstance ( xmax , datetime )
189
+ x_is_datetime = isinstance (xvals [ 0 ] , datetime )
193
190
if x_is_datetime :
194
- xmin = plt .matplotlib .dates .date2num (xmin )
195
- xmax = plt .matplotlib .dates .date2num (xmax )
191
+ xvals = plt .matplotlib .dates .date2num (xvals )
192
+
193
+ xmin , xmax = xvals
194
+ xscale = ax .get_xscale ()
196
195
197
196
if xscale == "log" :
198
197
xvals = np .geomspace (xmin , xmax , len (all_lines ) + 2 )[1 :- 1 ]
You can’t perform that action at this time.
0 commit comments