[R] xyplot: adjusting the scale (min, max & tick)

Peter Ehlers ehlers at ucalgary.ca
Wed Jan 6 06:24:19 CET 2010


Have a look at the 'scales' argument. For example:

# default plot
xyplot(Sepal.Length ~ Petal.Length | Species, data = iris)

# modified plot
xyplot(Sepal.Length ~ Petal.Length | Species, data = iris,
     scales=list(y=list(at=c(-5,0,5,10), limits=c(-5,10))))

  -Peter Ehlers

Jay wrote:
> Hi,
> 
> I'm terribly sorry but it seems it cannot figure this one out by
> myself so, please, if somebody could help I would be very grateful.
> So, when I plot with xyplot() I get an y-axis that is very ugly...
> starting from a random number and having so many ticks that it becomes
> unreadable.
> 
> How do I tell xyplot how to draw the axis? E.g., start from 100, end
> at 200 with 25 units between ticks/labels?
> Can somebody give me an example?
> 
> Thanks!
> 
> ______________________________________________
> R-help at r-project.org 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.
> 
> 

-- 
Peter Ehlers
University of Calgary
403.202.3921



More information about the R-help mailing list