Question Details

No question body available.

Tags

r ggplot2 ggh4x

Answers (1)

March 5, 2026 Score: 4 Rep: 131,331 Quality: Medium Completeness: 80%

You can now use ggplot2::guideaxis(cap="upper") to cap or truncate the axis at the upper break (and ggh4x::guideaxistruncated throws a warning with this information). However, I can't see an option to use a unit to set the length of the axis line. Instead you can use scalex/yxxx to set the upper break:

library(ggplot2)

axis Warning: guide
axistruncated() was deprecated in ggh4x 0.3.0. #> ℹ Please use ggplot2::guideaxis(cap = TRUE) instead. #> This warning is displayed once per session. #> Call lifecycle::lastlifecyclewarnings() to see where this warning was #> generated.

p