[R-sig-eco] RES: Having issue trying to get plot to have plain-white background
Jhonny Capichoni Massante
jcm@@@@nte @end|ng |rom hotm@||@com
Sat Jun 15 18:54:29 CEST 2019
Hi,
I think what you need is just this:
myplot + theme_classic()
It gives you a complete white background, different from theme_bw(), which gives you a white background combined with a grey grid. Altaf�s solution gives the same output, but it is much longer IMO.
Best,
Jhonny
De: Altaf Hussain<mailto:altaf2 using ualberta.ca>
Enviado:15 June 2019 19:36
Para: Mollie Brooks<mailto:mollieebrooks using gmail.com>
Cc:r-sig-ecology using r-project.org<mailto:r-sig-ecology using r-project.org>; Bruce Miller<mailto:batsncats using gmail.com>
Assunto: Re: [R-sig-eco] Having issue trying to get plot to have plain-white background
I find the following code really helpful to further play with theme_bw()
myplot + theme_bw() + theme(panel.border = element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(), axis.line = element_line(colour =
"black"))
Cheers,
Altaf
On Sat, Jun 15, 2019 at 10:26 AM Mollie Brooks <mollieebrooks using gmail.com>
wrote:
> Hi Bruce,
>
> I like to use this line by default so that all the plots have white
> backgrounds.
>
> library(ggplot2); theme_set(theme_bw())
>
> I�m sure it�s also possible to use theme_bw() on individual plots somehow,
> but I haven�t tried.
>
> cheers,
> Mollie
>
> > On 15Jun 2019, at 18:16, Bruce Miller <batsncats using gmail.com> wrote:
> >
> > Hi all, This is not directly an R-Ecology question but neither the
> > general R help forum nor GGplot forums has any responses.
> > This is an ecology based application however LOL
> >
> >
> > I need to save plots for a publication but can not seem to get he syntax
> > correct to have GGPLOT use only a white background vs. the default gray
> one.
> >
> > I have tried the various themes but nothing seems to work.
> > This is the existing code for the plot and followed by what I have tried
> > to no avail.
> >
> > Works with gray plot frame backgrounds
> >
> >
> > ggplot(polished, aes(x =Night, y = Time, colour = Species)) +
> >
> > geom_point() +
> >
> > **scale_colour_hue(l=40)+
> >
> > ggtitle(label = ' Linderos temporal activity')+
> >
> > facet_grid(. ~ Night) +facet_wrap(facets = ~Species)+
> >
> > scale_y_continuous(labels = label_hours, breaks = break_hours) +
> >
> > theme(axis.text.x = element_text(angle = 270))
> >
> > Trying theme bw does not seem to work!
> > I did also load one of the "themes" packages to see if that was the
> > issue. Not.
> >
> > ggplot(polished, aes(x =Night, y = Time, colour = Species)) +
> >
> > geom_point() +
> >
> > **scale_colour_hue(l=40)+
> >
> > ggtitle(label = 'Temporal activty')+
> >
> > facet_grid(. ~ Night) +facet_wrap(facets = ~Species)+
> >
> > scale_y_continuous(labels = label_hours, breaks = break_hours) +
> >
> > *theme_b**w*(axis.text.x=element_text(angle = 270))
> >
> >
> > Any guidance on correct syntax/usage to plot clean-white plot back
> > ground welcomed.
> >
> > Bruce
> >
> >
> > [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > R-sig-ecology mailing list
> > R-sig-ecology using r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>
[[alternative HTML version deleted]]
_______________________________________________
R-sig-ecology mailing list
R-sig-ecology using r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
[[alternative HTML version deleted]]
More information about the R-sig-ecology
mailing list