[R] Controlling Postscript output, size and orientation

Nathan Vandergrift bussia89 at yahoo.com
Mon Dec 3 20:13:49 CET 2007




Prof Brian Ripley wrote:
> 
> Please do tell us exactly what you are doing via a reproducible example 
> (see the footer to every R-help message).
> 

That code was in my original message, here it is again:
par(	bg="yellow",
	lab=c(10,6,7),
	#mai=c(1.25, 1, 0.2, 0.2),
	pin=c(6,4)
)

curve(300-(200*(exp(-.4*x)-1)), 
	from=0, 
	to=9, 
	n=1000, 
	add=F, 
	type= "l",
	lwd=3,
	xlab="Ocassion of Measurement", 
	ylab="y",
)

# doesn't really work, have to edit in Acrobat to fix...

savePlot("M:/mono", type="ps")



> I added paper="special" to postscript() to make this easier: are you using 
> it?  From the help page
> 
>       The postscript produced for a single R plot is EPS (_Encapsulated
>       PostScript_) compatible, and can be included into other documents,
>       e.g., into LaTeX, using '\includegraphics{<filename>}'.  For use
>       in this way you will probably want to set 'horizontal = FALSE,
>       onefile = FALSE, paper = "special"'.  Note that the bounding box
>       is for the device region: if you find the white space around the
>       plot region excessive, reduce the margins of the figure region via
>       'par(mar=)'.
> 
> Further, I wrote a pdf() driver to make this easier, so why use 
> postscript) to make a PDF presentation?
> 

What I am using is LaTeX with the prosper package to create a presentation
which I give using Adobe Reader (or Acrobat if it is available).

My issue is that it just seems like too many steps to get a "publication
ready" figure. I'll try what you suggested above, thanks.



> 'Adobe' is a company, not a software package.  Which of its products did 
> you mean?
> 

Sorry, Acrobat, thought that went without saying, my bad.

Thanks for the help.



> On Sun, 2 Dec 2007, Nathan Vandergrift wrote:
> 
>> Patrick Connolly-4 wrote:
>>>
>>> On Thu, 29-Nov-2007 at 01:22PM -0800, Nathan Vandergrift wrote:
>>>
>>> |>
>>> |> I'm trying to get my graphics so that I can use them in LaTeX to
>>> create
>>> (via
>>> |> ) a pdf presentation.
>>> |>
>>> |> I've tried controlling inner and outer margins and figure size using
>>> par(),
>>> |> to no avail. The ps output keeps appearing as a portrait page with a
>>> |> centered figure. Nothing I have been able to do so far has changed
>>> that.
>>>
>>> Check out the paper argument to the postscript device.  I think you'll
>>> be more sucessful.
>>>
>>
>> The issue isn't so much viewing is gsview (I've looked at previous
>> threads
>> on this and all my settings in gsview are the ones recommended), but
>> creating a postscript file that is ready to be dumped into the LaTeX
>> prosper
>> package and have a good looking graph for a presentation. Currently, the
>> graph comes out with lots of "white space" on a portrait oriented page.
>>
>> My work around has been to open the file in Adobe and to crop the file
>> (interestingly, when Adobe opens the file, it does not read in the excess
>> "white space"). This works fine, but it is pretty inefficient.
>>
>> I find it hard to believe that I can't control these things in R, but I
>> have
>> been unable to so using the reference manual and this site.
> 
> Perhaps reading the help pages would solve this?  See the quote above.
> 
>> Trying to do it with lattice plots is even worse...
>>
>> Using curve, line, and plot, I should be able to control these things
>> using
>> par(). In a lattice environment, I should be able to control these things
>> using par.settings().
>>
>> Oh, well, I'll keep plugging away...
>>
>>
>>
>>
>> -----
>> -------------------------------
>> Project Scientist
>> University of California, Irvine
>>
> 
> -- 
> Brian D. Ripley,                  ripley at stats.ox.ac.uk
> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> University of Oxford,             Tel:  +44 1865 272861 (self)
> 1 South Parks Road,                     +44 1865 272866 (PA)
> Oxford OX1 3TG, UK                Fax:  +44 1865 272595
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
> 


-----
-------------------------------
Project Scientist
University of California, Irvine
-- 
View this message in context: http://www.nabble.com/Controlling-Postscript-output%2C-size-and-orientation-tf4899986.html#a14136587
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list