decaxis | R Documentation |
draw axes with different decimals in the labels
decaxis(xside, xat = c(0, 0.2, 0.4, 0.6, 0.8, 1), ...)
xside |
numeric, side on which to draw the axis |
xat |
numeric, locations to draw ticks and labels |
... |
other arguments to be passed on from the |
the function draws an axis such that integer numbers along a sequence are printed as such integer labels, e.g. "0" instead of "0.0"
draws an axis on an existing plot
plot(runif(10), runif(10), axes = FALSE, xlim = c(0, 1), ylim = c(0, 1)) decaxis(xside = 1, las = 1, cex.axis = 0.7) decaxis(xside = 2, las = 1, col = "red", xat = c(0, 0.5, 1)) decaxis(xside = 3, xat = c(0.1, 0.75), col.axis = "gold") box() plot(-2:2, -2:2, axes = FALSE) # normal axis axis(1, at = seq(-2, 2, 0.5)) # axis with "0 decimals" removed decaxis(2, xat = seq(-2, 2, 0.5), las = 1) box()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.