use of theme_bw

27 views
Skip to first unread message

Rinchen Wangchuk

unread,
Sep 27, 2017, 11:11:54 AM9/27/17
to ggplot2
I am stuck with this may be a simple proces how to use the theme_bw as this command line shows grey background color on plot and also how to increase the font size as I a first time on R
bar + stat_summary(fun.y = "mean", geom = "bar", fill = "white", colour = "black") + stat_summary(fun.data = "mean_cl_normal", geom = "errorbar", colour = "black", width = 0.1) + labs(x = "Job", y = "Mean number of friends"))

Roman Luštrik

unread,
Sep 27, 2017, 11:23:14 AM9/27/17
to Rinchen Wangchuk, ggplot2
Just add theme_bw() the way you do all elements/geoms.

bar + stat_summary(fun.y = "mean", geom = "bar", fill = "white", colour = "black") +
         stat_summary(fun.data = "mean_cl_normal", geom = "errorbar", colour = "black", width = 0.1) +
         labs(x = "Job", y = "Mean number of friends")) +
         theme_bw() +
         theme(axis.text.x = element_text(size = 12) # this changes font size of x axis

See http://ggplot2.tidyverse.org/reference/theme.html for info on what elements of the plot you can change and http://ggplot2.tidyverse.org/reference/element.html for text elements.

Cheers,
Roman

On Wed, Sep 27, 2017 at 4:48 PM, Rinchen Wangchuk <rwan...@uwice.gov.bt> wrote:
I am stuck with this may be a simple proces how to use the theme_bw as this command line shows grey background color on plot and also how to increase the font size as I a first time on R
bar + stat_summary(fun.y = "mean", geom = "bar", fill = "white", colour = "black") + stat_summary(fun.data = "mean_cl_normal", geom = "errorbar", colour = "black", width = 0.1) + labs(x = "Job", y = "Mean number of friends"))

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



--
In God we trust, all others bring data.
Reply all
Reply to author
Forward
0 new messages