geom_ribbon function in ggplot2 package

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

geom_ribbon function in ggplot2 package

miao
Hi,

   When using the geom_ribbon function in gglot2 package, I got the text
"fill" above the legend "A" and "B". How can I get rid of the text "fill"
above the legend?

   Thanks!

The code is as follows:


df<-data.frame(x=c(1,2), y=c(1,2), z=c(3,5))
> ggplot(df,
aes(1:2))+geom_ribbon(aes(ymin=0,ymax=df[,"y"],fill="A"),alpha=0.5)+geom_ribbon(aes(ymin=0,ymax=df[,"z"],fill="B"),alpha=0.5)

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: geom_ribbon function in ggplot2 package

Eik Vettorazzi-2
Hi,
just add +scale_fill_discrete(name=NULL)

Cheers

Am 19.12.2018 um 07:05 schrieb John:

> Hi,
>
>     When using the geom_ribbon function in gglot2 package, I got the text
> "fill" above the legend "A" and "B". How can I get rid of the text "fill"
> above the legend?
>
>     Thanks!
>
> The code is as follows:
>
>
> df<-data.frame(x=c(1,2), y=c(1,2), z=c(3,5))
>> ggplot(df,
> aes(1:2))+geom_ribbon(aes(ymin=0,ymax=df[,"y"],fill="A"),alpha=0.5)+geom_ribbon(aes(ymin=0,ymax=df[,"z"],fill="B"),alpha=0.5)
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

--
Eik Vettorazzi

Department of Medical Biometry and Epidemiology
University Medical Center Hamburg-Eppendorf

Martinistrasse 52
building W 34
20246 Hamburg

Phone: +49 (0) 40 7410 - 58243
Fax:   +49 (0) 40 7410 - 57790
Web: www.uke.de/imbe
--

_____________________________________________________________________

Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg | www.uke.de
Vorstandsmitglieder: Prof. Dr. Burkhard Göke (Vorsitzender), Prof. Dr. Dr. Uwe Koch-Gromus, Joachim Prölß, Marya Verdel
_____________________________________________________________________

SAVE PAPER - THINK BEFORE PRINTING
______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: geom_ribbon function in ggplot2 package

miao
Thanks, Eik!

Eik Vettorazzi <[hidden email]> 於 2018年12月19日 週三 下午5:12寫道:

> Hi,
> just add +scale_fill_discrete(name=NULL)
>
> Cheers
>
> Am 19.12.2018 um 07:05 schrieb John:
> > Hi,
> >
> >     When using the geom_ribbon function in gglot2 package, I got the text
> > "fill" above the legend "A" and "B". How can I get rid of the text "fill"
> > above the legend?
> >
> >     Thanks!
> >
> > The code is as follows:
> >
> >
> > df<-data.frame(x=c(1,2), y=c(1,2), z=c(3,5))
> >> ggplot(df,
> >
> aes(1:2))+geom_ribbon(aes(ymin=0,ymax=df[,"y"],fill="A"),alpha=0.5)+geom_ribbon(aes(ymin=0,ymax=df[,"z"],fill="B"),alpha=0.5)
> >
> >       [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
>
> --
> Eik Vettorazzi
>
> Department of Medical Biometry and Epidemiology
> University Medical Center Hamburg-Eppendorf
>
> Martinistrasse 52
> building W 34
> 20246 Hamburg
>
> Phone: +49 (0) 40 7410 - 58243
> Fax:   +49 (0) 40 7410 - 57790
> Web: www.uke.de/imbe
> --
>
> _____________________________________________________________________
>
> Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen
> Rechts; Gerichtsstand: Hamburg | www.uke.de
> Vorstandsmitglieder: Prof. Dr. Burkhard Göke (Vorsitzender), Prof. Dr. Dr.
> Uwe Koch-Gromus, Joachim Prölß, Marya Verdel
> _____________________________________________________________________
>
> SAVE PAPER - THINK BEFORE PRINTING
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.