Home > front end >  How to create stack bar charts that look cubic (3D) in R ggplot2?
How to create stack bar charts that look cubic (3D) in R ggplot2?

Time:06-23

I want the stack charts as coded below but I want them to look cubic (attached). Is it even possible in R?

set.seed(123)
specie <- c(rep("sorgho" , 3) , rep("poacee" , 3) , rep("banana" , 3) , rep("triticum" , 3))
condition <- rep(c("normal" , "stress" , "Nitrogen", "T") , 3)
value <- abs(rnorm(12, 0 ,15))
data <- data.frame(specie,condition,value)
 
# Stacked
ggplot(data, aes(fill=condition, y=value, x=specie))   
    geom_bar(position="stack", stat="identity", alpha = 0.7, width = 0.3)   theme_classic()

enter image description here

enter image description here

CodePudding user response:

This is possible with the unpublished enter image description here

  • Related