0
votes

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 - GWW

1 Answers

4
votes

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])