Difference in coord_cartesian and scale_y_continuous

r
ggplot2

#1

I am currently trying to plot a boxplot using a ggplot2 package of R. I am plotting a factor variable on the x-axis and continuous variable on the y-axis.

I have used two type of layer in my plot.

qplot(x=gender,y=friend_count,data=subset(pf,!is.na(gender)),geom='boxplot')+scale_y_continuous()

qplot(x=gender,y=friend_count,data=subset(pf,!is.na(gender)),geom='boxplot')+coord_cartesian()

I want to know the difference between this two layer because I am getting slightly different plots.


#2

scale_y_continuous is used for subsetting the data with the help of xlim and ylim
coord_cartesian is used to zoom in on a plot programatically

I tried your code on a sample data set and it is giving me the same result

Can you be more specific?