3

I need to add a Y axis break to a plot I made in ggplot. Is it possible to use the gap.barplot function in plotrix in a graph in ggplot? When I try, it cancels everything I did in ggplot and plots just the gap.barplot bit.

Thank you

Barbara

aosmith
  • 34,856
  • 9
  • 84
  • 118
B.Durante
  • 41
  • 3
  • 2
    As far as I'm aware `plotrix` uses base graphics while `ggplot` uses the `grid` graphics system. This means `plotrix` functions will not work with `ggplot` graphs. – Axeman Sep 30 '16 at 08:24
  • 2
    Given everything I know about ggplot, I imagine that it has been made *incredibly* difficult to add a break in the axis. Hadley Wickham is fairly serious about plot integrity, and has intentionally not implemented related features (e.g., dual axes). Breaking the y-axis is generally a very bad idea. That said, if you have a particular use case, someone here may be able to provide more help. – Mark Peterson Sep 30 '16 at 12:27

1 Answers1

1

Unfortunately NO. They work on two different "worlds". I've been trying a lot but it seems (just like @Mark Peterson wrote) that doing this in ggplot is nearly impossible on purpose

You should look into these questions and answers which are very similiar: Using ggplot2, can I insert a break in the axis? Broken barplot using R/ggplot2

anakar
  • 316
  • 2
  • 13