When adding a vline to a plot with a logarithmic x-axis, the x parameter is interpreted differently for annotations than it is for the placement of the line. The lines are placed at the literal x-location on the x-axis, while annotations are placed at the 10^x location.
For example, using the literal location will produce the line as intended, but the annotations are missing because they're off at 10^25.
fig.add_vline(
x=25,
annotation_text='25'
)
If I were to input the x parameter using the 10^n convention used throughout plotly for log plots, then I get the correct annotations, but the line will now be located off at log(25) (≈1.38).
When adding a
vline
to a plot with a logarithmic x-axis, thex
parameter is interpreted differently for annotations than it is for the placement of the line. The lines are placed at the literal x-location on the x-axis, while annotations are placed at the 10^x location.For example, using the literal location will produce the line as intended, but the annotations are missing because they're off at 10^25.
If I were to input the
x
parameter using the 10^n convention used throughout plotly for log plots, then I get the correct annotations, but the line will now be located off at log(25) (≈1.38).I'm on Windows 10 using Plotly v5.9.0 and Python 3.9.15.