如何更改 plotly express 悬停数据中的货币格式?

How to change currency format in plotly express hover data?

我一直在尝试更改悬停数据中这个情节表达数字中的货币格式,但没有成功。我希望将其从美元更改为我的本国货币英镑。有谁知道我需要做什么才能实现这一目标?文档并没有真正涉及太多。

fig = px.bar(
df, 
x=df['cat_level2'], 
y=df['count'], 
labels={"cat_level2": "Category", "count": "Product Count", "max":"Maximum Price", "mean":"Average Price", "min":"Minimum Price"}, 
hover_name="cat_level2", 
hover_data={"cat_level2":False, "max":":$.2f", "mean":":$.2f", "min":":$.2f"}
)

fig.show()

如果我将 $ 符号更改为井号 (£),这会在图表工具提示中显示自定义数据。根据他们的说法,他们正在使用 d3 库进行货币格式化,该库声称使用系统区域设置。我已经检查过我使用的语言环境是否正确(en_GB.utf-8),所以我不知道还要检查什么?

根据 the official website.

中的示例添加井号作为人口的悬停数据
import plotly.express as px

df = px.data.gapminder().query("continent == 'Europe' and year == 2007 and pop > 2.e6")
fig = px.bar(df, y='pop', x='country') 
fig.update_traces(hovertemplate='pop: \u00A3%{y}')

fig.show()