Re: [R] function in order to plot the same graph to postscript and pdf

2005-03-10 Thread Ronny Klein
> I guess you would want eval(MYPLOT) there? > > But the function above works if you say > plot.both(myplot = expression(plot(x)), filename = "foo") > and that is what I said above: set myplot = expression(plot(x)). > Z My syntax in the example was a little bit messed, sorry for that. However G

Re: [R] function in order to plot the same graph to postscript and pdf

2005-03-09 Thread Achim Zeileis
On Wed, 9 Mar 2005 18:21:41 +0100 Ronny Klein wrote: > > > The myplot is something like this: > > > > > > plot(x) > > > text(foo) > > > > Aha, I was surprised that this worked for one of the two plots. > > You could pass myplot as an expression, e.g. myplot = > > expression(plot(x)), and then eval

RE: [R] function in order to plot the same graph to postscript and pdf

2005-03-09 Thread McGehee, Robert
PM To: Achim Zeileis Cc: r-help@stat.math.ethz.ch Subject: Re: [R] function in order to plot the same graph to postscript and pdf > > The myplot is something like this: > > > > plot(x) > > text(foo) > > Aha, I was surprised that this worked for one of the two plots.

Re: [R] function in order to plot the same graph to postscript and pdf

2005-03-09 Thread Ronny Klein
> > The myplot is something like this: > > > > plot(x) > > text(foo) > > Aha, I was surprised that this worked for one of the two plots. > You could pass myplot as an expression, e.g. myplot = > expression(plot(x)), and then eval() that in the body of plot.both(). I've followed your advice and cha

Re: [R] function in order to plot the same graph to postscript and pdf

2005-03-09 Thread Gabor Grothendieck
Ronny Klein wiwi.uni-halle.de> writes: : : Hi, : : I've written a function in order to plot the same graph in a postcript and in : a pdf file. Unfortunately, the second graph is always empty, i.e.: : : plot.both <- function{myplot, filename}{ : pdf(file=paste(filename, ".pdf", sep="")) :

Re: [R] function in order to plot the same graph to postscript and pdf

2005-03-09 Thread Achim Zeileis
On Wed, 9 Mar 2005 15:24:48 +0100 Ronny Klein wrote: > > What are the myplot objects? Expressions or graphical objects that > > are printed? > > The myplot is something like this: > > plot(x) > text(foo) Aha, I was surprised that this worked for one of the two plots. You could pass myplot as an

Re: [R] function in order to plot the same graph to postscript and pdf

2005-03-09 Thread Ronny Klein
> What are the myplot objects? Expressions or graphical objects that are > printed? The myplot is something like this: plot(x) text(foo) etc. > In any case, a good recommendation for this kind of stuff is to look at > Sweave() in the utils package. I guess you're writing your thesis in > LaTeX.

Re: [R] function in order to plot the same graph to postscript and pdf

2005-03-09 Thread Achim Zeileis
On Wed, 9 Mar 2005 14:57:27 +0100 Ronny Klein wrote: > Hi, > > I've written a function in order to plot the same graph in a postcript > and in a pdf file. Unfortunately, the second graph is always empty, > i.e.: > > plot.both <- function{myplot, filename}{ > pdf(file=paste(filename, ".pdf", se