On Sun, Mar 11, 2012 at 2:13 PM, Tony Yu <tsyu80@...> wrote:
> Is it possible to draw an arrow with a dashed line?
> I tried using a fancy arrow patch and set the linestyle:
> import matplotlib.pyplot as plt
> fix, ax = plt.subplots()
> ax.annotate('simple', xy=(2., -1), xycoords='data',
> xytext=(100, 60), textcoords='offset points',
> fc="0.6", ec="none", linestyle='dashed',
> But the linestyle argument just gets ignored.
> Is there a way to grab the connection path object and then change that to
> a dashed line? Actually, I'm not even sure it's possible to set a linestyle
> for a Path (since dashed lines are normally Line2D). Suggestions?
Nevermind: I though arrowstyle='simple' and arrowstyle='-|>' were the same
thing, but apparently not (I guess one draws the line as a patch, and the
other as a line). So the following works as expected:
import matplotlib.pyplot as plt
fix, ax = plt.subplots()
ax.annotate('simple', xy=(2., -1), xycoords='data',
xytext=(100, 60), textcoords='offset points',
fc="k", ec="k", linestyle='dashed',