We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e775eac commit 501eb12Copy full SHA for 501eb12
labellines/core.py
@@ -238,7 +238,12 @@ def labelLines(
238
xvals[i] = new_xv # type: ignore
239
240
# Convert float values back to datetime in case of datetime axis
241
- if isinstance(ax.xaxis.converter, DateConverter):
+ mpl_version = tuple(int(_) for _ in plt.matplotlib.__version__.split("."))
242
+ if mpl_version < (3, 10, 0):
243
+ converter = ax.xaxis.converter
244
+ else:
245
+ converter = ax.xaxis.get_converter()
246
+ if isinstance(converter, DateConverter):
247
xvals = [
248
num2date(x).replace(tzinfo=ax.xaxis.get_units())
249
for x in xvals # type: ignore
0 commit comments