Library: | graphic |
See also: | dispbox plotdot |
Quantlet: | dispdot | |
Description: | Generates a dotplot with tonal highlighting. An optional factor allows multiple dotplots by group. |
Usage: | dp = dispdot(x , inColorScheme {, inFactor}) | |
Input: | ||
x | n x 1 vector (continuous variable) | |
inColorScheme | m x 3 vector (discrete) of rgb colors for the different highlighting stages | |
inFactor | n x 1 vector (discrete variable) | |
Output: | ||
dp | composed graphical object |
The colors are linearly assigned to the frequencies of overlappings. If the maximal frequency of overlappings is less than the number of colors provided, only this smaller number of colors is used.
Obviously, if inColorScheme is of lenght one, tonal highlighting is off.
The output of grcolorscheme() is a valid input for inColorScheme.
Requires the library "stats"
IMPORTANT: The factor variable might be alphabetically reordered!
library("graphic") library("stats") x = normal(4000) m = matrix(1000) factor = m | 2*m | 3*m | 4*m bp1 = dispdot(x, grcolorscheme("greyscale")) bp2 = dispdot(x, grcolorscheme("topographic"), factor) dd = createdisplay(1, 2) show(dd, 1, 1, bp1) show(dd, 1, 2, bp2)
Shows a dotplot of x on the left. On the right four dotplots of the four groups within x defined by factor are shown.