[R] y-axis of lattice panels not printing to paper

Pam Goodman pgoodman at nwifc.org
Thu Jul 1 19:54:01 CEST 2004


Greetings, 

I am printing lattice plots from the R-interface to a printer, and although the y-axes of the left-most panels are visable on the screen, they are not present on the paper when  there are multiple panels (ie, >1). 

For example:

trellis.device(bg='white')
histogram(~dbh, data=diameter.df)

###print to a printer from the R-interface by clicking the print button on the toolbar

The above prints fine. All axes intact. 

However, 
trellis.device(bg='white')
histogram(~dbh|species, data=diameter.df)

###print to a printer from the R-interface by clicking the print button on the main toolbar

This second example does not have y-axes for the left-most panels. 

There is at least one work-around. For example, if I copy/paste as a metafile into Word, the axes are present in the printed document. However, I'm currently in the EDA phase, it's relatively more convenient to print directly to the printer, because in reality I have several graphs I am printing in a loop:

trellis.device(bg='white')
for(i in 1:50){
 print(histogram(~dbh|species.c, data=eval(parse(text=site.names.sort[i])), 
 breaks=c(0,seq(4,92,by=2)), main=site.names.sort[i], type="density"))
dev.copy()
dev.print(device=win.print)
 }

All 50 of the plots lack the y-axes in the left-most panels. Also, I tested xyplot(), and I get the same behavior. 

How can I get the y-axes of the left-most panels to be printed to the page? 

Thanks in advance, 
Pam

####################################
Pam Goodman
Biometrian
Northwest Indian Fisheries Commission
6730 Martin Way E
Olympia, WA 98516
phone: 360-438-1180
http://www.nwifc.org/
####################################




More information about the R-help mailing list