Wolfram Fischer - Z/I/M
2003-Jan-24 18:37 UTC
[R] problem with srt vector in xyplot {lattice}
[ R 1.6.1 ] PROBLEM The plot of the appended code does produce a postscript file which is not interpretable by gv under Linux. REMARK If the srt argument is commented out or set to a constant like 45 or 90, the ps file becomes interpretable. CODE xytest <- function( ... ){ with( airquality, { print( xyplot( Ozone ~ Temp | Month , panel = function( x, y, subscripts, ... ){ ltext( x, y, Temp[subscripts] , srt = 45 / max( Solar.R, na.rm=T ) * Solar.R ) } , ... ) )}) } xytest() ## works! trellis.device( 'postscript', file = 'x.ps' ) xytest() dev.off() QUESTION Is there a workaround? Wolfram
On Friday 24 January 2003 10:54 am, Wolfram Fischer - Z/I/M wrote:> [ R 1.6.1 ] > > PROBLEM > The plot of the appended code does produce > a postscript file which is not interpretable > by gv under Linux.The srt vector has several NA's. x11() does not draw these, which may or may not be what you want. You should be able to reproduce that in postscript() with an additional subset = !is.na(Solar.R) argument to xyplot().> REMARK > If the srt argument is commented out or set to a constant > like 45 or 90, the ps file becomes interpretable. > > CODE > xytest <- function( ... ){ > with( airquality, { print( xyplot( > Ozone ~ Temp | Month > , panel = function( x, y, subscripts, ... ){ > ltext( x, y, Temp[subscripts] > , srt = 45 / max( Solar.R, na.rm=T ) * Solar.Rdon't you mean Solar.R[susbscripts] ?> ) > } > , ... > ) > )}) > } > > xytest() ## works! > > trellis.device( 'postscript', file = 'x.ps' ) > xytest() > dev.off() > > > QUESTION > Is there a workaround? > > > Wolfram > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > http://www.stat.math.ethz.ch/mailman/listinfo/r-help