gpt4 book ai didi

r - 更改 igraph 标题的字体和颜色

转载 作者:行者123 更新时间:2023-12-04 17:02:09 28 4
gpt4 key购买 nike

我正在构建一个 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")

最佳答案

删除参数 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")

关于r - 更改 igraph 标题的字体和颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14164887/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com