Using graphics straight from R into published articles

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

Using graphics straight from R into published articles

blanco
Hi,
I have been working with R for the past couple of years; analyzing data and producing some graphics.

I was just wondering if people use graphics from R straight into articles or are they always edited  in some way; fonts, headers, axis, color etc?  Using photoshop or some other programs?

I would like to think it is possible, better and more profession to do it all in R.
I tried google and the search option but found nothing on the topic.  

What are the experiences for all the professionals out there that use R?
Are there any articles on this specific subject?

thanks,
blanco
Reply | Threaded
Open this post in threaded view
|

Re: Using graphics straight from R into published articles

Jonathan P Daily
I think you should google search Sweave, as well as check out the ?Sweave
page.

Not to mention the graphics devices that embed quite nicely into
documents, like ?postscript.

HTH,
Jon
--------------------------------------
Jonathan P. Daily
Technician - USGS Leetown Science Center
11649 Leetown Road
Kearneysville WV, 25430
(304) 724-4480
"Is the room still a room when its empty? Does the room,
 the thing itself have purpose? Or do we, what's the word... imbue it."
     - Jubal Early, Firefly

[hidden email] wrote on 03/29/2011 12:31:18 PM:

> [image removed]
>
> [R] Using graphics straight from R into published articles
>
> blanco
>
> to:
>
> r-help
>
> 03/29/2011 12:44 PM
>
> Sent by:
>
> [hidden email]
>
> Hi,
> I have been working with R for the past couple of years; analyzing data
and
> producing some graphics.
>
> I was just wondering if people use graphics from R straight into
articles or
> are they always edited  in some way; fonts, headers, axis, color etc?
Using
> photoshop or some other programs?
>
> I would like to think it is possible, better and more profession to do
it

