4

Is there any native way of placing a curly brace annotation on a ggplot?

Example:

enter image description here

stevec
  • 41,291
  • 27
  • 223
  • 311
  • 1
    Technically, it could be possible since you can annotate a ggplot with an svg picture. You could use `ggplot_build()` to recover the absolute coordinates of the wished intersection points, then use these coordinates to calculate the svg size/position, and position a text `annotate`... but does it worth? Another option would be to content one self with a more simple shape such as a segment or a `geom_pointrange()`, instead of a bracket ? – Jrm_FRL Apr 25 '20 at 12:56
  • 1
    *very* related https://stackoverflow.com/questions/7001799/ggplot2-curly-braces-on-an-axis – tjebo Apr 25 '20 at 13:57
  • Thanks for the help, I thought there would be something native to 'tidyverse' but pBrackets (from one of the linked answers) looks very good, there are a lot of brace types https://cran.r-project.org/web/packages/pBrackets/vignettes/pBrackets_vignette.pdf – stevec Apr 25 '20 at 14:11
  • 1
    you can use my package ggbrace (https://github.com/NicolasH2/ggbrace) which places brace + label. – NicolasH2 Mar 22 '21 at 15:47

0 Answers0