Draws a compact legend without a frame, in one row or several columns,
for placement with FigureGrob(). Text is measured when the legend is
drawn. Keys are points, open circles, crosses, squares, diamonds, patches
(filled rectangles of the key width), lines or point-and-line keys.
Usage
LegendKeys(
labels,
colours,
shape = "point",
ncol = length(labels),
size = NULL,
key_mm = 2.2,
marker_size = NULL,
row_mm = NULL,
text_gap_mm = 0.8,
column_gap_mm = 0.8,
byrow = TRUE,
linewidth = NULL,
typeset = TRUE,
style = ManuscriptStyle()
)Arguments
- labels
Character labels, typeset with
TypesetLabel().- colours
Key colours, recycled.
- shape
One of
"point","open"(open circle),"cross","square","diamond","patch","line"or"pointline", recycled per key.- ncol
Number of columns; default is one row.
- size
Text size in points; default is the style's legend size.
- key_mm
Key width in millimetres.
- marker_size
Optional marker diameter (square and diamond side) in points; by default it follows the text size.
- row_mm
Optional row pitch in millimetres (default 1.35 times the text size).
- text_gap_mm
Gap between key and label (mm).
- column_gap_mm
Gap after the widest label of a column (mm).
- byrow
Fill rows first (
TRUE) or columns first (FALSE).- linewidth
Optional line width (points) of line keys.
- typeset
If
FALSE, labels are drawn as written.- style
A
ManuscriptStyle()object.

