我做了一個圖表,你可以在下面看到。將滑鼠懸停在 Plotly 圖表上時,您可以在圖表中看到有用的資訊,例如Store Num等。有沒有辦法添加到此標簽,所以當有人懸停時,他們也可以看到branding? 如,不只是Store Num?謝謝!
| 商店編號 | mean_sales | mean_outreach | 品牌 |
|---|---|---|---|
| 1 | 200 | 1200 | 1 |
| 2 | 4200 | 1403 | 2 |
plotly::ggplotly(ggplot(data, aes(x= mean_sales, y= mean_outreach, label= `Store Num`))
geom_point() geom_text(aes(label= `Store Num`),hjust=20, vjust=20)
ggtitle("Examining Marketing Campaign Outreach"))
當我嘗試寫兩個標簽,則標簽本身會改變,但兩者的價值Store Num和branding將店號。正如我想要的兩個標簽都沒有正確顯示。
plotly::ggplotly(ggplot(data, aes(x= mean_sales, y= mean_outreach, label= `Store Num`))
geom_point() geom_text(aes(label= branding),hjust=20, vjust=20)
ggtitle("Examining Marketing Campaign Outreach"))
uj5u.com熱心網友回復:
您可以通過text美學使用自定義工具提示來實作您想要的結果(請參閱
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/404929.html
標籤:
上一篇:基于映射到值向量的合并列值
