On 4/3/08, Saptarshi Guha <[EMAIL PROTECTED]> wrote:
> Hello,
> How can i increase the padding between the axis and the data
> region(box just containing the figure) in xyplot?
>
> An example:
> new <- function(x){ if(x<0){ return(x^2) }else{ return(x) } }
> x <- seq(-1,1,length.out=100)
> y <- sapply(x,new)
> sc=list()
> sc$alternating=0
> sc$tck=0
>
> xyplot(y~x,type='l',
> aspect=0.05,
> scales=sc,
> col='black',
> xlab='',
> ylab=''
> )
> When plotted on quartz(Mac) device, there is very little padding
> between the bottom of the curve and the lower horizontal axis and
> between the maximum values of the curve and the upper horizontal axis.
> How can i increase the padding - top,bottom,left and right?
The default padding is taken from lattice.getOption("axis.padding"),
and you could change it to, say, 20% using
xyplot(y~x,aspect=0.05,scales=sc,
lattice.options = list(axis.padding = list(numeric = 0.2)))
For finer control, write your own prepanel function.
-Deepayan
______________________________________________
[email protected] 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.