This is an alternative legend for plots which uses the actual plotting environment to create the legend, rather than overlaying it. I prefer this legend because it scales better than the base legend. It is currently only implemented to support lines.
create_legend(n, leg_labels, left_mar = 0, height = NULL,
main_cols = NULL, cut = NULL, cut_cols = NULL, n_1 = FALSE, ...)
Number of lines to produce on the legend.
Labels for the lines in the legend.
Left margin argument. Defaults to 0. Larger numbers push the legend more to the right.
The height of the legend. Counter-intuitively, larger numbers result in a smaller legend (more squished to the bottom).
Primary colors (of the lines, rather than the cut scores)
Cut scores (see pp_plot).
The color of the lines/points for the cut scores.
Should the lines on the legend be displayed when there
is only one value? Defaults to FALSE
, and is relevant when values to
cut
are provided.
Additional arguments passed to lines.