Skip to content
Prev 59169 / 398502 Next

R: [R] How to plot this

Hi,
looking at "?plot.density" you will find a "zero.line" argument: 
set it to FALSE and no gray lines will appear in the plot.

plot(density(y), zero.line = F,  main=" ", ann = F,
  xlim = c(0, 4), ylim = c(0, 1), lty = 2, col = 4, axes = F)
#and the add
 mtext(side = 1, line = 0, text = "Environmental gradient" )
 mtext(side = 2, line = 0, text = "Abundance of species"  )
 arrows(0, 0, 4, 0,  angle = 15, length = 0.1, lwd=2)
 arrows(0, 0, 0, 1,  angle = 15, length = 0.1, lwd=2)


Hope this helps
Stefano