[R] Sweave, lty = 3 line incorect in pdf output

Ken Knoblauch ken.knoblauch at inserm.fr
Thu Feb 11 10:12:04 CET 2010


I'm having a problem with dotted lines (lty = 3) in the pdf output
in documents generated with Sweave.  In the displayed pdf, the
dotted line does not show up and in the printed output, it is
there but does not seem to respect the lwd argument, for example, it
is very faint despite using lwd = 3.  The dotted line is correct
in a quartz window and if I save the Quartz window to a pdf
and include it in the tex document, then the dotted line is there
at the correct line width.  Here is a short example, using the Stex
convention for Sweave.  I saved the quartz window in a file called
quartzSave.pdf after running the document through Sweave a first
time without the \includegraphics{quartzSave} line.

\documentclass[10pt]{article}
\usepackage{graphicx}

\begin{document}

Test of lty = 3 argument.

\begin{Scode}{fig=TRUE,eps=FALSE}
x <- 1:10
plot(x, type = "l", lty = 3, lwd = 3)
lines(x, 0.5 * x, type = "l")
\end{Scode}

Saved from Quartz window:

\includegraphics{quartzSave}


\end{document}

I have attached the pdf created by Sweave (which is missing the dotted
lines) in case it can get through the filter to R-help.

sessionInfo()
R version 2.10.1 Patched (2010-02-01 r51089)
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

loaded via a namespace (and not attached):
[1] tools_2.10.1

Thanks for any help.

Ken

-- 
Ken Knoblauch
Inserm U846
Stem-cell and Brain Research Institute
Department of Integrative Neurosciences
18 avenue du Doyen Lépine
69500 Bron
France
tel: +33 (0)4 72 91 34 77
fax: +33 (0)4 72 91 34 61
portable: +33 (0)6 84 10 64 10
http://www.sbri.fr/members/kenneth-knoblauch.html

----------------------------------------------------------------


-------------- next part --------------
A non-text attachment was scrubbed...
Name: lty3Test-001.pdf
Type: application/pdf
Size: 2964 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20100211/f0698ab1/attachment.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: quartzSave.pdf
Type: application/pdf
Size: 71363 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20100211/f0698ab1/attachment-0001.pdf>
-------------- next part --------------
\documentclass[10pt]{article}
\usepackage{graphicx}

\begin{document}

Test of lty = 3 argument.

\begin{Scode}{fig=TRUE,eps=FALSE}
x <- 1:10
plot(x, type = "l", lty = 3, lwd = 3)
lines(x, 0.5 * x, type = "l")
\end{Scode}

Saved from Quartz window:

\includegraphics{quartzSave}


 \end{document}


More information about the R-help mailing list