Re: [R] fonts in mosaic

From: Achim Zeileis <Achim.Zeileis_at_uibk.ac.at>
Date: Wed, 30 Mar 2011 16:49:53 +0200 (CEST)

On Wed, 30 Mar 2011, Erich Neuwirth wrote:

> I need to change the font(s) used in mosaic from package vcd.
> The help file and the vignette do not give very explicit examples for
> doing that.
> The easiest solution would be changing the font for everything
> on the graph: var labels, var names, title, subtitle, and cell labels.
> What is the easiest way of accomplishing this?

Personally, I simply change the size of the device I'm plotting on. When I plot on a large device, the fonts will be relatively smaller, and vice versa. This is what I do when including graphics in PDF files (papers, slides, reports, etc.).

For fine control, you can set the arguments of the labeling function employed. ?strucplot shows that the default is ?labeling_border which has several arguments. For example you can set the graphical parameters of the labels (gp_labels) or the graphical parameters of the variable names (gp_varnames). Both arguments take ?gpar lists ("grid" graphical parameters). For example you may do

   mosaic(UCBAdmissions)

and

   mosaic(UCBAdmissions, labeling_args = list(

     gp_labels = gpar(fontsize = 12, fontface = 3),
     gp_varnames = gpar(fontsize = 16, fontface = 2)
   ))

etc.

Hope that helps,
Z

> ______________________________________________
> 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.
>



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. Received on Wed 30 Mar 2011 - 14:58:10 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 30 Mar 2011 - 15:30:25 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive