To the plot experts: when creating a plot containing different lines, each with a special line type, it may happen that the result of 'postscript()' is not readable by ghostview (which may not be an R error, thus not bug report ;-). This is the case when mixing lty as 0:6 and character or even when using lty as character only. Example: postscript("test.ps") plot(1:10, type="l", lty=1) lines(sample(10), lty="9A1A1A") lines(sample(10), lty="1A6A7A") lines(sample(10), lty="9B") lines(sample(10), lty="1F") legend(4,4,paste("test", 1:5), lty=c(1, "9A1A1A","1A6A7A","9B","1F")) dev.off() gives (for me) the ghostscript error message: hothorn at artemis:~/tmp/lty > ps2epsi test.ps Error: /rangecheck in --setdash-- Operand stack: --nostringval-- 0 Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- 2 3 %oparray_pop --nostringval-- --nostringval-- false 1 %stopped_push 1 3 %oparray_pop 1 3 %oparray_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push --nostringval-- 2 4 %oparray_pop --nostringval-- --nostringval-- Dictionary stack: --dict:918/1241(G)-- --dict:0/20(G)-- --dict:53/200(L)-- --dict:50/72(L)-- Current allocation mode is local Current file position is 4696 GNU Ghostscript: Unrecoverable error, exit code 1 --please do not edit the information below-- Version: platform = i686-pc-linux-gnu arch = i686 os = linux-gnu system = i686, linux-gnu status = major = 1 minor = 2.1 year = 2001 month = 01 day = 15 language = R Search Path: .GlobalEnv, package:ctest, Autoloads, package:base and gs version: GNU Ghostscript 5.50 (2000-2-13) Torsten -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Torsten Hothorn <Torsten.Hothorn at rzmail.uni-erlangen.de> writes:> To the plot experts: > > when creating a plot containing different lines, each with a special line > type, it may happen that the result of 'postscript()' is not readable by > ghostview (which may not be an R error, thus not bug report ;-).It's a bug alright: 0.75 setlinewidth [ 0.00] 0 setdash <------- Invalid PostScript> This is the case when mixing lty as 0:6 and character or even when > using lty as character only. > > Example: > > postscript("test.ps") > plot(1:10, type="l", lty=1) > lines(sample(10), lty="9A1A1A") > lines(sample(10), lty="1A6A7A") > lines(sample(10), lty="9B") > lines(sample(10), lty="1F") > legend(4,4,paste("test", 1:5), lty=c(1, "9A1A1A","1A6A7A","9B","1F")) > dev.off() >A fundamental problem here is that c(1, "9A1A1A","1A6A7A","9B","1F") will coerce the 1 to character, and line type "1" is causing the trouble with postscript. Simpler version of same problem is postscript('test.ps') plot(1:10,type="l",lty="1") The workaround is legend(4,4,paste("test", 1:5), lty=c("0", "9A1A1A","1A6A7A","9B","1F")) -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._