Hi list, I want to draw a bar plot with color indicating one grouping and different shading on top of the color indicating another grouping.? How should I proceed? Thanks! ...Tao
barplot with both color and shading
6 messages · Shi, Tao, R. Michael Weylandt, Jim Lemon +1 more
This seems like a natural fit for ggplot2 graphics, but I'm not aware of shading as a widely implemented graphical element: this might have some useful information -- http://had.co.nz/ggplot2/geom_histogram.html Can you find an example of "shading" in R? (perhaps in the R Graphics Gallery) If you look at example(barplot) there's an example of how to use different line patterns, but I don't find it particularly clear. The grouping techniques seem much clearer to me. Michael
On Tue, Feb 21, 2012 at 5:24 PM, Shi, Tao <shidaxia at yahoo.com> wrote:
Hi list, I want to draw a bar plot with color indicating one grouping and different shading on top of the color indicating another grouping.? How should I proceed? Thanks! ...Tao
______________________________________________ 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.
Hi Michael, Thanks for your reply!? I'm not sure if I was clear.? I was really thinking about shading lines.? I have just came up with a solution on my own: barplot(1:10, col=rep(0:1, each=5)) barplot(1:10, angle=20, density=c(0,20), col=2, add=T) Here is my initial failed attempt: barplot(1:10, angle=20, density=c(0,20), col=rep(0:1, each=5)) ...Tao ----- Original Message -----
From: R. Michael Weylandt <michael.weylandt at gmail.com> To: "Shi, Tao" <shidaxia at yahoo.com> Cc: "r-help at r-project.org" <r-help at r-project.org> Sent: Tuesday, February 21, 2012 6:49 PM Subject: Re: [R] barplot with both color and shading T his seems like a natural fit for ggplot2 graphics, but I'm not aware of shading as a widely implemented graphical element: this might have some useful information -- http://had.co.nz/ggplot2/geom_histogram.html Can you find an example of "shading" in R? (perhaps in the R Graphics Gallery) If you look at example(barplot) there's an example of how to use different line patterns, but I don't find it particularly clear. The grouping techniques seem much clearer to me. Michael On Tue, Feb 21, 2012 at 5:24 PM, Shi, Tao <shidaxia at yahoo.com> wrote:
Hi list, I want to draw a bar plot with color indicating one grouping and different
shading on top of the color indicating another grouping.? How should I proceed?
Thanks! ...Tao
______________________________________________ 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.
On 02/22/2012 09:24 AM, Shi, Tao wrote:
Hi list, I want to draw a bar plot with color indicating one grouping and different shading on top of the color indicating another grouping. How should I proceed?
Hi Tao, You can build a barplot with the rectFill function (plotrix), but it is not a matter of just calling barplot. Have a look at the example function and see if it is what you want. Jim
Shi, Tao <shidaxia <at> yahoo.com> writes:
Hi list, I want to draw a bar plot with color indicating one grouping and different
shading on top of the color
indicating another grouping.? How should I proceed? Thanks! ...Tao
Does this help? http://finzi.psych.upenn.edu/Rhelp10/2010-September/252219.html Michael Bibo michael_bibo<at>health.qld.gov.au
Thank you both, Michael and Jim, for the answers! ----- Original Message -----
From: Michael Bibo <michael_bibo at health.qld.gov.au> To: r-help at stat.math.ethz.ch Cc: Sent: Wednesday, February 22, 2012 12:46 AM Subject: Re: [R] barplot with both color and shading Shi, Tao <shidaxia <at> yahoo.com> writes:
Hi list, I want to draw a bar plot with color indicating one grouping and different
shading on top of the color
indicating another grouping.? How should I proceed? Thanks! ...Tao
Does this help? http://finzi.psych.upenn.edu/Rhelp10/2010-September/252219.html Michael Bibo michael_bibo<at>health.qld.gov.au
______________________________________________ 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.