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

Ken Knoblauch ken.knoblauch at inserm.fr
Thu Feb 11 11:16:06 CET 2010


Some follow-up after Achim's message,

If I open the Sweave created pdf, lty3Test-001.pdf, attached
to the first mail, with the display command from imageMagick,
indeed, the dotted line is present, but faintly, as with the
hardcopy printout, i.e., not respecting the lwd = 3 argument.
But, the dotted line is absent if viewed with Mac's Preview.app
and the pdf viewer of TeXShop.  I don't have acrobat on my
Mac to test that, but it seems to in part, at least, viewer related.
Still, it would be good to track this down and ideally solve
it.

Thanks.

Ken


Quoting Achim Zeileis <Achim.Zeileis at uibk.ac.at>:

> Ken,
>
> I can't contribute much, just that I tried to look into it and can't
> replicate it. I tried it both with .Stex and .Rnw yielding identical
> results, just like plotting it interactively (on my default X11) and
> printing it via dev.copy2pdf(). All of the approaches seemed to yield
> the same output which looks ok.
>
> Just for the record...
> Z
>
> R> sessionInfo()
> R version 2.10.1 (2009-12-14)
> i486-pc-linux-gnu
>
> locale:
> [1] C
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> other attached packages:
> [1] fortunes_1.3-7
>
>
> On Thu, 11 Feb 2010, Ken Knoblauch wrote:
>
>> 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
>>
>> ----------------------------------------------------------------
>>
>>



-- 
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



More information about the R-help mailing list