s-news
[Top] [All Lists]

Re: different colors for bars in bar graph

To: "Jeff Simonoff" <jsimonof@stern.nyu.edu>, <s-news@wubios.wustl.edu>
Subject: Re: different colors for bars in bar graph
From: "Iyue Sung" <isung@affinnova.com>
Date: Thu, 20 May 2004 11:13:01 -0400
Thread-index: AcQ+e4d4T+L6gieLRdqsoLcrQRQ3qwAAV5Tg
Thread-topic: [S] different colors for bars in bar graph
Like this?

bar.ht<-c(.1,.2,.3,.4)
bar.col<-c('Blue','Light Green', 'Red', 'Yellow')
barplot(bar.ht, col=bar.col)

> -----Original Message-----
> From: Jeff Simonoff [mailto:jsimonof@stern.nyu.edu]
> Sent: Thursday, May 20, 2004 10:57 AM
> To: s-news@wubios.wustl.edu
> Subject: [S] different colors for bars in bar graph
> 
> Hi folks,
> I am using barplot() to create a bar chart for a set of proportions
being
> compared to each other. The separate bars are color-coded in a
meaningful
> way, and I would like to use different colors when shading each of the
> different bars. I'm exporting the picture to Postscript, so I have
access
> to a wide variety of colors, but I don't know how to change the
shading
> color bar by bar. Does anyone have any idea if this can be done, and
if
> so, how to do it?
> 
>                Best,
> 
>                Jeff
> 
>
========================================================================
==
> ====
> Jeffrey S. Simonoff                            Phone:  (212) 998-0452
> Professor of Statistics
> Leonard N. Stern School of Business            Fax:    (212) 995-4003
> New York University
> 44 West 4th Street, Rm. 8-54                   e-mail:
> jsimonof@stern.nyu.edu
> New York, NY 10012-0258
> USA                                    WWW:
> http://www.stern.nyu.edu/~jsimonof
>
========================================================================
==
> ====
> 
> --------------------------------------------------------------------
> This message was distributed by s-news@lists.biostat.wustl.edu.  To
> unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
> the BODY of the message:  unsubscribe s-news

<Prev in Thread] Current Thread [Next in Thread>