Correct graph size for journal publication

48 views
Skip to first unread message

waschbaer

unread,
Jun 26, 2015, 9:29:00 AM6/26/15
to ggp...@googlegroups.com
Hi @all,

I am still having lots of trouble to understand how to properly setup and export a graph with ggsave.

I need to setup a graph in a specific size for a journal publication. I want that graph to be in the size of one column of the journal which is approx. 8 cm in width, and I want the font size of the axis labels in size 11. So I did the following as an example:

mtcars
p<-ggplot(data=mtcars,aes(mpg,disp, colour=cyl))
p2<-p+geom_point() +
  labs(x="mpg", size=10,
       y="disp", size=10)
ggsave(file="test.tiff", plot = p2,  width = 80,height = 40, units = "mm", dpi=300,limitsize = TRUE)

However, the result is really shocking. The dimensions of the graph are distorted, e.g. the legend is way too big and so are the axis labels and the axis text.

How can I get that graph in a proper publishable layout?

Thanks for all your advice in advance.

Cheers,
Martin

Brandon Hurr

unread,
Jun 26, 2015, 11:38:30 AM6/26/15
to waschbaer, ggplot2
There was this post on the Davis R-users Group page (Noam's page really) that showed how to tweak a plot for publication, but I'm not sure it really answers your question. 

Saving the file as PDF or SVG allows the publisher to shrink/contort the plot and redo fonts at will. 

Dinking around for a few minutes and setting the scale seemed useful. 

ggsave(file="testscale5.tiff", plot = p2,  width = 80,height = 40, units = "mm", dpi=300, scale=5)
ggsave(file="testscale2.tiff", plot = p2,  width = 80,height = 40, units = "mm", dpi=300, scale=2)

and so on. 

--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
 
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2

---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Beaulieu, Jake

unread,
Jun 26, 2015, 12:38:58 PM6/26/15
to waschbaer, ggp...@googlegroups.com

Hi Martin,

 

My approach is to iteratively move back and forth between the code and the .tiff.  If the legend and axis labels are too big in the .tiff, then modify the code to make those elements smaller, then create the new .tiff.  You may need to go through this cycle a few times before you arrive at the code that produces the image you are after.

 

FYI….many journals require that .tiff images are LZW compressed.  You can accomplish this by adding “compression = “LZW”” to the ggsave function.

 

Jake

--

Reply all
Reply to author
Forward
0 new messages