title: R barplot with very long names
body: <p>I want to produce a barplot of 10 items stored in a data frame:</p>
  
  <pre><code>df &lt;- structure(list(v = structure(c(0.133177575198731, 0.048416489312887, 
  0.0323328322269662, 0.0257842168974815, 0.0207946396185765, 0.0157952295839215, 
  0.015414483430714, 0.0138292246981344, 0.0136598827935515, 0.0132108536143025
  ), .Dim = 10L, .Dimnames = structure(list(c("HIPERTENSION ESENCIAL (PRIMARIA)", 
  "RINOFARINGITIS AGUDA", "DIARREA Y GASTROENTERITIS DE PRESUNTO ORIGEN INFECCIOSO", 
  "LUMBAGO NO ESPECIFICADO", "INFECCION DE VIAS URINARIAS, SITIO NO ESPECIFICADO", 
  "AMIGDALITIS AGUDA, NO ESPECIFICADA", "FIEBRE, NO ESPECIFICADA", 
  "CEFALEA", "DOLOR EN ARTICULACION", "HIPOTIROIDISMO, NO ESPECIFICADO"
  )), .Names = "")), names = c("HIPERTENSION ESENCIAL (PRIMARIA)", 
  "RINOFARINGITIS AGUDA", "DIARREA Y GASTROENTERITIS DE PRESUNTO ORIGEN INFECCIOSO", 
  "LUMBAGO NO ESPECIFICADO", "INFECCION DE VIAS URINARIAS, SITIO NO ESPECIFICADO", 
  "AMIGDALITIS AGUDA, NO ESPECIFICADA", "FIEBRE, NO ESPECIFICADA", 
  "CEFALEA", "DOLOR EN ARTICULACION", "HIPOTIROIDISMO, NO ESPECIFICADO"
  )), .Names = c("v", "names"), row.names = c("HIPERTENSION ESENCIAL (PRIMARIA)", 
  "RINOFARINGITIS AGUDA", "DIARREA Y GASTROENTERITIS DE PRESUNTO ORIGEN INFECCIOSO", 
  "LUMBAGO NO ESPECIFICADO", "INFECCION DE VIAS URINARIAS, SITIO NO ESPECIFICADO", 
  "AMIGDALITIS AGUDA, NO ESPECIFICADA", "FIEBRE, NO ESPECIFICADA", 
  "CEFALEA", "DOLOR EN ARTICULACION", "HIPOTIROIDISMO, NO ESPECIFICADO"
  ), class = "data.frame")
  </code></pre>
  
  <p>I went with standard <code>barplot</code> and it works well, except the names are too long, and thus don't fit inside any reasonable frame.</p>
  
  <pre><code>barplot(df$v,names = rownames(df),las=3,cex.names=0.5)
  </code></pre>
  
  <p>is close enough, but still names are so long they don't fit (if I try a <code>cex.names</code> below 0.5 it becomes unreadable).
  I also tried with <code>ggplot</code>:</p>
  
  <pre><code>library(ggplot2)
  
  ggplot(df,aes(x=names,y=v))+
     geom_bar(stat="identity")
  
  ggplot(df,aes(x=names,y=v))+
     geom_bar(stat="identity")+
     theme(text = element_text(size=12),
           axis.text.x = element_text(angle=90, vjust=2))
  </code></pre>
  
  <p>which gives a very approximate result, but then I haven't been able to find how to keep a decreasing order (ggplot orders the names in x, instead of keeping the order in <code>df</code>).</p>
  
  <p>I'll appreciate if you can provide me with a two-sided answer:</p>
  
  <ul>
  <li>How to put the labels <em>inside</em> the bars in standard <code>barplot</code> <strong>and</strong></li>
  <li>How to keep <code>df</code> order of items in <code>ggplot</code></li>
  </ul>
  
  <p>Thanks in advance!
   - </p>