I am testing plotly express.
I have the latest version: 0.4.1
I am trying to plot the most basic chart in their tutorial but it's throwing an error:
import plotly.express as px
df = px.data.iris()
fig = px.scatter(df, x="petal_length", y="petal_width")
fig.add_vline(x=2.5, line_width=3, line_dash="dash", line_color="green")
fig.add_hrect(y0=0.9, y1=2.6, line_width=0, fillcolor="red", opacity=0.2)
fig.show()
AttributeError: 'Figure' object has no attribute 'add_vline'
Am I doing something wrong?
All I want to do is to get add_vline working.
It's the second example on the how-to guide here: https://plotly.com/python/horizontal-vertical-shapes/

add_vlineis introduced in plotly 4.12. Please update your package.