title: Specifying gpar settings for grid arrows in R
body: <p>I'm developing a plot of proportionally sized arrows, and have a workflow for size, direction and arrow-head size, but there are a couple of issues with the arrowheads: 1. they have rounded line-join and 2. they don't close (see bottom right corner) even when <code>type='closed'</code>.</p>
  
  <pre><code>require(ggplot2)
  require(grid)
  d = data.frame(x = 1:10, y = 0, size = 1:10)
  
  ggplot(d, aes(x, y, size = size)) +
    geom_segment(aes(xend = x, yend = y + size), 
                 arrow = arrow(length = unit(d$size, "mm"), type='closed')) +
    scale_size(range = c(2, 4))
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/2dYiO.png" alt="enter image description here"></p>
  
  <p>Arrows are based on <a href="http://stat.ethz.ch/R-manual/R-patched/library/grid/html/arrow.html" rel="nofollow noreferrer">grid graphics</a>, but I cannot figure out how to specify the setting.  <code>get.gpar()</code> yields:</p>
  
  <pre><code>$lineend
  [1] "round"
  
  $linejoin
  [1] "round"
  </code></pre>
  
  <p>but <code>gpar(linejoin = 'mitre', lineend = 'butt')</code> does not change this.  Is there any way to change these settings?  Thanks in advance.</p>
  
  <hr>
  
  <p><strong>Edit</strong></p>
  
  <p>Plot image including grid.segments arrow added:</p>
  
  <p><img src="https://i.stack.imgur.com/BUdwA.png" alt="enter image description here"></p>