igraph-一圈多行文字? [英] igraph - multiple lines of text in one circle?

查看:75
本文介绍了igraph-一圈多行文字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是igraph的完全入门者,所以请对我轻松一点.我正在创建网络地图,并想为每个圆圈添加其他文本行.我该怎么办?是否有可能?这是一个例子:

I am a complete beginner to igraph so please be easy on me. I am creating a network map and would like to add additional lines of text for each circle. How may I do that? Is it possible? Here is an illustration:

推荐答案

您可以使用\n在字符向量中指定换行符,从而可以在单个顶点中强制输入多行文本.

You can specify a line break in a character vector using \n, which allows you to force multiple lines of text in a single vertex.

library(igraph)
g <- graph.data.frame(data.frame(A=1,B=2))
V(g)$name <- c("Line 1\nLine 2","Point 2")
plot(g,vertex.size=100)

这篇关于igraph-一圈多行文字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