Hi,
I am tring to figure out how to use the c argument to the quiver2 function.
I want to be able to color my arrows proportionally to their size.
I have tried this and it doesn’ t work as I imagined:
c = sqrt((array(u)-array(x))**2+(array(v)-array(y))**2)
quiver2(x,y,u,v,c)
the docstring on quiver2 is not clear on how c works, any help will be appreciated.
thanks,
···
–
Flávio Codeço Coelho
registered Linux user # 386432
“Laws are like sausages. It’s better not to see them being made.”
Otto von Bismark
Flavio Coelho wrote:
Hi,
I am tring to figure out how to use the c argument to the quiver2 function.
I want to be able to color my arrows proportionally to their size.
I have tried this and it doesn' t work as I imagined:
c = sqrt((array(u)-array(x))**2+(array(v)-array(y))**2)
The length of the arrow is proportional to sqrt(u**2 + v**2),
not to sqrt((u-x)**2 + (v-y)**2).
Is the reason you are not getting what you expect?
Eric
···
quiver2(x,y,u,v,c)
the docstring on quiver2 is not clear on how c works, any help will be appreciated.
Thanks Eric,
in fact it depends on if x,y are 0 or not. But I got it to work it now.
thanks,
Flávio
···
On 8/22/06, Eric Firing < efiring@…202…> wrote:
Flavio Coelho wrote:
Hi,
I am tring to figure out how to use the c argument to the quiver2 function.
I want to be able to color my arrows proportionally to their size.
I have tried this and it doesn’ t work as I imagined:
c = sqrt((array(u)-array(x))**2+(array(v)-array(y))**2)
The length of the arrow is proportional to sqrt(u2 + v2),
not to sqrt((u-x)**2 + (v-y)**2).
Is the reason you are not getting what you expect?
Eric
quiver2(x,y,u,v,c)
the docstring on quiver2 is not clear on how c works, any help will be
appreciated.
–
Flávio Codeço Coelho
registered Linux user # 386432
“Laws are like sausages. It’s better not to see them being made.”
Otto von Bismark
Flavio,
One more point: please do not use quiver2 directly. Instead, use quiver, which will call quiver2 unless it finds a keyword argument that exists only in the old version of quiver. The name quiver2 is used only temporarily to provide this compatibility, which will be removed in a future release.
Eric
Flavio Coelho wrote:
···
Hi,
I am tring to figure out how to use the c argument to the quiver2 function.