Create a scale bar to use for plots
scalebar.Rd
Create a scale bar to use for plots
Arguments
- x
Width of scale bar in microns. If the width is higher than 1,000 microns, the units will be converted to millimeters in the scale bar title.
- breaks
Number of breaks to cut scale bar into. For example, 6 breaks will create 6 vertical lines and 5 even intervals.
- highlight_breaks
Highlight specific breaks by increasing their height.
- title_position
One of "top" or "bottom" for title placement
- flip_bar
Should the scale bar be flipped to a vertical orientation?
- text_height
Height of scale bar title
- ...
Parameters passed to geom_segment
Examples
# Draw a scale bar for a 500 micron distance with 6 breaks where
# the ends are highlighted
scalebar()
#> Loading required namespace: ggfittext
# Draw a scale bar for a 1mm mm distance with 1 breaks where the
# ends and the mid point are highlighted
scalebar(breaks = 11, highlight_breaks = c(1, 6, 11))