On Wed, Mar 14, 2012 at 6:02 AM, kususe <kus...@interfree.it> wrote:
>
> Hi folks,
> I've to draw an arrow.
> I used Arrow() function:
>
> pa.Arrow(0, 0, x, y, width=1.0)
>
> where I imported
>
> matplotlib.patches as pa
>
> Now, how to use plot() function di display the figure?
>
> Tanks in advance,
> K.
> --
> View this message in context:
> http://old.nabble.com/How-to-draw-an-arrow-tp33500720p33500720.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
>
Hi,
You need to add the patch to the current axes. For example,
#~~~
import matplotlib.pyplot as plt
from matplotlib import patches
arr = patches.Arrow(0,0,1,1)
ax = plt.gca()
ax.add_patch(arr)
plt.show()
#~~~
When you create a Matplotlib artist (here a `Patch` artist) with pyplot
(e.g. `plt.plot` creates a Line2D instance), pyplot takes care of matching
artist with axes. Artists themselves don't know anything about where you're
plotting, so you have to tell it where to go.
-Tony
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users