Theme element control strip border in facet plot

2,085 views
Skip to first unread message

xi

unread,
Apr 22, 2010, 7:58:17 AM4/22/10
to ggplot2
Dear group:

I wonder how to eliminate the box surrounding the strips when creating
a facet plot using a white background theme.

I tried " panel.border = theme_rect(colour = NA) "; not working. I
guess " strip.border" might be the theme element do the job, but it
doesn´t seem to exist...

Where should I change the setting?

#---------------------------
# A simple example:

pdata = data.frame(a=rnorm(1:100), b=factor(rep(1:5, each=20)))
theme_set(theme_bw())
theme_update(strip.background = theme_rect(alpha("lightgrey",1/9)),
panel.border = theme_rect(colour = NA))
qplot(a, data=pdata, geom="histogram")+facet_grid(.~b)
#---------------------------

Thanks,
Xi

--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: http://gist.github.com/270442

To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2

baptiste auguie

unread,
Apr 22, 2010, 8:29:41 AM4/22/10
to xi, ggplot2
Hi,

Does this do what you want?

last_plot() + opts(strip.background = theme_rect(col=NA,fill=NA))


HTH,

baptiste

ONKELINX, Thierry

unread,
Apr 22, 2010, 7:59:44 AM4/22/10
to xi, ggplot2
Dear Xi,

You need to change strip.background. Fill controls the background of the strip, colour the border of the strip.

opts(strip.background = theme_rect(fill = NA, colour = NA))

HTH,

Thierry

----------------------------------------------------------------------------
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek
team Biometrie & Kwaliteitszorg
Gaverstraat 4
9500 Geraardsbergen
Belgium

Research Institute for Nature and Forest
team Biometrics & Quality Assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium

tel. + 32 54/436 185
Thierry....@inbo.be
www.inbo.be

To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey


> -----Oorspronkelijk bericht-----
> Van: ggp...@googlegroups.com
> [mailto:ggp...@googlegroups.com] Namens xi
> Verzonden: donderdag 22 april 2010 13:58
> Aan: ggplot2
> Onderwerp: Theme element control strip border in facet plot
Druk dit bericht a.u.b. niet onnodig af.
Please do not print this message unnecessarily.

Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer
en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is
door een geldig ondertekend document. The views expressed in this message
and any annex are purely those of the writer and may not be regarded as stating
an official position of INBO, as long as the message is not confirmed by a duly
signed document.

xi

unread,
Apr 23, 2010, 10:28:03 AM4/23/10
to ggplot2
Many thanks!


On Apr 22, 1:59 pm, "ONKELINX, Thierry" <Thierry.ONKEL...@inbo.be>
wrote:
> Dear Xi,
>
> You need to change strip.background. Fill controls the background of the strip, colour the border of the strip.
>
> opts(strip.background = theme_rect(fill = NA, colour = NA))
>
> HTH,
>
> Thierry
>
> --------------------------------------------------------------------------- -
> ir. Thierry Onkelinx
> Instituut voor natuur- en bosonderzoek
> team Biometrie & Kwaliteitszorg
> Gaverstraat 4
> 9500 Geraardsbergen
> Belgium
>
> Research Institute for Nature and Forest
> team Biometrics & Quality Assurance
> Gaverstraat 4
> 9500 Geraardsbergen
> Belgium
>
> tel. + 32 54/436 185
> Thierry.Onkel...@inbo.bewww.inbo.be
Reply all
Reply to author
Forward
0 new messages