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

Sebastian Henriquez

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.

pascal

Heatmaps will probably not work with par(). Maybe these will help:

R: arranging multiple plots together using gridExtra

to display two heatmaps in same pdf side by side in R

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How can I plot a graph of a function using multiple conditions?

How can I plot multiple line in the same graph in python?

How do I plot multiple files in a single graph?

How can I get such a plot? Do not know the type of plot it is

How can I plot a Quarter graph in matlab?

How can I plot a Hamiltonian graph in R?

How do I plot the graph of `res ` for different `epsilon` in the same plot?

How do I plot multiple data sets with different x and y values on one graph?

Pyplot - How do I plot multiple lines on the same graph when list lengths for one axis are not consistent?

How do I plot a line graph based off the 'Type' column? I want a line for A and line for B based off the 'Price' Column

How can I build this type of graph in android?

How I can plot multiple roc together?

How do I plot multiple functions in matplotlib?

How can I plot line graph with categorical and numeric (datum) axes?

How can I plot graph in different position in pandas?

How can I plot a graph like this one in Python?

How can I have the matplotlib graph with pandas.plot() in the widget?

In ggplot, how can I plot data as a line graph?

How can i plot a Seaborn Percentage Bar graph using a dictionary?

How can I extend the line on this graph to the edges of the plot?

How can I plot two linear regressions on one same graph?

How can I graph a scatter plot in python using CanvasXpress Library?

How can I plot a graph for the variables n and errorp?

How do I plot a Bar graph when comparing the rows?

How do I plot a bar graph using Pandas?

How do I plot the the rows of a matrix as points on a graph?

How do I plot a graph of previously grouped data?

How do I plot pie chart graph with pandas data

How do i plot the graph side by side for comparison?