> all in R.
> I tried google and the search option but found nothing on the topic.
>
> What are the experiences for all the professionals out there that use R?
> Are there any articles on this specific subject?
>
> thanks,
> blanco
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Using-
> graphics-straight-from-R-into-published-articles-tp3415401p3415401.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [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.
Reply | Threaded
Open this post in threaded view
|

Re: Using graphics straight from R into published articles

Philipp Pagel-5
In reply to this post by blanco
On Tue, Mar 29, 2011 at 09:31:18AM -0700, blanco wrote:

> I was just wondering if people use graphics from R straight into articles or
> are they always edited  in some way; fonts, headers, axis, color etc?  Using
> photoshop or some other programs?
>
> I would like to think it is possible, better and more profession to do it
> all in R.
> I tried google and the search option but found nothing on the topic.  
>
> What are the experiences for all the professionals out there that use R?
> Are there any articles on this specific subject?

I'm not aware of any articles on the topic but I can share what I do:

95% of the time I tweak various graphics parameters in R and see no
necessity for postprocessing in other applications.

In about 5% I do some manual editing for a "camera ready" figure.
These are usually the result of exotic request from referees. But
under no circumstances would I use Photoshop or any other pixel
graphics software for this. My R graphics are always created as eps or
pdf vector graphics and any editing is done with a proper vector
graphics software (Illustrator or Inkscape).

I share your feeling that it is better to do as much as possible in R
because it means that I won't have to do it again if I need to produce
another revision of the figure - all it takes is anoother run of my
script. And I can re-use good solutions in the future. Any manual
touch-ups have to be done manually every single time => not my idea of
efficiency.

cu
        Philipp

--
Dr. Philipp Pagel
Lehrstuhl für Genomorientierte Bioinformatik
Technische Universität München
Wissenschaftszentrum Weihenstephan
Maximus-von-Imhof-Forum 3
85354 Freising, Germany
http://webclu.bio.wzw.tum.de/~pagel/

______________________________________________
[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: Using graphics straight from R into published articles

Rainer M Krug-6
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 29/03/11 19:52, Philipp Pagel wrote:
> On Tue, Mar 29, 2011 at 09:31:18AM -0700, blanco wrote:
>> I was just wondering if people use graphics from R straight into articles or
>> are they always edited  in some way; fonts, headers, axis, color etc?  Using
>> photoshop or some other programs?
>>
>> I would like to think it is possible, better and more profession to do it
>> all in R.

Absolutely. You can get one paper = one file (if you want to, including
your data - but usually that one is separate) when you use e.g. sweave
or org-mode babel (http://orgmode.org/,
http://orgmode.org/worg/org-contrib/babel/) - all graphs are generated
when you compile your document. I use org-mode.

>> I tried google and the search option but found nothing on the topic.  
>>
>> What are the experiences for all the professionals out there that use R?
>> Are there any articles on this specific subject?
>
> I'm not aware of any articles on the topic but I can share what I do:
>
> 95% of the time I tweak various graphics parameters in R and see no
> necessity for postprocessing in other applications.

Up to now, even 100%

>
> In about 5% I do some manual editing for a "camera ready" figure.
> These are usually the result of exotic request from referees. But
> under no circumstances would I use Photoshop or any other pixel
> graphics software for this. My R graphics are always created as eps or
> pdf vector graphics and any editing is done with a proper vector
> graphics software (Illustrator or Inkscape).

Absolutely vector - no jpeg, png, ... although it takes sometimes some
convincing of co-authors...

>
> I share your feeling that it is better to do as much as possible in R
> because it means that I won't have to do it again if I need to produce
> another revision of the figure - all it takes is anoother run of my
> script. And I can re-use good solutions in the future. Any manual
> touch-ups have to be done manually every single time => not my idea of
> efficiency.

Absolutely - reproducible research. And if you have several graphs, they
all share the same layout, font, fontsize, margins, ...

I rather spend an hour fiddling on my graphs in R (and sometimes
swearing about the layout of multiple graphs in one figure) then spend
half an hour "painting" my graphs.

Cheers,

Rainer

>
> cu
> Philipp
>


- --
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Natural Sciences Building
Office Suite 2039
Stellenbosch University
Main Campus, Merriman Avenue
Stellenbosch
South Africa

Tel:        +33 - (0)9 53 10 27 44
Cell:       +27 - (0)8 39 47 90 42
Fax (SA):   +27 - (0)8 65 16 27 82
Fax (D) :   +49 - (0)3 21 21 25 22 44
Fax (FR):   +33 - (0)9 58 10 27 44
email:      [hidden email]

Skype:      RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2S6CwACgkQoYgNqgF2egpvFgCfewRlqSfz+RSGmxcn15I4H9Yh
riUAn2KzUCS8wD55HFQy+M6O5QRf0yIr
=v8nN
-----END PGP SIGNATURE-----

______________________________________________
[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: Using graphics straight from R into published articles

Thierry Onkelinx
Large snip.
 
> Absolutely vector - no jpeg, png, ... although it takes
> sometimes some convincing of co-authors...
>

That depends on the kind of graph. I aggree that you should try vector at first. But when it generates very larges files (e.g. scatterplots with thousands of points) then you better switch to bitmaps like tiff or png. Jpeg can create artefacts, so is not very good for graphics.

Best regards,

Thierry
______________________________________________
[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: Using graphics straight from R into published articles

Philipp Pagel-5
On Wed, Mar 30, 2011 at 08:48:55AM +0000, ONKELINX, Thierry wrote:
> Large snip.
>  
> > Absolutely vector - no jpeg, png, ... although it takes
>
> That depends on the kind of graph. I aggree that you should try
> vector at first. But when it generates very larges files (e.g.
> scatterplots with thousands of points) then you better switch to
> bitmaps like tiff or png. Jpeg can create artefacts, so is not very
> good for graphics.

True. Sometimes one can get away with switching from a normal
scatterplot to hexbin or something like this but if that is not
anoption a high resolution tiff or png is the way out.

And of course, I agree that jpeg should never be used for graphs.

cu
        Philipp

--
Dr. Philipp Pagel
Lehrstuhl für Genomorientierte Bioinformatik
Technische Universität München
Wissenschaftszentrum Weihenstephan
Maximus-von-Imhof-Forum 3
85354 Freising, Germany
http://webclu.bio.wzw.tum.de/~pagel/

______________________________________________
[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: Using graphics straight from R into published articles

Prof Brian Ripley
On Wed, 30 Mar 2011, Philipp Pagel wrote:

> On Wed, Mar 30, 2011 at 08:48:55AM +0000, ONKELINX, Thierry wrote:
>> Large snip.
>>
>>> Absolutely vector - no jpeg, png, ... although it takes
>>
>> That depends on the kind of graph. I aggree that you should try
>> vector at first. But when it generates very larges files (e.g.
>> scatterplots with thousands of points) then you better switch to
>> bitmaps like tiff or png. Jpeg can create artefacts, so is not very
>> good for graphics.
>
> True. Sometimes one can get away with switching from a normal
> scatterplot to hexbin or something like this but if that is not
> anoption a high resolution tiff or png is the way out.
>
> And of course, I agree that jpeg should never be used for graphs.
That depends on the definition of 'graphs'.

One reason that I added jpeg support to Sweave is that some of us do
work in areas where figures (and it is 'figures' you put in papers in
my native language) are images, even photographic images.

>
> cu
> Philipp
>
> --
> Dr. Philipp Pagel
> Lehrstuhl für Genomorientierte Bioinformatik
> Technische Universität München
> Wissenschaftszentrum Weihenstephan
> Maximus-von-Imhof-Forum 3
> 85354 Freising, Germany
> http://webclu.bio.wzw.tum.de/~pagel/
>
> ______________________________________________
> [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.
>
--
Brian D. Ripley,                  [hidden email]
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
______________________________________________
[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: Using graphics straight from R into published articles

Rainer M Krug-6
In reply to this post by Philipp Pagel-5
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 30/03/11 11:12, Philipp Pagel wrote:

> On Wed, Mar 30, 2011 at 08:48:55AM +0000, ONKELINX, Thierry wrote:
>> Large snip.
>>  
>>> Absolutely vector - no jpeg, png, ... although it takes
>>
>> That depends on the kind of graph. I aggree that you should try
>> vector at first. But when it generates very larges files (e.g.
>> scatterplots with thousands of points) then you better switch to
>> bitmaps like tiff or png. Jpeg can create artefacts, so is not very
>> good for graphics.
>
> True. Sometimes one can get away with switching from a normal
> scatterplot to hexbin or something like this but if that is not
> anoption a high resolution tiff or png is the way out.

Well - is there a rule without an exception?

Of course - you are right.

Cheers,

Rainer

>
> And of course, I agree that jpeg should never be used for graphs.
>
> cu
> Philipp
>


- --
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Natural Sciences Building
Office Suite 2039
Stellenbosch University
Main Campus, Merriman Avenue
Stellenbosch
South Africa

Tel:        +33 - (0)9 53 10 27 44
Cell:       +27 - (0)8 39 47 90 42
Fax (SA):   +27 - (0)8 65 16 27 82
Fax (D) :   +49 - (0)3 21 21 25 22 44
Fax (FR):   +33 - (0)9 58 10 27 44
email:      [hidden email]

Skype:      RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEUEARECAAYFAk2S9rkACgkQoYgNqgF2egpp2ACcCrToeRM2OWPBVAs99Q/u0c/z
Vl8AmKoP0l2RR+EyL+VVlYM2S+hQdhw=
=hKPu
-----END PGP SIGNATURE-----

______________________________________________
[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.