如何控制textplot_network中顶点标签的大小?
How to control the size of the vertex label in textplot_network?
我可以控制顶点大小,但不能控制 textplot_network
中的顶点 label 大小。有办法吗?
我在 plot.network
中看到了参数 vertex.cex
,但它不起作用。
这是我目前得到的:
library(quanteda)
toks <- corpus_subset(data_corpus_irishbudget2010) %>%
tokens(remove_punct = TRUE) %>%
tokens_tolower() %>%
tokens_remove(stopwords("english"), padding = FALSE)
myfcm <- fcm(toks, context = "window", tri = FALSE)
feat <- names(topfeatures(myfcm, 30))
myfcm <- fcm_select(myfcm, feat, verbose = FALSE)
textplot_network(myfcm, vertex_size = rowSums(myfcm)/min(rowSums(myfcm)),
vertex.cex = rowSums(myfcm)/min(rowSums(myfcm)))
如果您改为在 R 中切换到 visNetwork 包 - 您可以使用节点标签大小的附加参数 - 它也有一个基于 JS 的后端,因此对文本标签的其他元素很有用
正如您从源代码中看到的,字体大小不是您可以在函数中控制的参数。
https://github.com/quanteda/quanteda/blob/master/R/textplot_network.R#L242-L256
如果您确实需要该功能,请在此处提交功能请求:
我可以控制顶点大小,但不能控制 textplot_network
中的顶点 label 大小。有办法吗?
我在 plot.network
中看到了参数 vertex.cex
,但它不起作用。
这是我目前得到的:
library(quanteda)
toks <- corpus_subset(data_corpus_irishbudget2010) %>%
tokens(remove_punct = TRUE) %>%
tokens_tolower() %>%
tokens_remove(stopwords("english"), padding = FALSE)
myfcm <- fcm(toks, context = "window", tri = FALSE)
feat <- names(topfeatures(myfcm, 30))
myfcm <- fcm_select(myfcm, feat, verbose = FALSE)
textplot_network(myfcm, vertex_size = rowSums(myfcm)/min(rowSums(myfcm)),
vertex.cex = rowSums(myfcm)/min(rowSums(myfcm)))
如果您改为在 R 中切换到 visNetwork 包 - 您可以使用节点标签大小的附加参数 - 它也有一个基于 JS 的后端,因此对文本标签的其他元素很有用
正如您从源代码中看到的,字体大小不是您可以在函数中控制的参数。
https://github.com/quanteda/quanteda/blob/master/R/textplot_network.R#L242-L256
如果您确实需要该功能,请在此处提交功能请求: