> 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
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
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.
> > 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
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=""))
:
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
> 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.
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