histrug | R Documentation |
histrug
places a histgram on the bottom or top axis, to represent the density
histrug(x, height_pct = 10, col = "black", z = NULL, axis = 1)
x |
A numeric vector. The variable to be summarized by the histogram. |
height_pct |
A number between (0, 100); default is 10. The tallest bar of the hist will be height_pct of the plot |
col |
A character string color. Color of the bars. |
z |
= NULL (default) or numeric scalar. This is height of transformed plot window. The default (NULL) will compute the needed number. This option is used when you want to plot a histogram on both the top and bottom axis. Sharing the same z value ensures that the scale is the same for the top and bottom histograms. (See example.) |
axis |
Either 1 or 3. Axis on which to draw histogram. 1 - bottom; 3 - top. |
Returns invisibly the value of z used in the plot.
x <- rnorm(100)
y <- rnorm(100)
plot(x,y)
z <- histrug(x[1:50])
histrug(x[51:100], z = z, axis = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.