我正在尝试在 Python 中的 Plotly Express 中添加每个堆叠条形顶部的总计以及各个条形值。
import plotly.express as px
df = px.data.medals_long()
fig = px.bar(df, x="medal", y="count", color="nation", text_auto=True)
fig.show()
Run Code Online (Sandbox Code Playgroud)
不过我想要如下图表:
参考凯在这里提出的答案/sf/answers/1539910571/,我想将插入的图像尺寸减小为高度和宽度的50%。
mainPanel(
img(src='myImage.png', align = "right"),
### the rest of your code
)
请帮忙。