Change grey background color

27 views
Skip to first unread message

Rodrigo Tardin

unread,
Jun 11, 2013, 3:00:37 PM6/11/13
to ggp...@googlegroups.com
Dear list,

I am new to ggplot and I am having trouble to change the grey background color of the ggplot2 default plot. I run a Spatial Eigenvector Mapping GLM to understand what environmental variables influence whales distribution in Rio de Janeiro, Brazil.
I have the following code that I used to plot:

ggplot(bryde3, aes(x = SLOPE, y = c1$neo.pred,)) + 
   stat_smooth(method = "glm", family = "binomial", se = TRUE) +
   labs( x = "Slope(m)",
        y = "Occurrence of whales")

# bryde 3 is my dataset
# SLOPE is one of my environmental variables
# c1$neo.pred <- predict(glmerr12, type = "response", se.fit = FALSE)
#glmerr12 is my GLM model

The resulting plot has a grey background and white lines.
Can anyone help me?

Thanks in advance,
Rodrigo


--
Rodrigo Tardin

Doutorando em Ecologia e Conservação - IBRAG - UERJ
Mestre em Biologia Animal - PPGBA - UFRRJ
Especialista em Docência do Ensino Superior - IAVM
Laboratório de Bioacústica e Ecologia de Cetáceos - UFRRJ/ IF/ DCA

Ben Bolker

unread,
Jun 11, 2013, 3:04:27 PM6/11/13
to ggp...@googlegroups.com
theme_set(theme_bw())

On 13-06-11 03:00 PM, Rodrigo Tardin wrote:
> Dear list,
>
> I am new to ggplot and I am having trouble to change the grey background
> color of the ggplot2 default plot. I run a Spatial Eigenvector Mapping
> GLM to understand what environmental variables influence whales
> distribution in Rio de Janeiro, Brazil.
> I have the following code that I used to plot:
>
> ggplot(bryde3, aes(x = SLOPE, y = c1$neo.pred,)) +
> stat_smooth(method = "glm", family = "binomial", se = TRUE) +
> labs( x = "Slope(m)",
> y = "Occurrence of whales")
>
> # bryde 3 is my dataset
> # SLOPE is one of my environmental variables
> # c1$neo.pred <- predict(glmerr12, type = "response", se.fit = FALSE)
> #glmerr12 is my GLM model
>
> The resulting plot has a grey background and white lines.
> Can anyone help me?
>
> Thanks in advance,
> Rodrigo
>
>
> --
> Rodrigo Tardin
>
> Doutorando em Ecologia e Conserva��o - IBRAG - UERJ
> Mestre em Biologia Animal - PPGBA - UFRRJ
> Especialista em Doc�ncia do Ensino Superior - IAVM
> Laborat�rio de Bioac�stica e Ecologia de Cet�ceos - UFRRJ/ IF/ DCA
>
> --
> --
> 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/groups/opt_out.
>
>

Ito, Kaori (Groton)

unread,
Jun 11, 2013, 3:10:17 PM6/11/13
to Ben Bolker, ggp...@googlegroups.com
Dear Rodrigo,
You can also learn (a lot!) from ggplot2 help for "theme":

http://docs.ggplot2.org/current/theme.html

--Kaori
> Doutorando em Ecologia e Conservação - IBRAG - UERJ
> Mestre em Biologia Animal - PPGBA - UFRRJ
> Especialista em Docência do Ensino Superior - IAVM
> Laboratório de Bioacústica e Ecologia de Cetáceos - UFRRJ/ IF/ DCA
Reply all
Reply to author
Forward
0 new messages