I have the following type of data (inside a data.frame df
):
x A B C
1 100 1.2 1.3
2 90 1.1 0.9
I want to have a multiple bar plot of the columns A
, B
, C
of df
, so I run the following:
tmp <- cbind(df$x, melt(df[,-1]))
names(tmp) <- c("x", "variable", "value")
ggplot(tmp, aes(x,value)) + geom_bar(stat = "identity" ) + facet_grid(variable~.)
And it works fine, except for the fact that the values in the column A
are much higher than for the rest, and the scales are not adapting.
Could somebody give me a hint on own to adjust the scale in each plot?
Thanks a lot!