1

Does anyone know how to add shading lines in an area or histogram plot in ggplot2?

For example, How could I reproduce the following plot in ggplot2 ?

hist(mtcars$hp, density = 10)

Thanks.

lcgodoy
  • 763
  • 5
  • 14
  • 3
    Possible duplicate of [How to add texture to fill colors in ggplot2?](https://stackoverflow.com/questions/2895319/how-to-add-texture-to-fill-colors-in-ggplot2) – Z.Lin May 16 '18 at 13:50
  • Hadley (creator of `ggplot2` package) has stated before that the underlying drawing system [does not support such textures](https://stackoverflow.com/questions/2895319/how-to-add-texture-to-fill-colors-in-ggplot2). Some hack workarounds for this can be found on SO (see alternative answer in suggested dupe), though I haven't tried them myself. – Z.Lin May 16 '18 at 13:53
  • The solution is a workaround, and I actually wanted to apply it to maps with `geom_sf`. So I'll look for another way to visualize it. Anyway, thank you very much for the help. – lcgodoy May 16 '18 at 14:11

0 Answers0