I'm trying to plot Z scores on a y-axis and position on an x-axis. The x-axis is continuous and very long with relatively small areas where z is 'interesting' i.e > 2. I would like to fragment the axis, removing the long areas where Z is not far from 0, then plotting just the immediate area around where Z > 2. Position is 200000 long on my data, and only about 2000 positions have an interesting z-score. Here is what my df looks like;
Position,Region,Height,Z
3,orf1,10,0
4,orf1,10,0.1
5,orf1,10,0.1
10,orf2,10,0
11,orf2,10,-3
12,orf2,10,-3
16,orf3,10,0.1
17,orf3,10,0.1
18,orf3,10,0.1
t1 <- ggplot(test, aes(x=Position, y=Z, colour=Z)) +
geom_point(stat='identity') + ylim(-5,5) +
theme(legend.position='none') + scale_x_discrete(limit = c(0,5,8,15))
The axis is still plotted in its entirety. If I want to NOT plot positions 6-10 and 13-15 how do I do this on the x-axis? Thanks