You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Often when producing a chart I'd like the top y axis break to be above the maximum data value. E.g. on the following chart I'd like there to be a break at 100.
I can set the breaks manually using scale_y_continuous if I know what the data values are. However, often I don't know the range of values in advance.
This stack overflow post provides a solution to this problem, using the pretty function to set the breaks and limits in scale_y_continuous. I was wondering though if it would be possible to have an option in scale_x/y_continuous to say that the max axis break should be above the max value?
Apologies if this has been requested previously.
The text was updated successfully, but these errors were encountered:
I endorse Stefan's answer to this problem: use a function to set whatever rule you'd like for your limits. The function recieves the natural limits of the data and should return the limits you want to use.
Providing a function gives all sorts of flexibilities so that many rules about limits, breaks or labels don't need separate arguments in the scale functions.
I'm closing this issue as ggplot2 has sufficient flexibility in setting the limits to handle problem. Hardcoding the rule as an option could escalate the number of rules people want to have hardcoded as an option, and will interfere with breaks specification. As such, I think we should close this issue.
Often when producing a chart I'd like the top y axis break to be above the maximum data value. E.g. on the following chart I'd like there to be a break at 100.
Created on 2024-09-25 with reprex v2.1.1
I can set the breaks manually using
scale_y_continuous
if I know what the data values are. However, often I don't know the range of values in advance.This stack overflow post provides a solution to this problem, using the pretty function to set the breaks and limits in
scale_y_continuous
. I was wondering though if it would be possible to have an option in scale_x/y_continuous to say that the max axis break should be above the max value?Apologies if this has been requested previously.
The text was updated successfully, but these errors were encountered: