I have been working on a continuous data set that when plotted with geom_density
(ggplot2) will have data points cut off when using scale_x_continuous
. The great thing is that xlim()
displays the data just as I need it! Only problem is that xlim seems to eliminate the ability to change the axis tick mark labels. So when my Z-score density plot needs to show every tick mark from -3 to 3, it shows data within that range, but does not display the tick marks at those points, as seen in 1.
What would be a function that lets me alter the axis tick marks?
UPDATE: this is what: scale_x_continuous(breaks = pretty(a_tubulin_data$Z.Scores, n = 9)) + coord_cartesian(xlim=c(-3,3))
outputs as seen in 2