We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9491ed3 commit b64a6b4Copy full SHA for b64a6b4
labellines/core.py
@@ -185,14 +185,13 @@ def labelLines(
185
xvals = (xvals[0] + shrinkage, xvals[1] - shrinkage)
186
187
if isinstance(xvals, tuple) and len(xvals) == 2:
188
- xmin, xmax = xvals
189
- xscale = ax.get_xscale()
190
-
191
# Convert datetime objects to numeric values for linspace/geomspace
192
- x_is_datetime = isinstance(xmin, datetime) or isinstance(xmax, datetime)
+ x_is_datetime = isinstance(xvals[0], datetime)
193
if x_is_datetime:
194
- xmin = plt.matplotlib.dates.date2num(xmin)
195
- xmax = plt.matplotlib.dates.date2num(xmax)
+ xvals = plt.matplotlib.dates.date2num(xvals)
+
+ xmin, xmax = xvals
+ xscale = ax.get_xscale()
196
197
if xscale == "log":
198
xvals = np.geomspace(xmin, xmax, len(all_lines) + 2)[1:-1]
0 commit comments