Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
118 views
in Technique[技术] by (71.8m points)

r - How can I do a multiple plot with a somSC type graph?

I'm sure this is an easy one, but I dont know why this code cannot plot two graphs in the same window.

nfil=5
ncol=5
set.seed(850)
som <- trainSOM(x.data=datasom[3:8], 
                dimension=c(nfil,ncol),
                nb.save = 100,
                verbose=TRUE)
#  SUPERCLUSTERS
num.grupos=4
som.sc <- superClass(som, k=num.grupos)
###  PLOTEO SOM
par(mfrow=c(1,2))
plot(som.sc, plot.var=FALSE)
# observaciones de cada neurona
counts<-as.vector(som.sc$som$clustering)
kounts<-c(0)
for (i in 1:(nfil*ncol)) {
  kounts[i]=0
}
for (i in 1:(length(counts))) {
  kounts[counts[i]]=kounts[counts[i]]+1
}
plot(som.sc, type="grid",names=kounts)

As far I read in google, with the par(mfrow=c(1,2)) line should be fine, but it doesn't work. I ran the code and the first plot used the first half of the window, as it should be. But, the second plot use the entire window. Please, help me!. Thanks.

P.S.: The review of this post didn't allow me to write the entire code. I'm using the SOMbrero package.

question from:https://stackoverflow.com/questions/65893735/how-can-i-do-a-multiple-plot-with-a-somsc-type-graph

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...