| plot.WCCSOM {wccsom} | R Documentation |
Plot self-organising map, obtained from function WCCSOM. Several types of plots are supported.
plot.WCCSOM(x, type = c("changes", "codes", "counts", "mapping",
"property", "quality"),
classif = x$unit.classif, obj, labels=NULL, pchs=NULL,
bgcol=heat.colors(25)[6:25],
zlim=NULL, property, heatkey=TRUE, ...)
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. |
obj |
A new object to be mapped. Only needed if type
equals '"property"'. |
labels |
labels to plot when type equals
'"mapping"'. |
pchs |
plotting symbols to use when type equals
'"mapping"'. |
bgcol |
colors to use as unit background for '"codes"', '"property"' and '"counts"' plotting types. |
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. |
... |
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
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)))
obj1.wccs <- plot(x, type="property", obj=cepha$patterns[1,])
obj1.wccs
par(mfrow=c(1,2))
unit.dists <- unit.distances(x$grid, toroidal=FALSE)
plot(x, type="property", property=unit.dists[1,],
main="Distances to unit 1", zlim=c(0,4))
unit.dists <- unit.distances(x$grid, toroidal=TRUE)
plot(x, type="property", property=unit.dists[1,],
main="Toroidal distances to unit 1", zlim=c(0,4))