I would like to create a plotly express line chart with a yaxis title that is positioned at the bottom of the axis instead of the center. This is what I have tried:
import pandas as pd
from plotly import express as px
df = pd.DataFrame({'x': range(0,10)})
fig = px.line(df).update_layout(yaxis_anchor='free', yaxis_position=0)
This is what I get:
This is the desired output:
CodePudding user response:
As far as I know, this location of the axes titles can't be changed. The argument yaxis_position=0
won't work because that changes the x coordinate of the yaxis in the plotting space.
However one possible workaround would be to set the yaxis title to an empty string, then place the text down as an