[R] autoscaling plot font size in Sweave output possible?

Patrick Drechsler patrick.drechsler at gmx.net
Sat Jan 8 03:59:14 CET 2005


Hi Friedrich,

Friedrich Leisch wrote on 07 Jan 2005 09:49:04 MET:

thanks for taking the time!

>>>>>> On Thu, 06 Jan 2005 23:56:31 +0100,
>>>>>> Patrick Drechsler (PD) wrote:

>> I was wondering if it's possible to have fonts in plots to be
>> autoscaled to the same font size used by LaTeX in a
>> surrounding Sweave document.
>
> Not using the standard mechanism, because there figures are
> rescaled *after* they are created, and the font is rescaled
> together with the rest.

..I was afraid of that...

> What yoy have to do is:
>
> 1) Create your own Sweave.sty file
[...]

Ok...

> 2) Explicitly set height and width of each figure chunk to what
> it should be in the final document. Unfortunately you cannot
> use any fractions of \textwidth or the like because Sweawe has
> no means to know what that might be.

see below...

> 3) Set the font size to what you use in the tex document using
> ps.options().

see below...

Could you or somebody else enhance my OP in this sence to
demonstrate the effect intended? I've fiddled around with
`postscrict' and `ps.options' all day long but haven't reached a
working file. The problem is most likely sitting in front of the
keyboard.

> It is because of 2) that I didn't follow this route for the
> current defaults, and I haven't found a really convincing
> alternative which works in "most" situations ...

Not knowing if it's actually going to help me: Can you point me
to the file which does the conversion to the *.tex file? I've
tried `locate sweave' on my linux box and there wasn't anything
in the results concerning the conversion to TeX. 

I'm one of those guys that wants to have nice looking results at
the end with all plots having the same layout. I'm biased by the
following tools at the moment:

1. PSTricks (within LaTeX; low level; good for publications)

2. export from Matlab7.0.1 -> (e)ps for LaTeX (via PSFrag
replacement of fonts / publishable) [1] 

3a. normal export from R -> (e)ps for LaTeX via library Hmisc
(PSFrag: font replacement untested / publishable?)

3b. export from R "sweaved" into LaTeX -> Sweave and problem
above. I use this option at least once a month to feedback-myself
of current results and very much enjoy the feature of not having
to fiddle-fart around with layouts. And having the `\Sexpr'
available.... indespensable. I can look at my results months
later and know what I've done.


1==3a : fine for high-end publishing.

2 and 3b : is a good routine.

Combining 3b with 1 would be nice.


Ideas?

Patrick

Footnotes: 
[1] <URL:http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=4638&objectType=file>

-- 
For animals, the entire universe has been neatly divided into things
to (a) mate with, (b) eat, (c) run away from, and (d) rocks.
        -- (Terry Pratchett, Equal Rites)




More information about the R-help mailing list