Scale ggplot2 size to plot size

35 views
Skip to first unread message

cool.abbecker

unread,
Jun 8, 2017, 9:02:06 AM6/8/17
to ggplot2
Hello,
it is very annoying in R to save a plot with bigger dimensions and everything gets smaller, the font for example (.tif for example).
How can i scale the whole ggplot2 object accordingly? Right now I have to rescale every plotting element (quite a lot).
Thanks!

Brandon Hurr

unread,
Jun 8, 2017, 10:33:09 AM6/8/17
to cool.abbecker, ggplot2
There is a DPI argument in ggsave() and the other tiff, jpg, png devices. If you adjust this it affects point size, text size and so on. This does affect the final plot quality, so be careful. 

Best thing is the play with it and see what happens when you go up or down in DPI. 
See:
?ggsave
?tiff

--
--
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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

cool.abbecker

unread,
Jun 8, 2017, 5:34:11 PM6/8/17
to ggplot2
I am only allowed a fixed DPI of 300 for publishing.

Brandon Hurr

unread,
Jun 8, 2017, 7:42:12 PM6/8/17
to cool.abbecker, ggplot2
AFAIK, you'll have to adjust all of the elements using theme and the geom's settings. 

You might want to look around for a publication ready theme to get you started. There are a lot out in the wild. 

B

--

Hadley Wickham

unread,
Jun 9, 2017, 2:17:03 PM6/9/17
to cool.abbecker, ggplot2
The basic idea is here:
http://r4ds.had.co.nz/graphics-for-communication.html#figure-sizing

Hadley

On Thu, Jun 8, 2017 at 5:53 AM, cool.abbecker <cool.a...@gmail.com> wrote:
> --
> --
> 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.



--
http://hadley.nz
Reply all
Reply to author
Forward
0 new messages