I already plot chart with plotly. You can see how is look like code
library(plotly)
fig <- plot_ly(
type='histogram',
x=~rnorm(100, 5))
fig <- fig %>% add_trace(
type='histogram',
x=~rnorm(20, 5))
fig <- fig %>% layout(
barmode="stack",
bargap=0.1)
fig
This plot have two colors orange and blue. So now I want to plot other plot but now with ggplot2 but with same colors.You can see code and pic below
library(ggplot2)
specie <- c(rep("sorgho" , 3) , rep("poacee" , 3) , rep("banana" , 3) , rep("triticum" , 3) )
condition <- rep(c("normal" , "stress" , "Nitrogen") , 4)
value <- abs(rnorm(12 , 0 , 15))
data <- data.frame(specie,condition,value)
ggplot(data, aes(fill=condition, y=value, x=specie)) +
geom_bar(position="stack", stat="identity")+scale_color_manual(values=c("royalblue", "dark orange1"
))
But here I have different colors.So can anybody help me how to get same colors (blue and orange) from plotly and make graph with ggplot2?