Description Usage Arguments Value
View source: R/short_helpers.R
Helper to add a bar image legend to plots
1 2 3 4 |
position |
(numeric or character) position of the bottom left corner of the legend. If numeric, x and y coordinates. If character, options are: "bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right", or "center". |
col |
color palette. A vector of contiguous colors. It can be generated
using functions like |
width_prop |
width of bar legend represented as a proportion of the entire plotting width. Default = 0.03. |
heigh_prop |
heigh of bar legend represented as a proportion of the entire plotting heigh. Default = 0.18. |
title |
legend title. Default = "Legend". |
labels |
(numeric or character) labels for the legend. Default = c("Low", "High"). |
digits |
(numeric) number of decimal places to round numeric labels. Default = 0. |
labels_offset |
offset of labels from bar. Default = 0.2. |
horizontal |
(logical) should the legend be horizontal. Default = FALSE. |
alpha |
(numeric) alpha level 0-1. Default = 1. |
border |
color for the border of the legend bar. The default, NULL, does not plot a border. |
cex |
character expansion factor relative to current. Default = NULL. |
inset |
inset distances from plot margins relative to plot region. Default = 0.05. |
insetx |
inset from x margins. The default, NULL, uses |
insety |
inset from y margins. The default, NULL, uses |
A bar legend for a plot.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.