Skip to content

Lattice, ggplot, and pointsize

2 messages · Deepayan Sarkar, Milan Bouchet-Valat

#
On Sun, May 26, 2013 at 12:47 AM, Milan Bouchet-Valat <nalimilan at club.fr> wrote:
If I remember correctly (it was a long time ago), I had nothing in
particular against the default text fontsize. The default symbol size
in grid was larger than I liked, and so fontsize$points was set to
something more reasonable, and fontsize$text just seemed natural to
add. It is only ever used in a single call to gpar() inside
print.trellis. So it seems perfectly reasonable to take the default of
fontsize$text from grid instead.

I don't like the idea of making the default
'get.gpar("fontsize")$fontsize' though, because that requires a device
to be active, which canonical.theme() doesn't by design. Instead I
have changed the default to NULL, and the fontsize is now set from (in
order of priority)

1. trellis.par.get("fontsize")$text  # NULL by default
2. trellis.par.get("grid.pars")$fontsize # NULL by default
3. get.gpars()$fontsize # approximately device pointsize by default

Hopefully this works for you. You can test using the r-forge version.

-Deepayan
[...]
#
Le mercredi 05 juin 2013 ? 19:37 +0530, Deepayan Sarkar a ?crit :
Thanks! I've just tested it and it seems to fix the problem. Your
solution indeed makes more sense. This nicely proves that grid graphics
can perfectly cooperate with output devices.

Do you think that symbol size could also adapt in the same way? It
sounds natural that the default the ratio between symbol size and text
size is constant disregarding the device's pointsize. To retain the
current default, it would mean that
points = 8/12 * text


Regards