Hi all! One quick question: How do I get the standard colors used by barplot? I have some stacked bars and would like to add a horizontal legend via legend() but I don't know how to find the colors for the fills of the legend points. Thanks! Werner
Werner Wernersen wrote:> Hi all! > > One quick question: How do I get the standard colors > used by barplot? I have > some stacked bars and would like to add a horizontal > legend via legend() but I > don't know how to find the colors for the fills of the > legend points. > > Thanks! > WernerType barplot.default and read the code: for a vector: "grey", for a matrix: grey(seq(0.3^2.2, 0.9^2.2, length = nrow(height))^(1/2.2)) Uwe Ligges
>>>Hi all! >>> >>>One quick question: How do I get the standardcolors>>>used by barplot? I have >>>some stacked bars and would like to add ahorizontal>>>legend via legend() but I >>>don't know how to find the colors for the fills ofthe>>>legend points. >>> >>>Thanks! >>> Werner >> >> >>Type >> barplot.default >>and read the code: >> >>for a vector: "grey", >>for a matrix: grey(seq(0.3^2.2, 0.9^2.2, length >>nrow(height))^(1/2.2)) > > > This must be an old version of R ;-) > > In R 2.1.0, there is a function gray.colors() whichcreates a vector of> gamma-corrected gray colors (and is used inbarplot.default).> > Best, > ZThanks for the quick help! I am using R 2.0.1 under Windows 2000 and Uwes suggestion helps. And another thanks: Finally I realized that I don't have the newest R version! Thanks again, Werner
Well I don't know how I can live with myself. I guess I can't wait for the site to mirror itself in case someone thinks I'm yesterday's man. ;-)> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch]On Behalf Of Achim Zeileis > Sent: Monday, 18 April 2005 10:56 PM...> Subject: Re: [R] Barplot and colors for legend...> This must be an old version of R ;-)... Tom Mulholland Perth, WA, Australia. ,-_|\ / \ ?_,-._/ v