[R] Reverse axis in xyplot()

Deepayan Sarkar deepayan at stat.wisc.edu
Fri Sep 19 00:39:12 CEST 2003


On Thursday 18 September 2003 17:22, Arni Magnusson wrote:
> Thanks Roger, for pointing out the pretty() function. It's not
> cross-referenced much in the documentation... Your example is not a
> trellis one, but following the same approach:
>
> xyplot(-y~x, scales=list(y=list(at=pretty(-y),
>  labels=rev(format(pretty(y))))))
>
> With the pretty() function this workaround does the job, and all the
> braces look pretty as well :)

This does seem to be the best workaround for now. I'll try to fix this in the 
next lattice release. 

Deepayan

> Arni
>
> On Thu, 18 Sep 2003, Roger Koenker wrote:
> > I had this question a while back in trying to do image plots of sparse
> > matrices and ended up using this:
> >
> > 	image(x=1:p,y=-(n:1),t(z),axes=FALSE, col=col,xlab=xlab,ylab=ylab)
> >         axis(1,pretty(1:p))
> >         axis(2,pretty(-(n:1)),labels=rev(pretty(1:n)))
> >
> >
> > Roger Koenker
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help




More information about the R-help mailing list