[R] ggplot bar geom: control the filling in the colour legend

Ista Zahn izahn at psych.rochester.edu
Fri Sep 10 20:41:33 CEST 2010


Sure, just change the color of the fill.

ggplot(diamonds, aes(clarity, colour = cut)) + geom_bar(fill="white")

-Ista

On Fri, Sep 10, 2010 at 2:24 PM, Benoit Boulinguiez
<benoit.boulinguiez at ensc-rennes.fr> wrote:
> Hi all,
>
> Is it possible to change the filling of the squares used to represent the
> colour legend in a bar plot with ggplot?
>
> in this example, fillings are raven black, I'd like them white.
>
> ggplot(diamonds, aes(clarity, colour = cut)) + geom_bar()
>
> Regards
>
> --
> -------------
> Benoit Boulinguiez
> Ph.D student
> Ecole de Chimie de Rennes (ENSCR) Bureau 1.20
> Equipe CIP UMR CNRS 6226 "Sciences Chimiques de Rennes"
> Avenue du Général Leclerc
> CS 50837
> 35708 Rennes CEDEX 7
> Tel 33 (0)2 23 23 80 83
> Fax 33 (0)2 23 23 81 20
> http://www.ensc-rennes.fr/
>
> ______________________________________________
> R-help at r-project.org mailing list
> 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.
>



-- 
Ista Zahn
Graduate student
University of Rochester
Department of Clinical and Social Psychology
http://yourpsyche.org



More information about the R-help mailing list