title: How can I label the points of a quantile-quantile plot composed with ggplot2?
body: <p>I am building a quantile-quantile plot out of an variable called <code>x</code> from a data frame called <code>df</code> in the working example provided below. I would like to label the points with the <code>name</code> variable of my <code>df</code> dataset.</p>
  
  <p>Is it possible to do this in ggplot2 without resorting to the painful solution (coding the theoretical distribution by hand and then plotting it against the empirical one)?</p>
  
  <p><strong>Edit:</strong> it happens that yes, thanks to a user who posted and then deleted his answer. See the comments after Arun's answer below. Thanks to Didzis for his otherwise clever solution with <code>ggbuild</code>.</p>
  
  <pre><code># MWE
  df &lt;- structure(list(name = structure(c(1L, 2L, 3L, 4L, 5L, 7L, 9L, 
  10L, 6L, 12L, 13L, 14L, 15L, 16L, 17L, 19L, 18L, 20L, 21L, 22L, 
  8L, 23L, 11L, 24L), .Label = c("AUS", "AUT", "BEL", "CAN", "CYP", 
  "DEU", "DNK", "ESP", "FIN", "FRA", "GBR", "GRC", "IRL", "ITA", 
  "JPN", "MLT", "NLD", "NOR", "NZL", "PRT", "SVK", "SVN", "SWE", 
  "USA"), class = "factor"), x = c(-0.739390016757746, 0.358177826874146, 
  1.10474523846099, -0.250589535389937, -0.423112615445571, -0.862144579740376, 
  0.823039669834058, 0.079521521937704, 1.08173649722493, -2.03962942823921, 
  1.05571087029737, 0.187147291278723, -0.144770773941437, 0.957990771847331, 
  -0.0546549555439176, -2.70142550075757, -0.391588386498849, -0.23855544527369, 
  -0.242781575907386, -0.176765072121165, 0.105155860923456, 2.69031085872414, 
  -0.158320176671995, -0.564560815972446)), .Names = c("name", 
  "x"), row.names = c(NA, -24L), class = "data.frame")
  
  library(ggplot2)
  qplot(sample = x, data = df) + geom_abline(linetype = "dotted") + theme_bw()
  
  # ... using names instead of points would allow to spot the outliers
  </code></pre>
  
  <p>I am working on an adaptation of <a href="https://gist.github.com/chrishanretty/3885712" rel="noreferrer">this gist</a>, and will consider sending other questions to CrossValidated if I have questions about the regression diagnostics, which might be of interest to CV users.</p>