Home > Blockchain >  Sequential Colour Palettes Across Facets in ggplot2
Sequential Colour Palettes Across Facets in ggplot2

Time:01-14

I'm building a dashboard which includes a lollypop graph of top 10 locations by number of visitors, faceted by year. Here is a roughly similar plot I constructed using dummy data:

enter image description here

To reorder the locations by total number of visitors per facet, enter image description here

To modify the color palette to darken the lightest values, you could expand the color limits to include values less than any of your data, effectively shifting the colors to start farther up the scale. I know rank doesn't go below 1, so having the color scale start at -5 will shift everything along.

  scale_color_distiller(type = "seq", palette = "Oranges",  direction = 1,
                        limits = c(-5, NA))  

enter image description here

  •  Tags:  
  • Related