[英]Latex in y-axis title in plotly not working
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你能告诉我为什么
fig.update_yaxes(title=dict(text="$\text{This is a test:} \sqrt{2^4}$")
在以下代码中不起作用
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
, andplotly version
,和JupyterLab?
), andJupyterLab?
),以及enough space for your title
where you're outputting your figure.enough space for your title
。 Because it works fine on my end:因为它对我来说很好用:
I'm running Plotly '4.14.3'
in JupyterLab.我在 JupyterLab 中运行 Plotly
'4.14.3'
。
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.
我目前正在运行 Microsoft Edge。 But here's the same code and figure using Chrome wiht no title :
但这是使用 Chrome 的相同代码和图形,没有标题:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.