quiver linewidht problem

After some struggling I got my first plots with quiver working.
A simple plot is very simple, but a complicated one is very different.
Right now I have a 80x80 grid with multiple plots and I plan to go up.
For this I need full control of the arrow dimensions.

The only way I can get narrow arrow is by setting width:
plt.quiver(x,y,u,v, width=0.001, headwidth=3, scale=0.07,...
works fine for me. But I would like to set the linewidth per arrow.

On stackoverflow I found:
widths = np.linspace(0, 2, X.size)
plt.quiver(X, Y, cos(deg), sin(deg), linewidths=widths)

This did not work for me: the minimum width was too large.
I there a way to create narrow arrows with varying width?

Thanks

The point of the example was to show that one can assign an array of widths to a quiver plot. The array can have whatever values you want. Note that there is likely a subtle difference between “width” and “linewidth” as keyword arguments that you might want to experiment with.

Cheers!
Ben Root

···

On Aug 15, 2013 3:07 PM, “vwf” <vwf@…4426…> wrote:

After some struggling I got my first plots with quiver working.
A simple plot is very simple, but a complicated one is very different.
Right now I have a 80x80 grid with multiple plots and I plan to go up.
For this I need full control of the arrow dimensions.

The only way I can get narrow arrow is by setting width:
plt.quiver(x,y,u,v, width=0.001, headwidth=3, scale=0.07,…
works fine for me. But I would like to set the linewidth per arrow.

On stackoverflow I found:
widths = np.linspace(0, 2, X.size)
plt.quiver(X, Y, cos(deg), sin(deg), linewidths=widths)

This did not work for me: the minimum width was too large.
I there a way to create narrow arrows with varying width?

[...]

On stackoverflow I found:
widths = np.linspace(0, 2, X.size)
plt.quiver(X, Y, cos(deg), sin(deg), linewidths=widths)

[...]

I kind of found out how it works. quiver has width and linewidth.
width takes a scalar, linewidth can take a vector.
width sets the width of the shaft, linewidth sets the width of the edge...

How it works precisely I do not know yet, but this works for me:

plt.quiver(x_vector,y_vector,u_vector,v_vector,
   linewidth=w_vector, width=0.001, headwidth=3,
   color=mycolor, edgecolors=mycolor)

Cheers

···

On Thu, Aug 15, 2013 at 09:06:02PM +0200, vwf wrote: