在R中,我如何在visNetwork中拥有多行标题? \n
似乎不是解决方案:
require(visNetwork, quietly = TRUE)
# minimal example
nodes <- data.frame(id = 1:3)
edges <- data.frame(from = c(1,2), to = c(1,3))
visNetwork(nodes, edges, main ="multi \n line \n title")
答案 0 :(得分:2)
互动visNetwork
使用HTML代替标准绘图
使用HTML的新换行代码<br>
:
visNetwork(nodes, edges, main ="multi<br>line<br>title")
要在左侧对齐,或应用任何其他样式,请使用命名列表作为main
的参数:
visNetwork(nodes, edges, main = list(
text = "multi<br>line \n title",
style = "font-family:Comic Sans MS;color:#ff0000;
font-size:15px;text-align:left;"))