Skip to content
Prev 172667 / 398506 Next

problems with exporting a chart

Elena Wilson wrote:
There is also a win.metafile(), by the way.
You probably do not want the legend function that is intended to works 
with base graphics. Instead, use the "key" argument for your lattice 
function histogram() as described in the help page ?xyplot.

Example:


histogram( ~ Delta_R2 | as.factor(Size), type="percent", col="red", 
xlab="Delta OLS - SV R squared", main="R Squared Deviations",
     panel = function(x, ...){
         panel.histogram(x, ...)
          draw.key(list(cex=0.7, text=list(lab=c(paste(c('Mean', 'SD', 
'Median', 'IQR'), round(c(mean(x), sd(x), median(x), IQR(x)), 3), 
sep="=")))),
                   draw = TRUE,
                   vp = viewport(x = unit(0.25, "npc"), y = unit(0.9, 
"npc")))
     })



Next, you probably do not want to copy but just re-print into an 
appropriate device.


Uwe Ligges