caxis | R Documentation |
Add a color-coded axis.
caxis(side, prop, col = NULL, lwd = 3, ...)
side |
an integer specifying which side of the plot the axis is to be drawn on: 1=below, 2=left, 3=above, and 4=right |
prop |
the proportion of each section to be scaled to the axis width |
col |
a vector of colors equal to the length of |
lwd |
line width for the axis |
... |
additional parameters passed to |
A list containing the start and end positions for each prop
scaled
to the axis width.
x <- runif(100)
y <- runif(100)
plot(x, y)
caxis(1, 1:4, col = 2:5)
at <- caxis(3, 1:4, col = 2:5)
text(at$end, par('usr')[4], paste('group', 1:4),
col = 2:5, xpd = NA, adj = c(1, -1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.