Richard.Cotton at hsl.gov.uk
2008-Sep-26 12:09 UTC
[R] adjusting textsize and spacing in mosaic (vcd package)
I'm trying to find a way to change the font size in a mosaic plot (the
grid version, not the base graphics one).
Here's an example to demonstrate:
#Basic plot
library(vcd)
mosaic(HairEyeColor, shade = TRUE)
#Bad first guess: this stops the default cell colouring, and doesn't
change the font size
mosaic(HairEyeColor, shade = TRUE, gp=gpar(fontsize=16))
#This successfully changes most of the text sizes, but not the numbers on
the legend scale
mosaic(HairEyeColor, shade = TRUE,
labeling_args=list(gp_labels=gpar(fontsize=16),
gp_varnames=gpar(fontsize=18)),
legend_args=list(fontsize=16),
margins=unit(4, "lines"),
legend_width=unit(7, "lines"))
How do I change the size of the text on the legend scale?
Also, is there a way to change all the font sizes at once?
Regards,
Richie.
Mathematical Sciences Unit
HSL
------------------------------------------------------------------------
ATTENTION:
This message contains privileged and confidential inform...{{dropped:20}}
David Meyer
2008-Sep-28 16:49 UTC
[R] adjusting textsize and spacing in mosaic (vcd package)
Richard, > How do I change the size of the text on the legend scale? This should work with `fontsize', but doesn't which is a bug (fixed in the next release). > Also, is there a way to change all the font sizes at once? Not yet, but this is a good suggestion. Thanks David
Richard.Cotton at hsl.gov.uk
2008-Sep-29 16:01 UTC
[R] adjusting textsize and spacing in mosaic (vcd package)
> I'm trying to find a way to change the font size in a mosaic plot (the > grid version, not the base graphics one). > > Here's an example to demonstrate: > #Basic plot > library(vcd) > mosaic(HairEyeColor, shade = TRUE) > > #Bad first guess: this stops the default cell colouring, and doesn't > change the font size > mosaic(HairEyeColor, shade = TRUE, gp=gpar(fontsize=16)) > > #This successfully changes most of the text sizes, but not the numberson> the legend scale > mosaic(HairEyeColor, shade = TRUE, > labeling_args=list(gp_labels=gpar(fontsize=16), > gp_varnames=gpar(fontsize=18)), > legend_args=list(fontsize=16), > margins=unit(4, "lines"), > legend_width=unit(7, "lines")) > > How do I change the size of the text on the legend scale? > > Also, is there a way to change all the font sizes at once?For mailing list posterity, the workaround that was sent to me off-list is to set the pointsize argument on the device, for example: windows(pointsize=16) mosaic(HairEyeColor, shade = TRUE) Interestingly, this appears to only change the legend scale fontsize, and ignore the other text. Regards, Richie. Mathematical Sciences Unit HSL ------------------------------------------------------------------------ ATTENTION: This message contains privileged and confidential inform...{{dropped:20}}