ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 24 Jan 2014 04:39:41 -0600How to change linestyle of 2d vector field plotshttp://ask.sagemath.org/question/10956/how-to-change-linestyle-of-2d-vector-field-plots/How can I change the linewidth and the arrow tips of a 2d vector field plot?Thu, 23 Jan 2014 07:41:24 -0600http://ask.sagemath.org/question/10956/how-to-change-linestyle-of-2d-vector-field-plots/Answer by ppurka for <p>How can I change the linewidth and the arrow tips of a 2d vector field plot?</p>
http://ask.sagemath.org/question/10956/how-to-change-linestyle-of-2d-vector-field-plots/?answer=15962#post-id-15962Look at the output below. You can see that it is possible to change the arrow style but not the linewidths.
sage: p = plot_vector_field((x, y), (x, -2, 2), (y, -2, 2), headlength=10, headwidth=10)
sage: p._objects
[PlotField defined by a 20 x 20 vector grid]
sage: P = p._objects[0]
sage: P._allowed_options()
{'color': 'The color of the arrows',
'headaxislength': 'head length at shaft intersection, default is 4.5',
'headlength': 'head length as multiple of shaft width, default is 5',
'headwidth': 'Head width as multiple of shaft width, default is 3',
'pivot': 'Where the arrow should be placed in relation to the point (tail, middle, tip)',
'plot_points': 'How many points to use for plotting precision',
'zorder': 'The layer level in which to draw'}
I must agree that the [documentation of vector field](http://www.sagemath.org/doc/reference/plotting/sage/plot/plot_field.html) is pretty poor. And the function definitely needs to add the functionality for linewidth, and possible other things. The `plot_vector_field` calls matplotlib's [quiver function](http://matplotlib.org/examples/pylab_examples/quiver_demo.html) which has support for linewidth.
I just opened ticket 15724 and ticket 15725 to address these issues.Fri, 24 Jan 2014 04:39:41 -0600http://ask.sagemath.org/question/10956/how-to-change-linestyle-of-2d-vector-field-plots/?answer=15962#post-id-15962