Hey guys,

This is the bar chart that I am working on:

library(lattice);
data <- data.frame(
        X1 = c(2300, 1300, 1300, 450),
        X2 = c(2110, 2220, 1100, 660),
        Y = factor(c("sample1", "sample2", "sample3", "sample4"))
        );
barchart(
        Y ~ X1 + X2,
        data,
        stack = TRUE,
        horiz = TRUE,
        lwd = 1.5,
        xlab = expression(bold("Sample size")),
        col = colors()[c(24,1)],
        xlim = c(0,5000),
        xat = seq(0,5000,1000)
        );

I wanted to make a bar chart that has hatching lines inside the bar: with
sample 2 and 4 having vertical lines and sample 1 and 3 having horizontal
lines, like the following (I kind of photoshopped the image to demonstrate
what I wanted it to look like):

http://r.789695.n4.nabble.com/file/n2277107/test.png 

Anyone knows how I can add hatching to the bar charts?

Thanks very much for your time!!!
-- 
View this message in context: 
http://r.789695.n4.nabble.com/help-on-bar-chart-tp2277107p2277107.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@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.

Reply via email to