title: How to plot Insertions and Deletions
body: <p>I'm trying to plot the indels length from a file created by vcftools with the feature: "--hist-indel-len". With that file, I wanted to make a plot with the insertion and deletions, if length is negative, is a deletion and if length is positive, is a insertion. The Count column will be at y-axis from 0 to the max value, and the x-axis will be the min length (-15 in that case) to the max length (15 in that case).</p>
  
  <p>The data looks like:</p>
  
  <pre><code>   LENGTH  COUNT
  1    -15    117
  2    -14    178
  3    -13    198
  4    -12    414
  5    -11    314
  6    -10    451
  7     -9    547
  8     -8   1114
  9     -7   1214
  10    -6   2371
  11    -5   3822
  12    -4   9229
  13    -3  17333
  14    -2  20373
  15    -1  19774
  16     0 202129
  17     1  22259
  18     2  10101
  19     3   4940
  20     4   2458
  21     5   1343
  22     6    987
  23     7    535
  24     8    427
  25     9    317
  26    10    307
  27    11    161
  28    12    270
  29    13    116
  30    14    121
  31    15     95
  </code></pre>
  
  <p>With this data.frame I'm trying to get a plot like:
  <a href="https://i.stack.imgur.com/SGwQV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SGwQV.png" alt="enter image description here"></a></p>
  
  <p>My attempt was using:</p>
  
  <pre><code>z &lt;- read.csv("/home/userx/out.indel.hist", sep = "\t")
  
  zz &lt;- table(z)
  
  barplot(zz, main="Insertion and Deletions",
           xlab="Length", ylab="Count", col=c("darkblue","red"),
           legend = rownames(zz), beside=TRUE)
  </code></pre>
  
  <p>Result: </p>
  
  <p><a href="https://i.stack.imgur.com/64vVv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/64vVv.png" alt="enter image description here"></a></p>
  
  <p>Any help would be appreciated.</p>