Creates a ggplot object containing a legend that is specific to bivariate mapping.

bi_legend(pal, dim = 3, xlab, ylab, size)

Arguments

pal

A palette name; one of "Brown", "DkBlue", "DkCyan", "DkViolet", or "GrPink".

dim

The dimensions of the palette, either 2 for a two-by-two palette or 3 for a three-by-three palette.

xlab

Text for desired x axis label on legend

ylab

Text for desired y axis label on legend

size

Size of axis labels

Value

A ggplot object with a bivariate legend.

Examples

# construct 2x2 legend legend <- bi_legend(pal = "GrPink", dim = 2, xlab = "Higher % White ", ylab = "Higher Income ", size = 16) # print legend legend
# construct 3x3 legend legend <- bi_legend(pal = "GrPink", dim = 3, xlab = "Higher % White ", ylab = "Higher Income ", size = 16) # print legend legend