title: How can I add a table to my ggplot2 output?
body: <p>Is there a quick way to add a table to my ggplot2 graph?  I would like this table to have the value of each line at the same breakpoints as specified in <code>scale_x_continuous()</code>, but with the percentage (%) symbol next to them.   My end goal is to create something like the image below. However, I don't know how to add the table.</p>
  
  <p><img src="https://i.stack.imgur.com/PtzLR.png" alt="gains chart example"> </p>
  
  <p>The following block of code just makes two lines in ggplot2 and should be adequate to provide me with an example:</p>
  
  <pre><code>require(ggplot2)
  df &lt;- data.frame(a = seq(0, 90, 10), b = seq(10, 100, 10))
  df.plot &lt;- ggplot(data = df, aes(x = seq(1, 100, 10))) + geom_line(aes(y = a), colour = 'red') +
             geom_line(aes(y = b), colour = 'blue') + scale_x_continuous(breaks = seq(0,100,10))
  df.plot
  </code></pre>
  
  <p>A similar question was asked <a href="https://stackoverflow.com/questions/7408508/how-can-i-add-a-table-to-a-graph">here</a>, but the given answer is more of a workaround and wouldn't look good for a table with 2 rows.  I am going to mess around with the clues provided by Brian Diggs, but I figured I would post this in case anyone has already done something like this.  Any help would be greatly appreciated!</p>
  
  <p><strong>Edit:</strong> Thanks to @baptiste for helping me figure this out. I posted my own response below that finished what he started.</p>