[程式] R 繪圖形狀表現

看板Statistics作者 (no matter)時間8年前 (2015/11/18 14:55), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
[軟體程式類別]: 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://www.ptt.cc/bbs/Statistics/M.1447829733.A.221.html
文章代碼(AID): #1MJ23b8X (Statistics)