Thanks Deepayan, I'd never have figured that out for myself. On Sat, 21-Jun-2014 at 08:47PM +0530, Deepayan Sarkar wrote: |> On Sat, Jun 21, 2014 at 1:00 PM, Patrick Connolly |> <p_connolly at slingshot.co.nz> wrote: |> > Hello Deepayan, |> > |> > The question below I asked on the Rhelp list. For the first time in |> > my experience, what Brian Ripley says seems not to be the case. No |> > one else made any comment, hence this direction to the main Lattice |> > man. |> > |> > It might, indeed, be more of a grid issue which you would understand |> > better than the rest of us. Please direct me to any documentation |> > that covers the question. My searches have been unsuccessful. |> |> Basically, the settings are taken from |> |> > trellis.par.get("fontsize") |> $text |> [1] 12 |> |> $points |> [1] 8 |> |> I'll give a more detailed response on r-help. |> |> -Deepayan |> |> > Thank you. |> > |> > |> > ----- Forwarded message from Patrick Connolly <p_connolly at slingshot.co.nz> ----- |> > |> > Date: Thu, 12 Jun 2014 21:01:20 +1200 |> > From: Patrick Connolly <p_connolly at slingshot.co.nz> |> > To: Prof Brian Ripley <ripley at stats.ox.ac.uk> |> > Cc: R-help <r-help at r-project.org> |> > Subject: Re: [R] Trellis devices and pointize |> > User-Agent: Mutt/1.5.21 (2010-09-15) |> > |> > On Mon, 09-Jun-2014 at 08:33AM +0100, Prof Brian Ripley wrote: |> > |> > |> The issue here is not trellis.device. |> > |> |> > |> You are using lattice plots (without mentioning lattice), which are |> > |> based on package 'grid' and so using the grid sub-system of a |> > |> device. That sub-system does not use the 'pointsize' of the device |> > |> as its initial font size. So you need to use |> > |> |> > |> grid::gpar(fontsize = 28) |> > |> |> > |> If I call that after opening the device I get what I guess you expected. |> > |> > I don't see it making any difference at all. At one time I supposed |> > that some clever inner workings rescaled everything to something more |> > sensible for a plotting region that size, but that is not the case. |> > |> >> trellis.device(device = pdf, file = "Singers.pdf", height = 160/25.4, |> > + width = 160/25.4) |> > |> >> grid::get.gpar()$fontsize |> > [1] 12 |> >> grid::gpar(fontsize = 8) |> > $fontsize |> > [1] 8 |> > |> >> grid::get.gpar()$fontsize |> > [1] 12 |> >> |> > |> > Evidently I missed something somewhere. Grid graphics is sometimes a |> > bit too subtle for me. I know gpar() doesn't work exactly analogously |> > to the way par() works. I can't find any examples in Paul's "R |> > Graphics" book or Deepayan's "Lattice" book (but that might just be |> > lack of searching skills). |> > |> > Then I tried putting it in the call to print.trellis: |> > |> > print(pik, plot.args = grid::gpar(fontsize = 8)) |> > |> > and in the bwplot() call similar to the way I'd done in panel functions |> > with an argument called gp but I get no error message or any |> > difference in my resulting plot. |> > |> > I know I can fiddle with trellis.par.get() and trellis.par.set() but |> > that's a bit long-winded when it's so simple to do in base graphics. |> > |> > TA |> > |> > |> |> > |> |> > |> On 09/06/2014 07:54, Patrick Connolly wrote: |> > |> >How is the pointsize set in trellis.devices? |> > |> > |> > |> >>From my reading of the trellis.device help file, I understood that the |> > |> >pointsize arg would be referenced to the call to the pdf function. |> > |> > |> > |> >So I set up a trellis pdf device as so: |> > |> > |> > |> > trellis.device(device = pdf, file = "Singers.pdf", height = 160/25.4, |> > |> > width = 160/25.4, pointsize = 28) |> > |> > |> > |> >A base R graphics plot works as I'd expected. |> > |> > |> > |> > plot(1:10, 50:59) # silly plot with huge plotting characters and letters |> > |> > |> > |> >However, pointsize is ignored in trellis plots; |> > |> > |> > |> > pik <- bwplot(voice.part ~ height, data = singer)# pointsize ignored |> > |> > print(pik) |> > |> > dev.off() |> > |> > |> > |> >There are many trellis cex-type settings, but FWIU they're all |> > |> >relative to the default size. My question is: How do I set that |> > |> >default? |> > |> > |> > |> > |> > |> >R version 3.0.2 (2013-09-25) |> > |> >Platform: i686-pc-linux-gnu (32-bit) |> > |> > |> > |> >locale: |> > |> > [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C |> > |> > [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 |> > |> > [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 |> > |> > [7] LC_PAPER=en_US.UTF-8 LC_NAME=C |> > |> > [9] LC_ADDRESS=C LC_TELEPHONE=C |> > |> >[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C |> > |> > |> > |> >attached base packages: |> > |> >[1] grDevices utils stats graphics methods base |> > |> > |> > |> >other attached packages: |> > |> >[1] RColorBrewer_1.0-5 lattice_0.20-24 |> > |> > |> > |> >loaded via a namespace (and not attached): |> > |> >[1] grid_3.0.2 plyr_1.8 tools_3.0.2 |> > |> > |> > |> >I've tried with R-3.1.0 on another machine so I don't think the |> > |> >problem is with an old version. |> > |> > |> > |> >I doubt it has much to do with pdf specifically. Attempts to use png, |> > |> >bitmap, postscript devices all produce equivalent results. |> > |> > |> > |> > |> > |> > |> > |> >(Here's all the example code uninterrupted:) |> > |> > |> > |> > trellis.device(device = pdf, file = "Singers.pdf", height = 160/25.4, |> > |> > width = 160/25.4, pointsize = 28) |> > |> > plot(1:10, 50:59) # silly plot with huge plotting characters and letters |> > |> > pik <- bwplot(voice.part ~ height, data = singer)# pointsize ignored |> > |> > print(pik) |> > |> > dev.off() |> > |> > |> > |> > |> > |> >TIA |> > |> > |> > |> > |> > |> |> > |> |> > |> -- |> > |> Brian D. Ripley, ripley at stats.ox.ac.uk |> > |> Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ |> > |> University of Oxford, Tel: +44 1865 272861 (self) |> > |> 1 South Parks Road, +44 1865 272866 (PA) |> > |> Oxford OX1 3TG, UK Fax: +44 1865 272595 |> > |> > -- |> > ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. |> > ___ Patrick Connolly |> > {~._.~} Great minds discuss ideas |> > _( Y )_ Average minds discuss events |> > (:_~*~_:) Small minds discuss people |> > (_)-(_) ..... Eleanor Roosevelt |> > |> > ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. |> > |> > ______________________________________________ |> > R-help at r-project.org mailing list |> > https://stat.ethz.ch/mailman/listinfo/r-help |> > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html |> > and provide commented, minimal, self-contained, reproducible code. |> > |> > ----- End forwarded message ----- |> > |> > -- |> > ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. |> > ___ Patrick Connolly |> > {~._.~} Great minds discuss ideas |> > _( Y )_ Average minds discuss events |> > (:_~*~_:) Small minds discuss people |> > (_)-(_) ..... Eleanor Roosevelt |> > |> > ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. |> > -- ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. ___ Patrick Connolly {~._.~} Great minds discuss ideas _( Y )_ Average minds discuss events (:_~*~_:) Small minds discuss people (_)-(_) ..... Eleanor Roosevelt ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.