Skip to content
Prev 6878 / 15075 Next

Sweave, lty = 3 line incorect in pdf output

First, I want to thank everybody who responded for their
helpful comments and suggestions, though the problem is
still unresolved and if anyone has any additional ideas,
I would be grateful.  Second, if I can test your patience
just a bit more, I have found an additional clue that
perhaps will help solve the mystery of the missing dotted
lines (on my system, apparently).

Recall the minimal example,

pdf(file = "test.pdf")
x <- 1:10
plot(x, type = "l", lty = 3, lwd = 3)
lines(x, 0.5 * x)
dev.off()

And the issue is that I don't see the dotted line in my viewer.
I do, however, if the file is created by

quartz(file = "testQ.pdf", type = "pdf")
x <- 1:10
plot(x, type = "l", lty = 3, lwd = 3)
lines(x, 0.5 * x)
dev.off()

but then the file generated is 72 Kb instead of 4Kb as with the pdf
device.

I tried on another Leopard system (64 bit R) with the same result, and then
on a system running Tiger (all with a version of R 2.10.1 patched),
The dotted lines appeared on Tiger.  I transferred the Tiger generated
file to my Leopard Mac and the dotted line appears on the viewer,
here, as well.  So, I investigated how the files might differ
and the only thing that I can find is that the Tiger generated
version contains the lines

1 J
1 j

whereas, in the Leopard generated version, I only see

1 j

If I add a line of 1 J to the Leopard generated file, after line 35,
the dotted lines do appear in my viewer.

I don't know what these commands do in pdf (I don't speak pdf).
Would anyone have an idea what could have happened that my pdf()
command does not produce them and most importantly, any ideas on
how to fix it?

Thank you, again, for your responses.

Leopard sessionInfo
sessionInfo()
R version 2.10.1 Patched (2010-02-09 r51118)
i386-apple-darwin9.8.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods
[7] base

best,

Ken

Quoting Thomas Lumley <tlumley at u.washington.edu>: