title: Control bar border (color) thickness with ggplot2 stroke
body: <p>Is it possible to use the stroke argument introduced with <code>ggplot2 2.0</code> to adjust the thickness of borders around bars?  If not, is there a way to control bar-border thickness along the lines of point-border thickness?  <a href="https://stackoverflow.com/questions/19506630/control-point-border-thickness-in-ggplot">Stroke applies to borders around certain shapes -- see the second answer</a></p>
  
  <p>A very modest MWE, showing fill only:</p>
  
  <pre><code>factor &lt;- c("One", "Two", "Three", "Four")
  value &lt;- c(1, 2, 3, 4)
  factor2 &lt;- c("A", "B", "A", "B")
  
  df &lt;- data.frame(factor = factor(factor, levels = factor),
                   value = value, factor2 = factor2) 
  
  ggplot(df, aes(x = factor, y = value, color = factor2)) +
    geom_bar(stat = "identity")
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/lIqKI.png" rel="noreferrer"><img src="https://i.stack.imgur.com/lIqKI.png" alt="Colored borders, but what about size of borders"></a></p>
  
  <p><strong>EDIT after COMMENT</strong>
  OK, thanks to MLavoie's comment, it was so simple.  Here is the code I have ended with, and, no, I am not actually using this plot other than to teach about <code>ggplot</code> and its capabilities.</p>
  
  <pre><code>ggplot(df, aes(x = factor, y = value, color = factor2)) +
    scale_color_manual(values = c("darkgreen", "slateblue4")) +
    geom_bar(stat = "identity", aes(fill = "transparent", size = ifelse(factor2 == "A", 2, 1))) +
    guides(fill = FALSE) +
    guides(size = FALSE) +
    guides(color = FALSE)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/uzit9.png" rel="noreferrer"><img src="https://i.stack.imgur.com/uzit9.png" alt="Modifying bar borders by thickness and shade"></a></p>