I'm working from arrow_simple_demo.py here which I have already modified to be:
import matplotlib.pyplot as plt
ax = plt.axes()
ax.arrow(0, 0, 0.5, 0.5, head_width=0.05, head_length=0.1)
however, I want to change the line style of the arrow to dashed using a kwarg. The arrow docs suggest it is possible. arrow docs
So I tried to give arrow the **kwargs argument to import:
kwargs = {linestyle:'--'}
Now my code looks like this:
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)
But the result is:
NameError: name 'linestyle' is not defined
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:Patch)" 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. here
EDIT:
Code finished when I passed linestyle key as a string, but I am not getting the dashed arrow line that I was hoping for.
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)
see picture:

