title: How to use kwargs in matplotlib.axes.Axes.arrow python 2.7
body: <p>I'm working from arrow_simple_demo.py <a href="https://matplotlib.org/examples/pylab_examples/arrow_simple_demo.html" rel="nofollow noreferrer">here</a> which I have already modified to be:</p>
  
  <pre><code>import matplotlib.pyplot as plt
  
  ax = plt.axes()
  ax.arrow(0, 0, 0.5, 0.5, head_width=0.05, head_length=0.1)
  </code></pre>
  
  <p>however, I want to change the line style of the arrow to dashed using a kwarg. The arrow docs suggest it is possible. <a href="https://matplotlib.org/api/_as_gen/matplotlib.axes.Axes.arrow.html#matplotlib.axes.Axes.arrow" rel="nofollow noreferrer">arrow docs</a></p>
  
  <p>So I tried to give arrow the **kwargs argument to import: </p>
  
  <pre><code>kwargs = {linestyle:'--'}
  </code></pre>
  
  <p>Now my code looks like this:</p>
  
  <pre><code>import matplotlib.pyplot as plt
  
  ax = plt.axes()
  kwargs={linestyle:'--'}
  ax.arrow(0, 0, 0.5, 0.5, head_width=0.05, head_length=0.1, **kwargs)
  </code></pre>
  
  <p>But the result is:</p>
  
  <pre><code>NameError: name 'linestyle' is not defined
  </code></pre>
  
  <p>I'm wondering if anyone can tell me if I am using the kwargs correctly, and whether I need to import Patch from matplotlib's patches class to make this work. The statement "Other valid kwargs (inherited from :class:<code>Patch</code>)" which is in the arrow docs above the listing of kwargs makes me think it might be necessary. I have also been looking at the patches docs to figure that question out. <a href="https://matplotlib.org/1.5.3/api/patches_api.html" rel="nofollow noreferrer">here</a></p>
  
  <p>EDIT:</p>
  
  <p>Code finished when I passed linestyle key as a string, but I am not getting the dashed arrow line that I was hoping for. </p>
  
  <pre><code>import matplotlib.pyplot as plt
  ax = plt.axes()
  kwargs={'linestyle':'--'}
  ax.arrow(0, 0, 0.5, 0.5, head_width=0.05, head_length=0.1, **kwargs)
  </code></pre>
  
  <p>see picture:</p>
  
  <p><a href="https://i.stack.imgur.com/s9EZE.png" rel="nofollow noreferrer">arrow plot solid line</a></p>