Re: [Matplotlib-users] quiver question From: Alan G Isaac - 2009-11-29 20:29:04 ```On 11/29/2009 12:10 PM, Eric Firing wrote: > quiver(x[:-1], y[:-1], u, v, angles='xy', units='x', scale=1) > That works perfectly when there is change only in x, but not when both coordinates change. It seems like I want a `units='xy'` option, to get the right scaling along each axis, but it does not exist. However I can "fake it" pretty well by plotting first with lines and then on top of that doing quiver(x[1:],y[1:],u,v, pivot='tip', angles='xy') Thanks, Alan ```
 [Matplotlib-users] quiver question From: Alan G Isaac - 2009-11-29 15:11:02 ```I have a collection of 2d points xy. Instead of simply plotting the points, I'd like to plot a collection of arrows that goes from each point to the next. The "from" is easy of course; the "to" is the problem. I think I should be able to use quiver, but I'm not getting it quite right. E.g., x,y = zip(*xy) u,v = np.diff(x), np.diff(y) quiver(x[:-1], y[:-1], u, v, angles='xy') looks like a start but does not get there. I guessed that `scale=1` would complete the picture, but that just showed that I misunderstood `scale`. Suggestions? Alan Isaac ```
 Re: [Matplotlib-users] quiver question From: Eric Firing - 2009-11-29 17:10:26 ```Alan G Isaac wrote: > I have a collection of 2d points xy. > Instead of simply plotting the points, > I'd like to plot a collection of arrows > that goes from each point to the next. > The "from" is easy of course; > the "to" is the problem. > > I think I should be able to use quiver, > but I'm not getting it quite right. > E.g., > > x,y = zip(*xy) > u,v = np.diff(x), np.diff(y) > quiver(x[:-1], y[:-1], u, v, angles='xy') > > looks like a start but does not get there. > I guessed that `scale=1` would complete > the picture, but that just showed that I > misunderstood `scale`. > > Suggestions? Try this: quiver(x[:-1], y[:-1], u, v, angles='xy', units='x', scale=1) Eric ```
 Re: [Matplotlib-users] quiver question From: Alan G Isaac - 2009-11-29 20:29:04 ```On 11/29/2009 12:10 PM, Eric Firing wrote: > quiver(x[:-1], y[:-1], u, v, angles='xy', units='x', scale=1) > That works perfectly when there is change only in x, but not when both coordinates change. It seems like I want a `units='xy'` option, to get the right scaling along each axis, but it does not exist. However I can "fake it" pretty well by plotting first with lines and then on top of that doing quiver(x[1:],y[1:],u,v, pivot='tip', angles='xy') Thanks, Alan ```
 Re: [Matplotlib-users] quiver question From: Eric Firing - 2009-11-30 21:42:28 ```Alan G Isaac wrote: > On 11/29/2009 11:44 PM, Eric Firing wrote: >> in svn there is such an option, but it still doesn't seem to >> do exactly the right thing in this case > > OK, looking forward ... Try svn 7993 with "scale_units='xy', angles='xy', scale=1". Having a separate "scale_units" kwarg is in the trunk only. Eric ```
 Re: [Matplotlib-users] quiver question From: Eric Firing - 2009-11-30 04:45:01 ```Alan G Isaac wrote: > On 11/29/2009 12:10 PM, Eric Firing wrote: >> quiver(x[:-1], y[:-1], u, v, angles='xy', units='x', scale=1) >> > > That works perfectly when there is change only in x, > but not when both coordinates change. It seems like > I want a `units='xy'` option, to get the right > scaling along each axis, but it does not exist. Actually, in svn there is such an option, but it still doesn't seem to do exactly the right thing in this case. I haven't yet figured out why not. Eric > > However I can "fake it" pretty well by plotting > first with lines and then on top of that doing > quiver(x[1:],y[1:],u,v, pivot='tip', angles='xy') > > Thanks, > Alan ```
 Re: [Matplotlib-users] quiver question From: Alan G Isaac - 2009-11-30 05:12:14 ```On 11/29/2009 11:44 PM, Eric Firing wrote: > in svn there is such an option, but it still doesn't seem to > do exactly the right thing in this case OK, looking forward ... Thanks, Alan ```