Skip to content

Define ylim in lattice plot based upon panel function output

3 messages · Deepayan Sarkar, Sébastien Bihorel

#
On Tue, Apr 19, 2011 at 7:38 AM, S?bastien Bihorel <pomchip at free.fr> wrote:
Read up on the 'prepanel' argument (in ?xyplot). What you want is
actually already defined -- see ?prepanel.loess.

xyplot(y~x,data=df,
       prepanel = prepanel.loess,
       panel=function(x,y,...){
           panel.xyplot(x,y)
           panel.loess(x,y)
       })

-Deepayan