Search code examples
rplotfillhatchstyle

R: using hatched fill in plots


I was using R to make some plots for a report. I see that the plots don't seem to be so smooth. I am new to R so don't know much. But how do I get smooth plots?

Also by default the plots are filled with solid colors but I want to have hatched fills in my pie charts and bar plots. Is there a way to do that in R, I couldn't find it through a basic google search so I put this question here.


Solution

  • Did you try help(pie)?

    density: the density of shading lines, in lines per inch.  The default
              value of ‘NULL’ means that no shading lines are drawn.
              Non-positive values of ‘density’ also inhibit the drawing of
              shading lines.
    
    pie(c(1,2,3),density=c(1,2,20))
    
    hist(runif(200),density=c(10,20,30))