I\'m using ggplot
to create sevral boxplots from the following data:
df<-(structure(list(Effect2 = c(\"A2\", \"A2\", \"A2\", \"A2\", \"A2\",
Use coord_cartesian
instead of scale_y_continuous
:
ggplot(df, aes(x=Effect2, y=OddsRatioEst)) +
geom_boxplot(outlier.colour=NA) +
coord_cartesian(ylim = c(0, 100))
From the coord_cartesian
documentation:
Setting limits on the coordinate system will zoom the plot (like you're looking at it with a magnifying glass), and will not change the underlying data like setting limits on a scale will.
The output is as follows. As you can see, not deleting those outliers changes the picture somewhat, so you may want to change the y limit as well.