简体   繁体   English

如何使用 somSC 类型图执行多个 plot?

[英]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.我确信这是一个简单的,但我不知道为什么这段代码不能 plot 两个图表在同一个 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.据我在谷歌阅读, par(mfrow=c(1,2))行应该没问题,但它不起作用。 I ran the code and the first plot used the first half of the window, as it should be.我运行了代码,第一个 plot 使用了 window 的前半部分,应该是这样。 But, the second plot use the entire window.但是,第二个 plot 使用整个 window。 Please, help me.. Thanks.请帮帮我..谢谢。

PS: The review of this post didn't allow me to write the entire code. PS:这篇文章的审查不允许我编写整个代码。 I'm using the SOMbrero package.我正在使用 SOMbrero package。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM