[R] Cairo creates italized plots?

Albin Blaschka albin.blaschka at standortsanalyse.net
Thu Oct 20 12:59:16 CEST 2011



Am 19.10.2011 17:33, schrieb Fong Chun Chan:
> Hi,
>
> Has anyone else run into this weird behaviour where the text in the plots
> created using Cairo are always italicized.  For example,
>
> library(Cairo)
> Cairo(file='cairo_created', type='pdf', dpi=100)
>   plot(1:10)
> dev.off()
>
> This produces the following attached 'cairo_created.pdf' graph.  Notice how
> the text is italicized.  The same code but using pdf() as the graphics
> device:
>
> pdf(file='pdf_created.pdf')
> plot(1:10)
> dev.off()
>
> Produces the attached 'pdf_created.pdf' graph in which the text is
> non-italicized.  I am unable to find out what the difference is here and set
> the Cairo() function to produce non-italicized text in my graphs.  Both
> graphic devices appear to default to Helvetica.
>
> Anyone have any suggestions?

Here on Win 7 and R 2.13.0 and Cairo 1.5-0 it was not possible to 
reproduce it, the plot produced on my computer with your code came with 
plain text, not italicized...

Which plattform are you on? Did you try CairoFonts?

regards,
Albin


-- 
| Albin Blaschka, Mag.rer.nat.
| Etrichstrasse 26, A-5020 Salzburg
| * www.albinblaschka.info * www.thinkanimal.info *
| - It's hard to live in the mountains, hard but not hopeless!



More information about the R-help mailing list