draw_scalebar | R Documentation |
Takes a ggplot object as input together with some additional parameters specifying the position and widht of a scalebar representing the actual width of corresponding 500um in the plot. The actual width of the scale bar is determined by the x, xend parameters and has to be calulated separately. To do this, you can use the pixels.per.um slot of the 'Staffli' object.
draw_scalebar( p, x = NULL, xend = NULL, y = NULL, pxum = NULL, sb.size = 2.5, dark.theme = FALSE )
p |
An object of class 'ggplot' |
x, xend |
The start and positions of the scalebar along the x axis. |
y |
The position of the scalebar along the y axis. |
pxum |
A data.frame object with columns for 'x', 'xend', 'y' and 'sample' used for facetted plots. |
sb.size |
Size of scalebar |
dark.theme |
Switches color of scalebar to 'white' |
An object of class 'ggplot' with a scalebar drawn on top of it
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.