Hi there, yet on the topic of greek letters and pdf plotting: when I run the following code pdf(file="temp.pdf") mu=seq(from=-pi, to=pi, length=100) plot(mu, sin(mu^2), type="l", xlab=expression(mu%in%(list(-pi,pi))), ylab=expression(sin(mu^2)), main=expression((list(mu,sin(mu^2))))) dev.off() I get a "proportional to" symbol in place of a "mu" and a "not equal to" in place of a "pi" (see attached file). If I run only mu=seq(from=-pi, to=pi, length=100) plot(mu, sin(mu^2), type="l", xlab=expression(mu%in%(list(-pi,pi))), ylab=expression(sin(mu^2)), main=expression((list(mu,sin(mu^2))))) then the characters are displayed correctly. I would like to know if there is any sort of fixes to this problem, such as specifying the symbols font or embedding fonts into the pdf file. Any help would be welcome. Thanks in advance and best regards, Eduardo Horta -------------- next part -------------- A non-text attachment was scrubbed... Name: temp.pdf Type: application/pdf Size: 5726 bytes Desc: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110127/65b8ba1c/attachment.pdf>
Please do read the help page (and state your platform). This is s known PDF viewer bug. E.g.: If you see problems with PDF output, do remember that the problem is much more likely to be in your viewer than in R. Try another viewer if possible. Symptoms for which the viewer has been at fault are apparent grids on image plots (turn off graphics anti-aliasing in your viewer if you) and missing or incorrect glyphs in text (viewers silently doing font substitution). See also the section on 'Cairo fonts' in ?X11, which has a diagnosis and workaround. On Thu, 27 Jan 2011, Eduardo de Oliveira Horta wrote:> Hi there, > > yet on the topic of greek letters and pdf plotting: when I run the > following code > > pdf(file="temp.pdf") > mu=seq(from=-pi, to=pi, length=100) > plot(mu, sin(mu^2), > type="l", > xlab=expression(mu%in%(list(-pi,pi))), > ylab=expression(sin(mu^2)), > main=expression((list(mu,sin(mu^2))))) > dev.off() > > I get a "proportional to" symbol in place of a "mu" and a "not equal > to" in place of a "pi" (see attached file). If I run only > > mu=seq(from=-pi, to=pi, length=100) > plot(mu, sin(mu^2), > type="l", > xlab=expression(mu%in%(list(-pi,pi))), > ylab=expression(sin(mu^2)), > main=expression((list(mu,sin(mu^2))))) > > then the characters are displayed correctly. > > I would like to know if there is any sort of fixes to this problem, > such as specifying the symbols font or embedding fonts into the pdf > file. Any help would be welcome. > > Thanks in advance and best regards, > > Eduardo Horta >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
On Thu, Jan 27, 2011 at 01:29:31AM -0200, Eduardo de Oliveira Horta wrote:> Hi there, > > yet on the topic of greek letters and pdf plotting: when I run the > following code > > pdf(file="temp.pdf") > mu=seq(from=-pi, to=pi, length=100) > plot(mu, sin(mu^2), > type="l", > xlab=expression(mu%in%(list(-pi,pi))), > ylab=expression(sin(mu^2)), > main=expression((list(mu,sin(mu^2))))) > dev.off() > > I get a "proportional to" symbol in place of a "mu" and a "not equal > to" in place of a "pi" (see attached file). If I run onlyIn my PDF viewer (okular, debian LINUX) the file looks ok. This may very well be a problem with your pdf viewer. E.g. at work, we are running fedora and there I have experienced a number of problems like yours caused by a problem with font substitution in some version of the poppler library which is uses by many LINUX PDF viewers. Try to view the file in acrobat reader and possibly other viewers. Also: the files I had issues with printed correctly. cu Philipp -- Dr. Philipp Pagel Lehrstuhl f?r Genomorientierte Bioinformatik Technische Universit?t M?nchen Wissenschaftszentrum Weihenstephan Maximus-von-Imhof-Forum 3 85354 Freising, Germany http://webclu.bio.wzw.tum.de/~pagel/