我遵循了igraph的saving plot文档,但我需要遍历一个图表列表并且它不起作用:
for (f in flist) {
df <- read.table(f, header=TRUE, sep='\t', quote='', comment.char='')
png <- paste0(f, '.png')
g <- graph_from_data_frame(df, directed = FALSE)
plot(g, png)
}
我尝试了plot(g, png)
,plot(g, file=png)
,plot(g, save=png)
,plot.igraph(g, png)
,plot.igraph(g, file=png)
,plot.igraph(g, save=png)
。它们都不起作用。
Error in if (axes) { : argument is not interpretable as logical
或者
Error in i.parse.plot.params(graph, list(...)) :
Unknown plot parameters: save
答案 0 :(得分:0)
for (f in flist) {
df <- read.table(f, header=TRUE, sep='\t', quote='', comment.char='')
png <- paste0(f, '.png')
g <- graph_from_data_frame(df, directed = FALSE)
plot(g, png)
png("/YOUR PATH/XXX.png")
plot(g)
dev.off()
}