We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0fa325f commit 5ec1aceCopy full SHA for 5ec1ace
labellines/core.py
@@ -191,6 +191,10 @@ def labelLines(
191
# Convert datetime objects to numeric values for linspace/geomspace
192
x_is_datetime = isinstance(xmin, datetime) or isinstance(xmax, datetime)
193
if x_is_datetime:
194
+ if not isinstance(xmin, datetime) or not isinstance(xmax, datetime):
195
+ raise ValueError(
196
+ f"Cannot mix datetime and numeric values in xvals: {xvals}"
197
+ )
198
xmin = plt.matplotlib.dates.date2num(xmin)
199
xmax = plt.matplotlib.dates.date2num(xmax)
200
0 commit comments