Learn R Programming

SOD (version 1.0)

SOD.plot.functions: SOD plotting functions

Description

Functions for visualising points mapped by the SOD algorithm,
  • plotPoints plots mapped points
  • plotConcentric fancy plots of points
  • plotStress plots the change of the sum of errors in the inter-node distances.

These are simple convenience functions that mainly serve as examples that the user may wish to extend. The package also provides a generic plot function for the sod_sq3 class returned by the squeeze functions. This generic function simply calls one of these functions depending upon the value of the ptype parameter see ?sod_sq3 and examples section for details.

Usage

plotPoints(x, col=hsvScale(x$node_stress), xc=1, yc=2, invert.y=FALSE, xlab=NA, ylab=NA, ...)
plotConcentric(x, cex.data, col=hsvScale(1:ncol(cex.data)),xc=1, yc=2, cex.max=3, invert.y=FALSE, pch=19, xlab=NA, ylab=NA, leg.pos=NULL, ...)
plotStress(x, bg.alpha=0.5, bg.sat=1, bg.val=0.75, col='black', lwd=1, lty=1, main="Error / Dimension", xlab="iteration", ylab="error / dimensionality", ...)

Arguments

x
A named list produced by the squeeze functions containing 'stress', 'mapDims', 'pos', 'time', 'node_stress'.
col
A vector of colours for each row of sq$pos, or for plotConcentric a colour for each column of cex.data. For plotStress the col argument gives the colour for points plotted.
xc
The dimension to plot on the x-axis.
yc
The dimension to plot on the y-axis.
invert.y
A boolean determining whether the y-axis should be inverted
pch
The plot character to use. Defaults to 19 (solid circles) for plotConcentric.
cex.max
The size of the points representing maximal values for plotConcentric.
cex.data
A numeric matrix providing numerical descriptions of the items represented by each point (1 row per point). Each column represents a numerical descriptor of some sort, and will be plotted as a series of concentric discs or circles where the incremental area of each disc/circle is proportional to the value scaled across all columns.
leg.pos
The position of an optional legend. If NULL (the default) no legend will be drawn. The leg.pos should be specified as for legend, (eg. 'topright', 'bottomleft'). The column names of cex.data will be used for the legend text.
bg.alpha, bg.sat, bg.val
Parameters specifying the background colours for the plotStress functions. These colours are used to visualise the change in dimensionality through the mapping process.
lwd, lty
The width and type of line used to plot stress levels in plotStress
main
The title for the plot produced by plotStress. Defaults to "Error / Dimension"
xlab
The label of the x-axis. Defaults to NA for point plots.
ylab
The label of the y-axis. Defaults to NA for point plots.
...
Optional parameters passed to the plot function.

Value

Does not return anything.

See Also

SOD-package DimSqueezer DimSqueezer_CL

Examples

Run this code
## Not run: 
# ## construct a DimSqueezer object and squeeze
# data(f186)
# ds <- DimSqueezer(as.matrix(f186[,7:12]))
# 
# ## squeeze to 2 dimensions
# sq <- ds$squeeze(2, 1000)
# 
# ## plot simple points coloured by the amount of stress
# plotPoints(sq)
# 
# ## with filled circles
# plotPoints(sq, pch=19)
# 
# ## coloured by one of the mapping parameters
# plotPoints(sq, pch=19, col=hsvScale(f186[,'Etv2']) )
# 
# ## this can also be done via the generic function:
# plot(sq, ptype='p', pch=19, col=hsvScale(f186[,'Etv2']) )
# 
# ## plot the dimensinonality and stress evolution
# plotStress(sq)
# 
# ## alternatively
# plot(sq, ptype='s')
# 
# ## plot concentric circles
# plotConcentric(sq, cex.data=f186[,7:12], leg.pos='topleft')
# 
# ## or as
# plot(sq, ptype='c', cex.data=f186[,7:12])
# ## End(Not run)

Run the code above in your browser using DataLab