#2922: scale function for plot_vector_field
-------------------------+--------------------------------------------------
 Reporter:  schilly      |       Owner:  was       
     Type:  enhancement  |      Status:  new       
 Priority:  minor        |   Milestone:  sage-4.1.2
Component:  graphics     |    Keywords:            
 Reviewer:               |      Author:            
   Merged:               |  
-------------------------+--------------------------------------------------

Comment(by jason):

 So basically you want to give a function that gives the length of a
 vector?  That sounds reasonable.

 Since Sage is actually the thing that generates the vectors, and
 matplotlib just plots them, I think scaling the vectors in Sage to each
 have the length you want is the correct thing to do here, before passing
 them to matplotlib.

 plot_vector_field((-y,-x), (x,0,1),(y,0,1), norm=f)

 where f is a function defined to take f(v,w), where v is the vector, w is
 the point in space (as a vector).

 so your examples would be:

 f=lambda v,w: min(1,v.norm())

 f=lambda v,w: log(1+v.norm())

 We could then adjust the scale parameter of the quiver plot so that the
 arrows would plot exactly the length you wanted (I believe units='x',
 scale=1 should do the job).

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/2922#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to