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
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