Make legend order depending on what the plot will contain.
make_legend_order(
mode,
col_scale = NULL,
size_scale = NULL,
annot_rows_df = NULL,
annot_cols_df = NULL,
bins = NULL,
limits = NULL,
high = NULL,
mid = NULL,
low = NULL,
na_col = "grey50",
midpoint = 0,
size_range = NULL,
legend_order = NULL
)A list with aesthetics for the main plot and orders of all legends.
Plotting modes.
One or two colour scales (shared for fill and colour). NULL for default, string for Brewer or Viridis, or a scale.
Size scales (NULL or ggplot2 scales).
Annotation data frame for rows.
Annotation data frame for columns.
Numeric for number of bins to determine if multiple scales are needed (if multiple bins values).
Limits of scale (list of limits if two scales).
Colours at high values (correlation heatmap).
Colours at medium values (correlation heatmap).
Colours at low values (correlation heatmap).
Colour if NA.
Midpoint of divergent scale (correlation heatmap).
Size range (list of ranges if two scales).
Numeric vector with legend order. NULL for default.