I have the following ggplot:
that is generated using the following script:
df_long <- melt(df)
ggplot(df_long, aes(x = variable, y = value)) +
geom_boxplot() +
facet_wrap(~variable, scales = 'free', ncol = 6)
I would like to change the y-axis limits to start with 0 and end with the maximum value for each variable, and also to have the same breaks for all the variables. Currently, the AC
and ND
are fine since they have same breaks (their labels are even aligned) but the other variables are different. For the NV
and IC
, they don't end with the maximum value and they don't have the same breaks as with AC
and ND
. For the PIC
and DBI
, they don't have the same breaks as with AC
and ND
. In other woeds, I want all y axes to be aligned and look elegant.
Do you have any idea how to fix that?