1

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

elliot
  • 1,844
  • 16
  • 45
  • Your question is unclear, please read and edit your question according to: [How to make a great R reproducible example?](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) – pogibas Sep 30 '18 at 19:38
  • Can you be a bit more specific in what's unclear? I'm having difficulting creating a reproducible example as I don't have an error that I'm trying to overcome. – elliot Sep 30 '18 at 19:41
  • What's your input and wanted output? – pogibas Sep 30 '18 at 19:42
  • Thanks, see the edits. I have a series of ggplot2 objects and would like to get a dataframe or list out that specifies colors and labels. – elliot Sep 30 '18 at 19:47

0 Answers0