title: roundrectGrob equivalent for geom_rect in ggplot
body: <p>I am trying to make the graph appending on a background protein backbone (drawing using geom_rect() function). is there any way to create the round-edged rectangle instead of the basic rectangle (specifically for the red rectangle).
  Here is the code I have used.</p>
  
  <p>I have tried the roundrectGrob() function from <code>grid</code> but getting the error <code>Error: Don't know how to add roundrectGrob(x = 28, y = -2.3, width = 22, height = 0.45) to a plot</code></p>
  
  <pre><code>library(ggplot2)
  p &lt;- ggplot() +
  ylim(-4, 4) +
  xlim(0, 100)
  ## First rect
  p &lt;- p + geom_rect(mapping=aes(xmin=10,
  xmax=90,
  ymin=-2.15,
  ymax=-2.00),
  colour = "black",
  fill = "grey")
  ## Second rect
  p &lt;- p + geom_rect(mapping=aes(xmin=28,
  xmax=50,
  ymin=-2.30,
  ymax=-1.85),
  colour = "black",
  fill = "red")
  # print
  p
  dev.off()
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/LehZZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LehZZ.png" alt="Protein pfam structure for plot"></a></p>