1

I came across this post: Texture in barplot for 7 bars in R? which suggests that you can use hatching in R, and I've been looking for this type of thing for a long time... However, I then realised that this post is about barplot, rather than geom_bar (or any ggplot2 function), and that any attempt to use "density" as a parameter in geom_bar just results in the parameter being ignored.

So my question is, is it possible to use the hatching density in ggplot? I know there are things like geom_patterns, but I'm not able adapt it to my needs, I just want to use hatching because I have too many colours to use distinguishible shades. And if so, how do I implement it? Whenever I google density geom_bar it shows me density plots which is not what I'm after so I'm turning to this forum for help...

Thanks

EDIT: I figured out ggpattern! I'm pretty sure I tried it before but maybe I wasn't as determined (read: desperate). so thanks for the suggestion

Agata
  • 343
  • 3
  • 13
  • 2
    Are you looking for [this](https://stackoverflow.com/questions/2895319/how-to-add-texture-to-fill-colors-in-ggplot2/20426482#20426482)? Also read Hadley's answer right below that one. Note that color in scientific plots used to be frowned upon due to printing costs, not due to color itself. – Rui Barradas May 02 '21 at 18:55
  • I think I've seen it, it looks incredibly complicated and not very neat, but perhaps it's my only option... – Agata May 02 '21 at 19:00
  • 1
    Also worth checking out: https://stackoverflow.com/a/62393160/11374827 – teunbrand May 02 '21 at 19:00
  • @RuiBarradas ok I looked at it properly, no idea how to add this to an existing plot, I don't think this will work for me... I know what you mean with the colour, it's complicated because I need 8 different shades which will be distinguishible in grey scale and are colour blind friendly, which is why I thought if I use 4 shades and hatch them half the time it'll be a lot easier to read – Agata May 02 '21 at 19:08
  • 1
    See @teunbrand comment, I have never used package `ggpattern` but it looks promising. – Rui Barradas May 02 '21 at 19:11

0 Answers0