Closed soxofaan closed 5 years ago
Hey, thank you very much for your feedback.
I am not using labelled lines and dates personally so it would be hard for me to figure out a workaround.
This should however be fixable by modifying the labelLine function (https://github.com/cphyc/matplotlib-label-lines/blob/81daa2d2e0af1b620bd76cb8257beb1749b34549/labellines/core.py#L37) and add support for datetimes.
This could be as simple as replacing https://github.com/cphyc/matplotlib-label-lines/blob/81daa2d2e0af1b620bd76cb8257beb1749b34549/labellines/core.py#L24 by
xdata = line.get_xdata()
if isinstance(xdata[0], datetime):
xdate = [date2num(_) for _ in xdata]
and the same for ydata.
I found some time to work on this: see PR #8
This should be fixed by #8 so I'm closing for now.
Hi, thanks for this great matplotlib "plugin"
I couldn't get it to work yet on pandas based plots with a DatetimeIndex:
Any ideas, and is there any interest in supporting this? I already had a quick look, but couldn't find a quick fix yet as date handling is quite messy territory