Re: [R] fonts in mosaic

From: Michael Friendly <friendly_at_yorku.ca>
Date: Thu, 31 Mar 2011 08:44:06 -0400

If you are doing multiple plots like this, there is no way I know of to specify the fonts for labeling *once* for all such plots. However, you can do something like this to save typing and keep things consistent:

my.largs <- list(

     gp_labels = gpar(fontsize = 12, fontfamily = "calibri"),
     gp_varnames = gpar(fontsize = 16, fontfamily = "calibri"))

mosaic(UCBAdmissions, labeling_args=my.largs) mosaic(UCBAdmissions, labeling_args=my.largs, shade=TRUE)

etc.

On 3/30/2011 2:42 PM, Henrique Dallazuanna wrote:
> Try this:
>
> windowsFonts(calibri = windowsFont("Calibri"))
>
> mosaic(UCBAdmissions, labeling_args = list(
> gp_labels = gpar(fontsize = 12, fontfamily = "calibri"),
> gp_varnames = gpar(fontsize = 16, fontfamily = "calibri")
> ))
>
> On Wed, Mar 30, 2011 at 3:25 PM, Erich Neuwirth
> <erich.neuwirth_at_univie.ac.at> wrote:
>> Achim
>> I simply want to replace the font R uses on mosaic (whatever it is)
>> by a font of my choice (say Calibri or Arial)
>> because I need to embed the R charts in a PowerPoint
>> presentation and want the fonts to match.
>> And I want the most simple way of accomplishing this.
>> I worked my way through the strucplot vignette,
>> but I could not extract enough information there.
>> Is there some information about the proper font names
>> to use in R?
>>
>>
>>> 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
>>>>
>>
>> ______________________________________________
>> 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.
>>
>
>
>

-- 
Michael Friendly     Email: friendly AT yorku DOT ca
Professor, Psychology Dept.
York University      Voice: 416 736-5115 x66249 Fax: 416 736-5814
4700 Keele Street    Web:   http://www.datavis.ca
Toronto, ONT  M3J 1P3 CANADA

______________________________________________
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 Thu 31 Mar 2011 - 12:46:21 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 Thu 31 Mar 2011 - 12:50:26 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