rowBUTTONS {RPMG} | R Documentation |
Create a set of buttons and associated geometry for RPMG
rowBUTTONS(labs, col = 6, pch = 4)
labs |
Vector of labels for the buttons running across the top and bottom of the plot |
col |
Optional vector of colors for the buttons |
pch |
Optional vector of symbols to be plotted in the center of the buttons |
rowBUTTONS is called after the R graphic has been created so the geometry of the buttons can be set. Subsequent calls to whichbutt use the geometry to determine which button has been selected.
The function returns a list of buttons and the associated geometry.
N |
Number of Buttons |
labs |
Names of the Buttons |
x1 |
vector of left x-coordinates for the buttons |
x2 |
vector of right x-coordinates for the buttons |
y1 |
vector of top y-coordinates for the buttons |
y2 |
vector of bottom y-coordinates for the buttons |
rowBUTTONS uses the current plotting parameters from par() to set the geometry. If the window is resized, rowBUTTONS should be reset to extract correct button position. In interactive mode this is done each time the plot is refreshed.
Jonathan M. Lees<jonathan.lees@unc.edu>
whichbutt
####### create a plot plot(c(0,1), c(0,1)) ####### set the character vector of button labels mybutts = c("DONE", "REFRESH", "rainbow", "topo", "terrain", "CONT", "XSEC","PS" ) ######### set colors and plotting chars for buttons colabs = rep(1, length=length(mybutts)) pchlabs = rep(0,length(mybutts)) ####### create and set geometry for buttons: buttons = rowBUTTONS(mybutts, col=colabs, pch=pchlabs)