plot.wccsom {wccsom} | R Documentation |
Plot self-organising map, obtained from function wccsom. Several types of plots are supported.
## S3 method for class 'wccsom': plot(x, type = c("changes", "codes", "counts", "mapping", "prediction", "property", "quality"), classif = NULL, labels = NULL, pchs = NULL, main = NULL, palette.name = heat.colors, ncolors, unit.colors, unit.bgcol = NULL, zlim = NULL, property = NULL, heatkey=TRUE, contin, ...)
x |
SOM object. |
type |
Type of plot. (Wow!) |
classif |
classification object, as returned by wccassign .
Only needed if type equals '"mapping"', '"quality"',
and '"counts"'. Also a vector of class numbers may be given. If the
network was trained with keep.data equal to TRUE, then the
object already contains this information. |
labels |
(optional) labels to plot when type equals
'"mapping"'. |
pchs |
(optional) plotting symbols to use when type equals
'"mapping"'. |
main |
title of the plot. |
palette.name |
colors to use as unit background for '"codes"', '"counts"', '"prediction"', '"property"' and '"quality"' plotting types. |
ncolors |
number of colors to use in the palette. |
unit.colors |
explicit definition of the colors for the units in the '"codes"', '"counts"', '"prediction"', '"property"' and '"quality"' plotting types. |
unit.bgcol |
background color for units if no other color information is to be plotted. For plotting type is '"codes"', the default is '"transparent"'; in other cases the default is '"gray"'. |
zlim |
Optional range for color coding of unit backgrounds. |
property |
Values to use if the '"property"' plotting type. Can be used for colouring units in general. |
heatkey |
Whether or not to generate a heatkey at the left side of the plot in the '"quality"', '"counts"', and '"property"' plotting types. |
contin |
Whether the heatkey should show a range of values (TRUE) or a series of discrete values. The function tries to make a good guess; in case of strange-looking results it may pay to explicitly provide a value for this argument. |
... |
Other graphical parameters, e.g. colours of labels in the '"mapping"' plotting type. |
Several different types of plots are supported:
If type
equals '"property"', the wcc values for all units
are returned.
Ron Wehrens
R. Wehrens, W.J. Melssen, L.M.C. Buydens and R. de Gelder. Representing Structural Databases in a Self-Organising Map. Acta Cryst. B61, 548-557, 2005.
wccsom
, wccxyf
,
unit.distances
, predict.wccsom
data(cepha) gr <- somgrid(3, 3, "hexagonal") set.seed(7) x <- wccsom(cepha$patterns, grid = gr, trwidth = 20, rlen = 100) par(mfrow = c(3,2)) plot(x, type = "codes", main = "Codebook vectors") plot(x, type = "changes", main = "Convergence") plot(x, type = "counts", main = "Mapping counts") plot(x, type = "quality", main = "Mapping quality") plot(x, type = "mapping", main = "Mapping", labels = cepha$class.names, col = as.integer(factor(cepha$class.names))) plot(x, type = "mapping", main = "Mapping", pchs = as.integer(factor(cepha$class.names)), col = as.integer(factor(cepha$class.names))) par(mfrow=c(1,1)) obj1.wccs <- wccmap(x, cepha$patterns[1,]) plot(x, type = "property", property = obj1.wccs)