| plotbary {denpro} | R Documentation |
Given a level set tree of some density estimate, plots a barycenter plot to the graphics window, with respect to the given coordinate. Barycenter plots visualize the locations of the modes of the estimate.
plotbary(ltree, coordi, plot=T, data=F, crit=NULL, modelabel=TRUE, ptext=0, leimat=NULL, symbo=NULL, info=NULL, infolift=0, infopos=0, xmarginleft=0, xmarginright=0, ymargin=0, xlim=NULL, ylim=NULL, nodesymbo=20, col="black", col.axis="black", collines="black")
ltree |
level set tree; list of vectors. List contain at least components "value", "volume", and "parent". Output of profhist, profkern, or other level set tree producing function. |
coordi |
integer in 1,...,d; gives the coordinate direction with respect which the plot will be made. |
plot |
T or F; TRUE if we make a plot, otherwise FALSE. |
data |
T or F; TRUE if we want output to contain some information for example ordering for siblings. This option is needed only by other plotting function of the package, it is not needed by the user. |
crit |
d-vector of real numbers; gives a way to control ordering of siblings. The leftmost sibling is the one whose barycenter is furthest away from "crit". |
modelabel |
T or F; TRUE if the modes will be labelled. Default is to use labels M1, M2,... |
ptext |
non-negative real number; amount by which the mode labels will be lifted. |
leimat |
vector of characters; length of the vector should be as long as the number of modes of the estimate. This option is for the case we do not want the ordering of the labels to be done automatically. |
symbo |
character; for example "L". The default value for the automatic labelling of the modes is to use M1, M2,... With "symbo" we may switch to L1, L2,..., for example. |
info |
vector of numbers or characters, whose length is equal to the number of nodes of the level set tree. The elements of "info" will be placed on the right side of the nodes. Typically "info" will be generated by "excmas" or we define "info" to be frequencies of the nodes. (Frequencies may be obtained directly from the functions profhist,...) |
infolift |
real number; controls the vertical positioning of the elements of "info". |
infopos |
real number; controls the horizontal positioning of the elements of "info". Negative "infopos" will move elements of "info" to the right hand side. |
xmarginleft |
nonnegative real number; adds more margin on the left hand side. The box around plot will be moved to the left with the amount "xmarginleft". |
xmarginright |
nonnegative real number; adds more margin on the right hand side. The box around plot will be moved to the right with the amount "xmarginright". |
ymargin |
nonnegative real number; adds more margin on the top of the plot. The box around plot will be moved up with the amount "ymargin". |
xlim |
vector of 2 real numbers; gives the limits for the scale of x-axis. |
ylim |
vector of 2 real numbers; gives the limits for the scale of y-axis. |
nodesymbo |
symbol for the nodes of the tree; integer 19-25; see help(points) for the definitions |
col |
colour for the nodes; for example "black" or "blue". |
col.axis |
colour for the x and y-axis; for example "black" or "blue". |
collines |
colour for lines joining nodes; for example "black" or "blue". |
By default nothing is returned but a plot is made on the graphics window. When data=T, then a list is returned, but this is a lower level option.
Jussi Klemelä
http://www.rni.helsinki.fi/~jsk/denpro
set.seed(1) dendat<-matrix(rnorm(20),10) #10*2 data-matrix ph<-profhist(dendat,binlkm=3,cfre=T) plotbary(ph,coordi=1,ptext=0.01) plotbary(ph,coordi=2,ptext=0.01)