You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
axvline incorrectly tries to handle unitized ymin, ymax #12198
line = plt.axvline(
x=.5, ymin=matplotlib.dates.num2date(1), ymax=matplotlib.dates.num2date(1.05))
line.set_clip_on(False)
and panning the axes around, one sees that matplotlib (3.0) converted ymin and ymax to the scalar values 1 and 1.05, which is not correct: ymin and ymax are values relative to the axes bounds and thus intrinsically unitless; passing unitized data to ymin or ymax should result in an error.
The same point likely applies to axhline, axvspan, axhspan.
But they haven't, they were converted back to a numerical value of 1/1.05 (which is probably still wrong). Panning around, the line always stays above the Axes.
Activity
jklymak commentedon Feb 11, 2019
This is still a bug...
worthy7 commentedon Aug 5, 2019
QuLogic commentedon May 7, 2020
I don't understand what panning has to do with this?
anntzer commentedon May 7, 2020
it's just to show that 1 and 1.05 have been interpreted as dates, not unitless axes-coordinates values.
QuLogic commentedon May 7, 2020
But they haven't, they were converted back to a numerical value of 1/1.05 (which is probably still wrong). Panning around, the line always stays above the Axes.
anntzer commentedon May 7, 2020
Oops sorry, I guess I misremebered the example's behavior... Well, backconversion to unitless values is also wrong :)