0

I'm plotting a geom_point() layer using ggplot. In my plot, I have one dot located very far away from the rest along the y axis. As a result, the data visualization loses granularity and displays a bunch of little dots close together, as well as a single isolated dot high and far away from the rest.

I do not want to exclude the outlier. Instead, I would like to break the y-axis coordinates, for instance displaying ylim = c(0, 220) followed by c(2000, 2100). However, I did not succeed using coord_cartesian or scale_y_continuous.

Anyone knows how can I make this works, or possibly suggest any alternative solutions? Thanks

Z.Lin
  • 28,055
  • 6
  • 54
  • 94
AlGrasso
  • 1
  • 3
  • 1
    I don't think it's possible to do so in ggplot by design. See [here](https://stackoverflow.com/questions/7194688/using-ggplot2-can-i-insert-a-break-in-the-axis) for further discussion & some possible alternatives. – Z.Lin Nov 18 '17 at 13:42
  • Something from [ggplot2-custom-grob-over-axis-lines](https://stackoverflow.com/questions/39733972/ggplot2-custom-grob-over-axis-lines/40622343#40622343) might help. But it will not be easy. – Sandy Muspratt Nov 18 '17 at 21:16
  • Perhaps use `ggforce::facet_zoom` instead. – Axeman Nov 18 '17 at 22:06
  • Thank you all. You took time to read and to answer to the question I had. I will solve this question. Be well – AlGrasso Nov 20 '17 at 22:05

0 Answers0