Produce a multiple formats graphic

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Produce a multiple formats graphic

Cuvelier Etienne
Is it possible to produce the same graphic in different formats
in one shot?
Now if I want to produce the same graphic in pdf, ps and jpeg
I run the producing code, but I change the graphic device, and
I choose successively :
pdf(...)
ps(...)
jpeg(...)

So in this case I run the same code 3 times, or I have
to choose a format and use converters...

Is it possible to produce the 3 graphics in once ?


Thank you very much

--
===============================================
Cuvelier Etienne
Assistant
FUNDP - Institut d'Informatique
rue Grandgagnage, 21   B-5000 Namur (Belgique)
tel: 32.81.72.49.93    fax: 32.81.72.49.67
===============================================
Top 10 reasons to become a Statistician
 
  1. Deviation is considered normal
  2. We feel complete and sufficient
  3. We are 'mean' lovers
  4. Statisticians do it discretely and
     continuously
  5. We are right 95% of the time
  6. We can legally comment on someone's
     posterior distribution
  7. We may not be normal, but we are
     transformable
  8. We never have to say we are certain
  9. We are honestly significantly different
 10. No one wants our jobs

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Produce a multiple formats graphic

Uwe Ligges


Cuvelier Etienne wrote:

> Is it possible to produce the same graphic in different formats
> in one shot?
> Now if I want to produce the same graphic in pdf, ps and jpeg
> I run the producing code, but I change the graphic device, and
> I choose successively :
> pdf(...)
> ps(...)
> jpeg(...)
>
> So in this case I run the same code 3 times,

Yes, or write a small piece of code that does it for you.

Uwe Ligges


 > or I have
> to choose a format and use converters...
>
> Is it possible to produce the 3 graphics in once ?
 >
>
> Thank you very much
>

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Fwd: Produce a multiple formats graphic

Mark Wardle
In reply to this post by Cuvelier Etienne
---------- Forwarded message ----------
From: Mark Wardle <[hidden email]>
Date: 6 Nov 2007 16:01
Subject: Re: [R] Produce a multiple formats graphic
To: Cuvelier Etienne <[hidden email]>


You have several options:

1. Write a function that creates your plot, and call that function
repeatedly manually.
2. Write a wrapper function that takes the name of a function, and an
output filename, and calls that function repeatedly after creating
different graphics devices.
3. Create as PDF, and use something else (like ImageMagick) to convert
to different formats.

I tend to do option 3 as it is the most flexible.

Best wishes,

Mark

On 06/11/2007, Cuvelier Etienne <[hidden email]> wrote:

> Is it possible to produce the same graphic in different formats
> in one shot?
> Now if I want to produce the same graphic in pdf, ps and jpeg
> I run the producing code, but I change the graphic device, and
> I choose successively :
> pdf(...)
> ps(...)
> jpeg(...)
>
> So in this case I run the same code 3 times, or I have
> to choose a format and use converters...
>
> Is it possible to produce the 3 graphics in once ?
>
>
> Thank you very much
>
> --
> ===============================================
> Cuvelier Etienne
> Assistant
> FUNDP - Institut d'Informatique
> rue Grandgagnage, 21   B-5000 Namur (Belgique)
> tel: 32.81.72.49.93    fax: 32.81.72.49.67
> ===============================================
> Top 10 reasons to become a Statistician
>
>   1. Deviation is considered normal
>   2. We feel complete and sufficient
>   3. We are 'mean' lovers
>   4. Statisticians do it discretely and
>      continuously
>   5. We are right 95% of the time
>   6. We can legally comment on someone's
>      posterior distribution
>   7. We may not be normal, but we are
>      transformable
>   8. We never have to say we are certain
>   9. We are honestly significantly different
>  10. No one wants our jobs
>
> ______________________________________________
> [hidden email] 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.
>
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________
>


--
Dr. Mark Wardle
Specialist registrar, Neurology
Cardiff, UK


--
Dr. Mark Wardle
Specialist registrar, Neurology
Cardiff, UK

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Produce a multiple formats graphic

Gabor Grothendieck
In reply to this post by Cuvelier Etienne
You didn't mention your platform but if its windows then try this:

plot(1:10)
for(p in c("ps", "pdf", "jpg")) savePlot("myplot", type=p)

and if not look up ?dev.copy and RSiteSearch("dev.copy")


On Nov 6, 2007 9:18 AM, Cuvelier Etienne <[hidden email]> wrote:

> Is it possible to produce the same graphic in different formats
> in one shot?
> Now if I want to produce the same graphic in pdf, ps and jpeg
> I run the producing code, but I change the graphic device, and
> I choose successively :
> pdf(...)
> ps(...)
> jpeg(...)
>
> So in this case I run the same code 3 times, or I have
> to choose a format and use converters...
>
> Is it possible to produce the 3 graphics in once ?
>
>
> Thank you very much
>
> --
> ===============================================
> Cuvelier Etienne
> Assistant
> FUNDP - Institut d'Informatique
> rue Grandgagnage, 21   B-5000 Namur (Belgique)
> tel: 32.81.72.49.93    fax: 32.81.72.49.67
> ===============================================
> Top 10 reasons to become a Statistician
>
>  1. Deviation is considered normal
>  2. We feel complete and sufficient
>  3. We are 'mean' lovers
>  4. Statisticians do it discretely and
>     continuously
>  5. We are right 95% of the time
>  6. We can legally comment on someone's
>     posterior distribution
>  7. We may not be normal, but we are
>     transformable
>  8. We never have to say we are certain
>  9. We are honestly significantly different
>  10. No one wants our jobs
>
> ______________________________________________
> [hidden email] 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.
>

______________________________________________
[hidden email] 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.