mvlabs | R Documentation |
There is no easy way to move point labels around interactively on an a plot in R. This function allows a point and click way to select (using identify) and move (using locator) points by modifying the underlying dataframe.
mvlabs(df, n=nrow(df), x='x', y='y', l='lab', cols=colors()[grep("dark",colors())], ...)
df |
A dataframe with x and y coordinates and text labels |
n |
the number of points you wish to move |
x |
the column name of the x axis coordinates |
y |
the column name of the y axis coordinates |
l |
the column name of the point labels |
cols |
the color vector to iterate through while assigning new positions. |
... |
other paramters passed on to text |
a series of violin plots
locator,identify,labsegs
x <- rnorm(20); y <- rnorm(20)
df <- data.frame(x,y, lab=as.character(letters[1:20]))
plot(df$x, df$y, pch=''); text(df$x, df$y, df$lab)
## df <- mvlabs(df, 'x','y','lab', n=3)
plot(df$x, df$y, pch=''); text(df$x, df$y, df$lab)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.