0

I need to create a break in the y-axis, so I can show very low values, skip 90% of the y-axis and then show the very high values. How would I do this in r with ggplot?

Code is not needed, this is more of a conceptual question. I want something like below.

enter image description here

2
  • 2
    You can't by design, as cut axes produce misleading graphs. scale_y_log10 or facetting may be good alternatives. Commented Jul 15, 2018 at 0:42
  • Maybe you can take something from this Commented Jul 15, 2018 at 19:40

1 Answer 1

1

The functions scale_x_discrete() and scale_y_discrete() are used to customize discrete x and y axis, respectively. Just define your own breaks.

scale_x_discrete(name, breaks, labels, limits) scale_y_discrete(name, breaks, labels, limits) 
  1. name : x or y axis labels
  2. breaks : control the breaks in the guide (axis ticks, grid lines, …). Among the possible values, there are : NULL : hide all breaks waiver() : the default break computation a character or numeric vector specifying which breaks to display

  3. labels : labels of axis tick marks. Allowed values are : NULL for no labels waiver() for the default labels character vector to be used for break labels

  4. limits : a character vector indicating the data range

Reference this link

Sign up to request clarification or add additional context in comments.

1 Comment

I updated the question to make it more clear

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.