Can you please tell me why fig.update_yaxes(title=dict(text="$\text{This is a test:} \sqrt{2^4}$")
does not work in the following code
import plotly.express as px
fig = px.bar(df, x=["Apples", "Oranges"], y=[10,20], color=["Here", "There"],
labels=dict(x="Fruit", y="Amount", color="Place")
)
fig.update_yaxes(title=dict(text="$\text{This is a test:} \sqrt{2^4}$", font_size=16)
)
fig.show()
gives
To know for sure why it's not working on your end I would have to know:
plotly version
, andJupyterLab?
), andenough space for your title
where you're outputting your figure.Because it works fine on my end:
I'm running Plotly '4.14.3'
in JupyterLab.
import plotly.express as px
fig = px.bar(df, x=["Apples", "Oranges"], y=[10,20], color=["Here", "There"],
labels=dict(x="Fruit", y="Amount", color="Place")
)
fig.update_yaxes(title=dict(text="$\text{This is a test:} \sqrt{2^4}$", font_size=16)
)
fig.show()
It turns out that this issue might be related to the browser your running. I'm running Microsoft Edge at the moment. But here's the same code and figure using Chrome wiht no title: