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

From: Pam Goodman <pgoodman_at_nwifc.org>
Date: Fri 02 Jul 2004 - 03:54:01 EST


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/
####################################



R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Jul 02 04:00:54 2004

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 09:12:23 EST