I expected the line to cross through the point. if I change the value of the hline to a different value, the plot works as expected. Below is the code snippet as part of a Dash callback:
I would guess you observe this due to precision issues. Are you sure, the exact coordinate is -5.25? You might check this or fix the y- axis range to fig.update(layout_yaxis_range = [-10,0])
Hi @AIMPED, yes the exact value is -5.25, I tried -5.20 and that worked as expected. It only does not work when the hline value is equivalent to the y-axis value of the scatter point. I was passing a variable into the y arg of add_hline and I made sure I had rounded it off to 2dp as well.
I think if you plot more than one point, you will not observe this behavior.
Itβs not a very satisfying answer, but I have no idea what is happening and unfortunately with your given code snippet I canβt reproduce your problem.