作者sheiswe (no matter)
看板Statistics
标题[程式] R 绘图形状表现
时间Wed Nov 18 14:55:31 2015
[软体程式类别]:
R
[程式问题]:
centrality 最中心的那个点希望形状不同
[软体熟悉度]:
新手2天
[问题叙述]:
如程式问题中描述的
[程式范例]:
x=read.table("data_1997.txt", header=T)
dim(x)
newMat=as.matrix(x)
mode(newMat) <- "numeric"
net=graph.adjacency(adjmatrix=m, mode="undirected",weighted=TRUE,diag=FALSE)
palette <- c("purple","blue","green","yellow","orange","red") #red node has
the highest centrality
# Eigenvector centrality
c.e <- evcent(net)$vector
col <- as.integer(5*(c.e-min(c.e))/diff(range(c.e))+1)
set.seed(1)
plot(net,vertex.color=palette[col], main="1997 Eigenvector Centrality",
layout=layout.fruchterman.reingold)
====以上是我现在的code===
出来的中心点重要性是红色表示
但由於之後要用黑白列印是无法用颜色分辨
想请问有甚麽方法可以让最具高中心性的点能是正方形或是任何形状都可以
次高的是橘色,也能变换图形
拜偷大大们~
谢谢
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 140.113.26.201
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Statistics/M.1447829733.A.221.html