vendredi 22 septembre 2017

Conditional bar graph adjustment [duplicate]

This question already has an answer here:

VAR     Estimate        ymax        ymin           t.value      SIDE
TM1     0.45207287  0.55211315    0.3520326      4.5189087      EAST
TM400   0.24634616  0.294695776   0.19799654     5.0951003      EAST
TM800   0.22187081  0.270010311   0.17373131     4.6089138      EAST
TM1    0.03150572   0.115834177  -0.05282274     0.3736072      WEST
TM400  -0.04242677  -0.006421522  -0.07843202   -1.1783496      WEST
TM800   0.06834191  0.097380534   0.03930329     2.3534835      WEST

I have above dataset and I made this plot using ggplot2enter image description here

I would like to adjust the graph this instruction: if t.value < 3, the bar graph is not soild and slash(//) types to fill the graph.

How do I add the code? This is my original code.

ggplot(FOR_PLOT_SALE, aes(x=factor(VAR), y=Estimate)) +  
  scale_fill_grey() +  facet_grid(. ~ SIDE) +  
  geom_bar(stat="identity",aes(fill=VAR)) +   
  geom_errorbar(aes(ymin=ymin, ymax= ymax),
                width=.2, 
                position="identity")+
  geom_hline(yintercept=0)+
  theme_classic()

Aucun commentaire:

Enregistrer un commentaire