Search code examples
rplotlatticer-gridecdf

Add a grid to an "ecdfplot" in R


I am using the latticeExtra library "ecdfplot" to plot my error. I want to add gridlines.

The following does not seem to work:

ecdfplot(err)
grid(ny=10)

It gives the following (gridless) result: enter image description here

I really would love to give a "graphical summary" where the quantiles are indicated by lines, and their intersections with the data are shown on the x-axis.

Can you tell me how to add gridlines? How about adding vertical lines at a particular x-location?


Solution

  • Try the argument axis = axis.grid

    require(latticeExtra)
    
    data(singer, package = "lattice")
    ecdfplot(~height, data = singer, add=TRUE, axis = axis.grid, par.settings = theEconomist.theme())
    

    enter image description here