Fork me on GitHub
library("mxmaps")

data("df_mxstate")
df_mxstate$value = df_mxstate$afromexican / df_mxstate$pop mxhexbin_choropleth(df_mxstate, num_colors = 1, title = "Percentage of the population that self-identifies as Afro-Mexican") You can use label_color if you want the state abbreviations in a different color than the default black. library("viridis") df_mxstate$value = df_mxstate$afromexican / df_mxstate$pop
# Will show a warning, look at the municipio examples to see how to remove it
mxhexbin_choropleth(df_mxstate,
num_colors = 1,
label_color = "white",
title = "Percentage of the population that self-identifies as Afro-Mexican") +
scale_fill_viridis()
## Scale for 'fill' is already present. Adding another scale for 'fill',
## which will replace the existing scale.