7

我正在构建一个 igraph,并且希望能够更改图形标题的颜色和字体大小。

dput(df)
structure(list(Month = structure(c(15248, 15522), class = "Date"), 
    Value = c(1, 3)), .Names = c("Month", "Value"), row.names = 1:2, class = "data.frame")

g <- graph.data.frame(df)

 plot(g, layout =  layout.kamada.kawai,  vertex.label = V(g)$name,  vertex.label.color= "white",edge.arrow.size=0.5,  edge.curved=T, edge.label=E(g)$Freq, edge.label.color="pink", edge.label.font=5,vertex.shape="circle",edge.color="white", vertex.color="red", asp=0, main="This is my first igraph")
4

1 回答 1

15

main="..."从函数中删除参数,plot()并在plot(...)使用设置大小和设置颜色的函数后。title()cex.main=cex.col=

plot(g, layout =  layout.kamada.kawai,  vertex.label = V(g)$name,  vertex.label.color= "white",edge.arrow.size=0.5,  edge.curved=T, edge.label=E(g)$Freq, edge.label.color="pink", edge.label.font=5,vertex.shape="circle",edge.color="white", vertex.color="red", asp=0)
title("This is my first igraph",cex.main=3,col.main="green")
于 2013-01-04T21:17:15.813 回答