[R] plotting text on a postscript device

Carlo Maley cmaley at cs.unm.edu
Thu Sep 30 07:18:23 CEST 1999


It seems that the text command isn't working for a postscript device.
Here is my code:

#-----------------------------
# I have stored some data in a 21 by 21 matrix called mat

x <- 1:ncol(mat);
y <- 1:nrow(mat);
labs <- c(" ", "1298", "1537", "TP53", "786", "974", "1303", "1288",
"1294", "1293", "1290", "1301", "9GATA", "935", "925", "932", "1121",
"1118", "301", "930", " ")

postscript(file="corr-markers.eps", paper="letter", family="Times",
horizontal=F,append=T,onefile=F);

image(x, y, mat, zlim=c(-1,1), col =
rev(rainbow(100,s=1,v=1,gamma=1,start=0,end=.6)), axes = FALSE,
     xlab="", ylab="", main="Correlations of Marker LoH")
text(x,rep(0.5,time=length(x)),labels=labs,srt=315,adj=0)
text(rep(0,time=length(x)), y, labels=rev(labs));

#-----------------------------

When I do this without the postscript command, I get a nice image with
all the text labels, but when I do this with the postscript command,
only the image makes it into the file.

I've even tried dev.print and dev.copy but the same behavior occurs.

Can anyone help?  I've beat against this for hours now.

        thanks, Carlo Maley
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmaley.vcf
Type: text/x-vcard
Size: 309 bytes
Desc: Card for Carlo Maley
Url : https://stat.ethz.ch/pipermail/r-help/attachments/19990929/4b077005/cmaley.vcf


More information about the R-help mailing list