Grid in an R plot

后端 未结 4 1125
借酒劲吻你
借酒劲吻你 2020-12-08 06:47

Is there a command to easily add a grid onto an R plot?

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-08 07:31

    I agree with cbare. Use abline to draw lines only where you really need.

    Example from my last code:

    abline(v=c(39448, 39814), col="grey40")
    abline(h=c(-0.6, -0.4, -0.2, 0.2,0.4,0.6), col="grey10", lty="dotted") 
    

    remember that:

    v is for vertical lines. h for horizontal.

    exploit the commands

    lty for dotted line color for light coloured line

    in order to obtain "no heavy grid".

提交回复
热议问题