1

I'm trying to make a scatter plot in matplotlib with arrows coming out of the points to indicate upper limits. To this end I've done the following,

arrow = u'$\u2193$'
ax.plot(x, y, linestyle='none', markersize=20, marker=arrow)
ax.plot(x, y, linestyle='none', markersize=10, marker='o')

However, I'm not totally satisfied with the results -

This is the result

I'd like the arrows to come out of the middle of the points. So that point+arrow looks more like a single shape. Is there a way to do this?

Thanks!

1
  • You could try combining a scatter plot with arrows Commented Jul 27, 2014 at 2:42

1 Answer 1

4

you can do this with quiver. It takes position and direction data to make plots full of arrows. But they'll start at the x,y rather than being centered (as you found in plot)

x=[4.0,7.0,4.5]
y=[3.0,1.0,5.5]
u=[0,0,0]
v=[1,1,1]
fig, ax = subplots()
ax.quiver(x,y,u,v)
ax.scatter(x,y,color='k')
ax.axis([0,10,0,10])
Sign up to request clarification or add additional context in comments.

4 Comments

actually, there is a kwarg (pivot_point?) that controls where the arrow rotates around.
Is there anyway to change the size of a quiver without scaling it some property of the plot? I'd like bigger arrows than the default but in the documentation I only see relative scaling for the size of the arrows.
Sorry, not sure that i'm following you. the argument scale= will change the length of all of the arrows. width= will make them heavier, but not longer. Are neither of those what you're after?
I was misreading the documentation, yes, scale is what I was looking for. Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.