topoplot.palette {erpR} | R Documentation |
This function draws a topoplot palette as a rectangle with colored areas indicating the palette shades.
topoplot.palette(cols, pos = c(0.5,0.5), p.width=0.2, p.height=0.8, horizontal = FALSE, rev= FALSE, palette.lwd=2, palette.bord="black", palette.lim = c(-5,5), draw.labels=TRUE, lab.dist = 1, lab.cex = 1, lab.font = 1, lab.family = "", measure = "microvolts", detailed.labels = NULL)
cols |
a vector of colors to draw the palette. This vector may be the output of |
pos |
the position of the palette as a proportion of the plot region. Default ( |
p.width |
palette width as a proportion of the plot region. |
p.height |
palette height as a proportion of the plot region. |
horizontal |
logical. Should the color shades be plotted horizontally? (default is vertical) |
rev |
logical. Should the palette shades order be reversed? |
palette.lwd |
line width of the palette rectangle. |
palette.bord |
color of the palette border. |
palette.lim |
limits of the palette. They will be plotted as text if |
draw.labels |
logical. Should labels be drawn? |
labels |
logical. Should labels indicating |
lab.dist |
a number indicating the distance of the labels from the palette rectangle. Positive numbers move the labels from the palette rectangle, whereas negative numbers move the labels towards the rectangle. |
lab.cex |
magnification factor for the labels. |
lab.font |
font type for the labels (see |
lab.family |
font family for the labels (see |
measure |
the label indicating the labels to be displayed with the palette. Default is |
detailed.labels |
a list containing two labels, for the upper and lower limits of the palette (e.g. list(10 "%", "-10%"). If specified this value overrides |
the function draws a palette on an existing plot.
The two parameters cols
and zlim
may be supplied with values that are returned from topoplot
.
Giorgio Arcara
if(require(akima)) { data(erplistExample) word=grandaverage("Exp1_word_subj", 1:20, erplist=erplistExample) # check if some electrodes are not present in the list # and create an object with these electrode names. notfound=topoplot(word, return.notfound=TRUE) #define a layout for mat=matrix(c(1,2), 1, 2, byrow=TRUE) layout(mat, widths=c(0.8, 0.2)) #make a topoplot excluding not found electrode par(pty="s") topo.data=topoplot(word, startmsec=-200, endmsec=1500, win.ini=400, win.end=600, exclude=notfound) #draw the palette on a new empty plot. par(pty="m", mar=c(0,0,0,0)) plot.new() topoplot.palette(cols=topo.data$palette, palette.lim=topo.data$zlim, p.height=0.6) }