79778582

Date: 2025-09-29 22:52:03
Score: 2.5
Natty:
Report link

I've encountered this and similar questions (Separate palettes for facets in ggplot facet_grid and Changing colour schemes between facets) while trying to find a solution for a very similar task. However, their solutions didn't quite work in my case. I ended up finding a solution using {ggh4x}.

You can use ggh4x's functions `scale_*_multi()` to set different colour/fill scales for each facet -- including gradients -- by setting each facet as its own named 'aes'.

I am sharing a very general answer, I know, but I bet this may be helpful for many others out there...

(PS - I'm not a frequent user of StackOverflow, so please advise me if I need to put this 'answer' as a 'comment' somewhere... sorry for any inconveniences)

Reasons:
  • Blacklisted phrase (0.5): I need
  • Blacklisted phrase (1): StackOverflow
  • Whitelisted phrase (-1.5): You can use
  • RegEx Blacklisted phrase (2.5): please advise me
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: nwd