library(ggplot2)
library(reshape2)
data <- data.frame(partition = c("1", "2", "3", "4","5"),
edge=c(2914.2025,4274.438333,7072.29,7984.68,10232.96333),
cloud=c(11445.02,10384.94,9165.71,7884.15,7113.79),
communication=c(803345.0248,805614.764,810357.3823,460484.3287,483277.6666))
df2 <- data.frame(partition = c("1", "2", "3", "4","5"),output_data=c(199.1,199.1,199.1,99.5,99.5))
elections_long <- melt(data, id = "partition")
ggplot(elections_long, aes(x = partition, y = value)) +
geom_bar(stat="identity", aes(fill = variable))+geom_line(data=df2, aes(x=partition, y=value),
colour="blue")
I am facing some issue in plotting a graph in R like a graph represented in below stacked bar graph.
Edge, cloud, and communication are represented in the stacked bar while output data should represented as a line graph.