I would like to pull the legend data from a ggplot2
. I've tried the function layer_data()
, but this can run slow as I'm trying to pull the data from some large maps made in ggplot2
. Is there a function to pull just the unique legend characteristics?
I'm going to create some new legends in Inkscape using the hex colors and labels from maps.
My input object is a ggplot2 object, and my desired output is a dataframe or two vectors that contain the listed items in the legend and their corresponding hex colors.
Thanks