title: How to add ggplot2 gridlines or color to show multiple plot points by variables (y-axis)?
body: <p>I am creating a figure that shows 4 outcome beta's + CI lines per variable.</p>
  <p>I want to more clearly show that the 4 plotted points (outcome) and lines (CIs) relate to each variable.</p>
  <p>Therefore, I am curious how I might 1) make clearer panels or grid changes to show which 4 outcomes relate to which variable OR 2) Create brackets around the variable on the y axis?</p>
  <p>Code and figure below.</p>
  <pre class="lang-r prettyprint-override"><code>library(tidyverse)
  library(viridis)
  #&gt; Loading required package: viridisLite
  
  df &lt;- tribble(
    ~var, ~gender, ~outcome, ~est, ~l95, ~u95,
    &quot;A&quot;, &quot;Men&quot;, &quot;X&quot;, 0.2, 0.1, 0.3,
    &quot;A&quot;, &quot;Men&quot;, &quot;Y&quot;, 0.3, 0.25, 0.35,
    &quot;B&quot;, &quot;Men&quot;, &quot;X&quot;, -0.4, -0.5, -0.3,
    &quot;B&quot;, &quot;Men&quot;, &quot;Y&quot;, -0.45, -0.5, -0.4,
    &quot;A&quot;, &quot;Women&quot;, &quot;X&quot;, 0.4, 0.3, 0.5,
    &quot;A&quot;, &quot;Women&quot;, &quot;Y&quot;, 0.6, 0.55, 0.65,
    &quot;B&quot;, &quot;Women&quot;, &quot;X&quot;, -0.1, -0.2, 0,
    &quot;B&quot;, &quot;Women&quot;, &quot;Y&quot;, -0.3, -0.4, -0.2,
    &quot;A&quot;, &quot;Men&quot;, &quot;Z&quot;, 0.2, 0.1, 0.3,
    &quot;A&quot;, &quot;Men&quot;, &quot;AA&quot;, 0.3, 0.25, 0.35,
    &quot;B&quot;, &quot;Men&quot;, &quot;Z&quot;, -0.4, -0.5, -0.3,
    &quot;B&quot;, &quot;Men&quot;, &quot;AA&quot;, -0.45, -0.5, -0.4,
    &quot;A&quot;, &quot;Women&quot;, &quot;Z&quot;, 0.4, 0.3, 0.5,
    &quot;A&quot;, &quot;Women&quot;, &quot;AA&quot;, 0.6, 0.55, 0.65,
    &quot;B&quot;, &quot;Women&quot;, &quot;Z&quot;, -0.1, -0.2, 0,
    &quot;B&quot;, &quot;Women&quot;, &quot;AA&quot;, -0.3, -0.4, -0.2
  )
  
  df %&gt;%
    ggplot(aes(x=est, y=var, color=outcome)) +
    geom_point(position = position_dodge2(width = 1.0)) +
    scale_y_discrete(limits=rev, expand=c(0, 0)) +
    scale_color_viridis_d() +
    geom_linerange(aes(xmin=l95, xmax=u95),
      position = position_dodge2(width=1.0)) +
    geom_vline(xintercept = 0, linetype = &quot;dashed&quot;) +
    facet_grid(~ gender) +
    theme_minimal() +
    theme(plot.title.position = &quot;plot&quot;,
      plot.title = element_text(face=&quot;bold&quot;),
      legend.position = &quot;top&quot;,
      strip.text = element_text(face=&quot;bold&quot;)) +
    labs(y = NULL,
      x = &quot;Standardized Beta&quot;,
      title = &quot;My cool plot shows this thing&quot;,
      subtitle = &quot;More important details, 95% confidence intervals&quot;,
      caption = &quot;Even more important details&quot;)
  </code></pre>
  <p><img src="https://i.imgur.com/Jrwc4BP.png" alt="" /></p>
  <p><sup>Created on 2021-06-03 by the <a href="https://reprex.tidyverse.org" rel="nofollow noreferrer">reprex package</a> (v2.0.0)</sup></p>