Learn R Programming

SOMbrero (version 1.2)

plot.myGrid: Draw a myGrid class object

Description

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

Usage

"plot"(x, neuron.col="white", ...)

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.
...
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
# 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