ggplot2 - Keepin the x and y scale to max values with defined intervals in ggplot in R -
i have set of data frame values , have plotted of ggplot code have follows:
ggplot(lung_dfdsa, aes(x=z_lung_con, y=lung_dsa)) + geom_point(shape=21, colour = "blue")+ scale_x_continuous(breaks = seq(0,20,2)) + scale_y_continuous(breaks = seq(0,20,by= 2)) +geom_smooth(method=lm)+ labs(x = "measured lung expression values", y = "estimated lung expression values") + theme_bw() + theme( panel.grid.major = element_blank(),panel.grid.minor = element_blank(),panel.border = element_rect(colour = "black"))
this code creates graph axis limits upto 14 because there data upto that, want have max limit upto 20 intervals have defined if there aren't values in dataset upto range. possible?
you can use expand_limits
. see http://docs.ggplot2.org/current/expand_limits.html
Comments
Post a Comment