如何使用R为plot

您所在的位置:网站首页 lumafusion字幕渐显 如何使用R为plot

如何使用R为plot

#如何使用R为plot| 来源: 网络整理| 查看: 265

1> d-roy..:

title布局中的属性是指整个绘图表面的标题,因此只能有一个.但是,我们可以使用文本注释为子图创建"标题",例如:

p %layout(showlegend = FALSE), plot_ly(economics, x = date, y = unemploy)%>%layout(showlegend = FALSE), margin = 0.05 ) p %>% layout(annotatiOns= list( list(x = 0.2 , y = 1.05, text = "AA", showarrow = F, xref='paper', yref='paper'), list(x = 0.8 , y = 1.05, text = "BB", showarrow = F, xref='paper', yref='paper')) )

2> Carson..:

您现在可以利用subplot()重新定位纸张引用的内容(如注释(以及形状,图像等))来代替"手动"定位(即@ d-roy的答案).

library(plotly) library(dplyr) my_plot % plot_ly(x = ~date, y = ~value) %>% add_annotations( text = ~unique(variable), x = 0.5, y = 1, yref = "paper", xref = "paper", xanchor = "middle", yanchor = "top", showarrow = FALSE, fOnt= list(size = 15) ) economics_long %>% group_by(variable) %>% do(p = my_plot(.)) %>% subplot(nrows = NROW(.), shareX = TRUE)


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3