I did as mentioned in this stackoverflow.
But, in my case, all the bar has the same height.
Could anyone check what went wrong with mine?
Here is the code
thank you
mat_d11=data.frame(
month=month.name[rep(c(1:12), each = 4)],
V1=round(runif(48,0,1),2),
var=rep(c("a","b","c","d"),12)
)
mat_d11$var=as.factor(mat_d11$var)
ggplot(data = mat_d11, aes(x = factor(month), fill = V1, pattern = var)) +
geom_bar_pattern(position = "Dodge",
color = "black",
pattern_fill = "black",
pattern_angle = 0,
pattern_density = 0.1,
pattern_spacing = 0.05,
pattern_key_scale_factor = 0.6)