Learn R Programming

SOMbrero (version 1.2-4)

plot.myGrid: Draw a myGrid class object

Description

Draw a grid corresponding to a myGrid class object in a graphical window.

Usage

# S3 method for myGrid
plot(x, neuron.col = "white", print.title = FALSE, 
                      the.titles = paste("Cluster", 1:prod(x$dim)), …)

Arguments

x

The myGrid class object to be drawn.

neuron.col

Color(s) used to depict the neurons. Default value is white. If the argument is composed of one single color, neurons will all be filled with the same color. If the argument is composed of many colors, the number of colors must match the total number of neurons.

print.title

Whether the cluster titles must be printed in center of the grid or not. Default to FALSE (titles not displayed).

the.titles

If print.title = TRUE, values of the title to display. Default to "Cluster " followed by the cluster number.

Further arguments to the plot function.

Details

Color filling process uses the coordinates of the object x, having class myGrid and included in x$coord.

See Also

initGrid to define a myGrid class object.

Examples

Run this code
# NOT RUN {
# creating grid
a.grid <- initGrid(dimension=c(5,5), topo="square", dist.type="maximum")

# plotting grid
# without any color specification
plot(a.grid)
# generating colors from rainbow() function
my.colors <- rainbow(5*5)
plot(a.grid, neuron.col=my.colors)
# }

Run the code above in your browser using DataLab