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
Dear Carlo, have you closed the postscript-device? The code: postscript("c:/temp/temp.eps")> plot(0,0) > text(0,0,"xx") > dev.off()null device works fine at my windows r-65 The other possibilty is to dev.print(postscipt,file="" ... P On Wed, 29 Sep 1999, Carlo Maley wrote:> 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 >*************************************************************************** P.Malewski Tel.: 0531 500965 Maschplatz 8 Email: P.Malewski at tu-bs.de ************************38114 Braunschweig******************************** -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Carlo Maley wrote:> It seems that the text command isn't working for a postscript device.Carlo, The offending command is generated in the plotting, I think. It is: 77.04 91.44 563.76 714.96 cl on line 689 in the output on my system (I faked the numbers, so it may be different on yours) What is happening is the clip statement is excluding the labels. You can hack it by just deleting this line from the output. However, a proper fix will involve finding where the plotting routine generates a clip region which does not allow text to be added. I'll see if I can trace it. Jim -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Jim Lemon wrote:> Carlo Maley wrote: > > > It seems that the text command isn't working for a postscript device. > > Carlo, > > The offending command is generated in the plotting, I think. It is: > > 77.04 91.44 563.76 714.96 cl > > on line 689 in the output on my system (I faked the numbers, so it may be > different on yours) > What is happening is the clip statement is excluding the labels. You can > hack it by just deleting this line from the output. However, a proper fix > will involve finding where the plotting routine generates a clip region which > does not allow text to be added. I'll see if I can trace it. > > JimThis was indeed the problem. commenting out the cl line that showed up around half way through my file allowed the display of the text. Thanks for the work around. - Carlo -------------- 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/19990930/e41bc01b/cmaley.vcf