[R] Troubles in plotting to a postscript file (not to png)

pilchat pilchat at gmail.com
Mon Nov 29 15:00:00 CET 2010


Hi guys,

to make it easier, here is a simple case with the same issues. I use the 
short function below to make the attached PS file.

Things to fix:

-) the greek letter "lambda" is not printed, while "mu" is printed (see 
the plot command)
-) the annotation inside the plot area: the "+-" symbol and "(K)" 
overlap with the substitute for tmed and tstd respectively (see the text 
command). Also, how can I set the number of decimal digits for tmed and 
tstd? (option(digits=4) does not work )

Moreover, I'd like to make the characters thicker. Is there any way? 
Finally, once I close the R session without saving it (I answer "n" when 
quitting), the content of the ps file is erased. Do I miss something in 
writing the function?

Thanks

Gaetano


plot_example=function()
{

setPS()
postscript (file='plot_example.ps',width=5,height=5,horizontal = FALSE, 
paper = "special",family = "ComputerModern",encoding="TeXtext.enc")

tmed<-1.23456789
tstd<-1.23456789

plot(c(0,1),c(0,1),xlab=expression(paste(lambda,mu,T)),main="",sub="(a)")#"lambda" 
not printed
text(.0,.8,substitute( T[disk,med] == tmed %+-% tstd 
(K),list(tmed=tmed,tstd=tstd)),pos=4,cex=1.5  )#overlapping symbols and 
numbers

dev.off()

}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: plot_example.ps
Type: application/postscript
Size: 9607 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20101129/301cdadf/attachment.ps>


More information about the R-help mailing list