plot_band() creates a ggplot2 plot of a flat, foldable paper band sized
to wrap around a stack of cards or paper and hold it together, similar to
a currency or belly band. paper sets the width and height of the item
being bundled, orientation sets which of those two dimensions the band
wraps around, and the folded sides of the band (that wrap around the two
edges of the stack) are sized to match the stack thickness calculated by
as_thickness(). The band extends past the far edge of the stack with an
additional segment so it can be glued or taped closed after wrapping.
Usage
plot_band(
paper,
orientation = c("horizontal", "vertical"),
n = NULL,
pt = 10,
x = NULL,
thickness = NULL,
overlap = NULL,
band_width = NULL,
fill = "white",
color = "black",
linewidth = 0.5,
glue_fill = "grey85",
fold_linetype = "dashed",
fold_linewidth = linewidth/2
)Arguments
- paper
Paper, page, or card name, or a data.frame with width and height columns (as returned by
get_page_size()ormake_page_size()), passed toas_page(). Sets the width and height of the stack of cards or paper the band wraps around.- orientation
Band orientation, either
"horizontal"or"vertical"."horizontal"wraps the band left-to-right, crossing the middle of the stack, so the band's panels use thewidthofpaperand the band's own height is set byband_width."vertical"wraps the band top-to-bottom instead, so the panels useheightand the band's own width is set byband_width. Default:"horizontal"- n, pt, x
Passed to
as_thickness()to calculate the thickness of the stack. Ignored ifthicknessis supplied.ptis also used to add a small ease allowance (the caliper of a single sheet or card) to the folded side segments of the band, since a flat band can't wrap tightly around a stack at its exact thickness. Ignored ifthicknessis supplied.- thickness
Optional. A
unitobject or number (in the units ofpaper) with the thickness of the stack, overridingn,pt, andx. If supplied, no ease allowance is added andthicknesssets the folded side segments of the band exactly. Default:NULL- overlap
Distance the band extends past the far edge of the stack, forming a segment that can be glued or taped closed. A
unitobject or a number (in the units ofpaper). Default:NULL, which uses 40% of thewidthofpaper(iforientationis"horizontal") or 40% of theheightofpaper(iforientationis"vertical") — i.e. 40% of whichever dimension ofpaperthe band wraps around.- band_width
Height of the band if
orientationis"horizontal", or width of the band iforientationis"vertical"— the dimension of the band perpendicular to the direction it wraps around the stack. Aunitobject or a number (in the units ofpaper). Default:NULL, which uses 40% of theheightofpaper(iforientationis"horizontal") or 40% of thewidthofpaper(iforientationis"vertical").- fill, color, linewidth
Fill, outline color, and outline linewidth for the band, Default:
"white","black", and0.5- glue_fill
Fill color used to distinguish the overlapping segment of the band set by
overlap, Default:"grey85"- fold_linetype, fold_linewidth
Linetype and linewidth for the lines marking where the band should be folded, Default:
"dashed"andlinewidth / 2
Examples
if (FALSE) { # \dontrun{
if (interactive() && is_installed("ggplot2")) {
plot_band(get_card("Poker"), n = 54)
plot_band(get_card("Tarot"), n = 78, orientation = "vertical")
}
} # }