[R] graphics: y limit on xyplot

Gabor Grothendieck ggrothendieck at gmail.com
Mon Sep 11 06:42:21 CEST 2006


It should have length 2, i.e. lower limit and upper limit.

On 9/11/06, Murray Pung <mcpung at gmail.com> wrote:
> I would like to set the y axis limit of an xyplot using the object 'ylimit',
> but receive this error:
> [1] 990
> Error in extend.limits(limitlist[[i]], axs = axs) :
>   improper length of lim
>
> I get the same error if I use ylim.
>
> library(lattice)
> trellis.device(col = FALSE, theme = lattice.getOption("col.whitebg"))
> name <- "Variable name"
> symbols <- c(1,2,3,4,5,6,7,8,9)
> patientp <- c(1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9)
> varp <-
> c(826,119,168,90,572,323,122,10,42,900,250,180,120,650,400,130,12,33)
> visitp <- c(1,1,1,1,1,1,1,1,1,3,3,3,3,3,3,3,3,3)
> yall <- c(varp,varl,varm,varh)
> ylimit <- max(yall)*1.1
> xyplot(varp ~ visitp,
>            xlab = "Visit",
>            ylab = name,
>            group = patientp,
>            type = "b",
>            lty = 1,
>            as.table = TRUE,
>            main = list("Placebo",cex = 1.0),
>            scales = list(relation = "free",x = list(tick.number = 1,at =
> c(1,3)),y = list(limits = ylimit)),
>            auto.key = list(space = "right",cex = 1.1),
>            par.settings = list(superpose.symbol = list(pch = symbols,cex =
> 1.1)))
>
>
>
>
> --
> Murray Pung
> Statistician, Datapharm Australia Pty Ltd
> 0404 273 283
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list