情节:R显示Ymin和Ymax的HoverText
在使用绘制功能区图的“悬停数据”函数时,仅显示Ymax值。
样品tibble如下
tib <- tibble(year = 1:4, min = rnorm(4), max = 15+rnorm(4))
plot_ly(tib, x= ~year) %>%
add_ribbons(ymin = ~ min, ymax = ~ max, line = list(color = "lightgrey"),
markers = list(color = "lightgrey"),
fillcolor = "rgba(7, 164, 181, 0.2)", name = "95% region",
hovertemplate = paste( "Rate: %{y:.1f}<br>year: %{x} </br>"))
我还如何显示Ymin Hovertext?
When using the function "Compare data on hover" for a plotly ribbon plot, only the ymax value is displayed.
A sample tibble is as follows
tib <- tibble(year = 1:4, min = rnorm(4), max = 15+rnorm(4))
plot_ly(tib, x= ~year) %>%
add_ribbons(ymin = ~ min, ymax = ~ max, line = list(color = "lightgrey"),
markers = list(color = "lightgrey"),
fillcolor = "rgba(7, 164, 181, 0.2)", name = "95% region",
hovertemplate = paste( "Rate: %{y:.1f}<br>year: %{x} </br>"))
How do I display the ymin hovertext as well?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一种可能性是禁用此工具提示并添加两行:
A possibility is to disable this tooltip and add two lines:
大型聚会迟到了,但是由于我遇到了同样的问题,所以我通过在丝带中添加
文本
并将Hoverinfo设置为文本:Mega late to the party, but because I had the same problem, I solved it by adding a
text
to the ribbons and set the hoverinfo to text: