|
From: Alan G I. <ai...@am...> - 2014-02-02 22:36:46
|
I just want to draw a few vectors of different colors. In Mathematica I would use Arrow: http://reference.wolfram.com/mathematica/ref/Arrow.html In Matplotlib I cannot find an easy way. Here's the best I came up with so far. import matplotlib.pyplot as plt from matplotlib.patches import Arrow fig, ax = plt.subplots(1,1) ax.set_aspect('equal') ax.add_artist( Arrow(0,0,1,1, width=0.1, facecolor='red',edgecolor=None) ) ax.add_artist( Arrow(0,1,1,-1, width=0.01, facecolor='k',edgecolor=None) ) Things that seem wrong with the interface: - takes 4 numbers instead of a list of points - head length and width is not determined by the line width - edge drawing cannot (?) be turned off The head drawing issue is particularly serious. So, have I overlooked an easy way to do what I want? One other question: am I supposed to use `add_patch` or `add_artist`, and why? Thanks, Alan Isaac |