[R] Sweave PDF files show plot symbols as "q"

Allan Engelhardt allane at cybaea.com
Wed Jun 30 14:26:30 CEST 2010


A simpler option is probably to put

<<echo=FALSE>>=
pdf.options(useDingbats = FALSE)
@


near the top of the Sweave document.

Thanks again!

> Thank you Gavin, this is useful.  The work-around for me then is to 
> quickly run
>
> pdf("test.pdf")
> plot(0:25, pch=0:25)
> dev.off()
>
>
> to see which "pch" values are not safe (unsafe.pch <- c(1, 10, 13, 16, 
> 19, 20, 21)) and make sure I never use them.  (The first four, btw., 
> corresponds to the symbols that are different in S and R.)
>
> This should be feasible, if somewhat tedious to test.  Does anybody 
> know of a way to get R to stop if a 'pch' value in this list is ever 
> being used?
>
> Changing configuration files on clients' systems in three continents 
> isn't really an option.  They expect it to "just work" when they click 
> on the file.  I guess I could always downgrade to SPSS or 
> something.... :-)
>
> Thanks again
>
> Allan
>
>
> On 30/06/10 12:05, Gavin Simpson wrote:
>> On Wed, 2010-06-30 at 10:19 +0100, Allan Engelhardt wrote:
>>> I'm guessing this is a FAQ but I can't find it and that it is probably
>>> not exclusive R related but relevant so I thought I'd ask:
>>>
>>> When I view the PDF output from Sweave (e.g. Example 1 from the 
>>> author's
>>> web site at [1]) on a Linux system using the standard PDF viewer [2],
>>> the circles for the outliers in the plot [boxplot(Ozone ~ Month, data =
>>> airquality)] show up as the letter 'q'.
>>>
>>> [...]
>>>
>>> I need to generate reports from R that work (=look the same) across
>>> platforms: does anybody have a suggestion for a workaround?
>> See ?pdf particularly the Notes section, which has:
>>
>>       On some systems the default plotting character ‘pch = 1’ is
>>       displayed in some PDF viewers incorrectly as a ‘"q"’ character.
>>       (These seem to be viewers based on the ‘poppler’ PDF rendering
>>       library). This may be due to incorrect or incomplete mapping of
>>       font names to those used by the system.  Adding the following
>>       lines to ‘~/.fonts.conf’ or ‘/etc/fonts/local.conf’ may circumvent
>>       this problem.
>>
>>
>>
>> <alias binding="same">
>> <family>ZapfDingbats</family>
>> <accept><family>Dingbats</family></accept>
>> </alias>
>>
>> HTH
>>
>> G
> [...]
>
> ______________________________________________
> 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.



More information about the R-help mailing list