You can play around with something like this to control the plots and
to add color to them:
data(HairEyeColor)
a <- as.table( apply(HairEyeColor, c(1,2), sum) )
a1<-a[1:2,]
library(lattice)
library(reshape)
x <- melt(a1)
p1 <- barchart(value ~ Eye, group=Hair, data=x)
p2 <- barchart(value ~ Hai
I tried the "add=TRUE" but get
"Warning messages: 1: parameter "add" could not be set in high-level plot()
function"
Josh
HBaize wrote:
>
>
> Josh,
> Check into "add=TRUE" :-)
>
> All you need to do is insert "add=TRUE" to the second
> chart to superimpose it on the first chart. You might
Hi, basically I am trying to create a grouped bar graph with each group a
different color and a bar in each group to have shading lines. Basically
combine the 2 graphs created below.
Thanks,
Josh
data(HairEyeColor)
a <- as.table( apply(HairEyeColor, c(1,2), sum) )
a1<-a[1:2,]
par(mfcol=c(1,2),
Well perhaps we can take the mystery of why it work for me, but not you, off
line :-)
I'm using R 2.6.1 on a WinXP platform.
You could try just using shades of color like this:
data(HairEyeColor)
a <- as.table( apply(HairEyeColor, c(1,2), sum) )
a1<-a[1:2,]
barplot(a1,
type="n",
Josh,
Check into "add=TRUE" :-)
All you need to do is insert "add=TRUE" to the second
chart to superimpose it on the first chart. You might also
consider making the second bar a different shade of color
rather than using shadding lines, then it would only be one
plot.
data(HairEyeColor)
a
5 matches
Mail list logo