Friends, How do I create a stacked barplot on both sides of the x-axis (preferably in ggplot2) ?
Example: http://s23.postimg.org/3lbgicb3f/Example.png
I've searched around, but haven't been able to find any good examples. The data consists of two locations (1 and 2), with values (weight) for 5 different categories (A, B, C, R and S). A, B and C should on top of the x-axis, while R and S should be plotted below. Note the positive values on both sides of the x-axis. Never mind the error-bars.
Example data:
Type=c("A","B","C","R","S","A","B","C","R","S")
Location=c(1,1,1,1,1,2,2,2,2,2)
Value=c(2,6,5,3,2.5,6,3,2,4,1.5)
df=data.frame(Type, Location, Value)
df$Location <- as.factor(df$Location)
Any pointers would be much appreciated, Nordenskiold
subset
bit. I have a faint recollection of seeing this documented someplace, but can't figure out where. Also, feel a bit silly +1 after yours, and would've done so on the other post save for the overplotting, so this is as good a place to thank you for teaching me something new. – Seritaserjeant