joelcarlson / RImagePalette

Create a representative palette from an image.
https://github.com/joelcarlson/RImagePalette
Other
45 stars 1 forks source link

In discrete scale ggplots the plot colors don't match the legend colors! #5

Closed joelcarlson closed 8 years ago

joelcarlson commented 8 years ago

This is a big problem! It seems that ggplot2::discrete_scale() calls the palette (RImagePalette::image_pal()) twice, once for the colors on the plot, and once for the legend. Since there is some randomness in median cut, this often results in a different palette, and thus different colors.

Yikes.

Need to set the seeds properly somewhere in image_pal

joelcarlson commented 8 years ago

Fixed.