[R] Ploting gradient

Jim Lemon jim at bitwrit.com.au
Thu Jul 28 11:11:05 CEST 2011

On 07/28/2011 11:25 AM, Fernando Andreacci wrote:
> I have a simple bar chart with annual precipitation (jan to dez).
> I want to plot, above each bar (on a line), a square wich is color based on
> a scale (0-100%). With 0 being white and 100 black, like a gradient. Is it
> possible? How to?

Hi Fernando,
I think you want the grayscale to reflect the values of the percentages, 
so here is one way to do it:

# make up some values for the bars
# make up some values for the percentages
# draw a barplot
# translate the percent values into grayscale


More information about the R-help mailing list