Grid line consistent with ticks on axis

后端 未结 4 1045
悲&欢浪女
悲&欢浪女 2020-12-13 14:38

I am embarrassed to ask this simple question, but has been in kicking my mind for several days whenever I create a plot:

plot (x = 1:10, y = rnorm (10, 5, 2)         


        
4条回答
  •  鱼传尺愫
    2020-12-13 15:15

    From ?grid description of the nx and ny arguments:

    When NULL, as per default, the grid aligns with the tick marks on the corresponding default axis (i.e., tickmarks as computed by axTicks)

    plot (x = 1:10, y = rnorm (10, 5, 2)) 
    grid (NULL,NULL, lty = 6, col = "cornsilk2") 
    

提交回复
热议问题