vect#
- cfplot.vect(u=None, v=None, x=None, y=None, scale=None, stride=None, pts=None, key_length=None, key_label=None, ptype=None, title=None, magmin=None, width=0.02, headwidth=3, headlength=5, headaxislength=4.5, pivot='middle', key_location=[0.95, -0.06], key_show=True, axes=True, xaxis=True, yaxis=True, xticks=None, xticklabels=None, yticks=None, yticklabels=None, xlabel=None, ylabel=None, ylog=False, color='k', zorder=3, titles=None, alpha=1.0)[source]#
Create a vector plot representing a two-dimensional vector field.
- Parameter breakdown (see below for full detail). The following parameters:
- specify the vector field and grid coordinates:
u,v,x,y
- control vector scaling, spacing and magnitude thresholds:
scale,stride,pts,magmin
- specify the plot type:
ptype
- configure arrow appearance and geometry:
width,headwidth,headlength,headaxislength`, ``pivot
- configure the vector key:
key_length,key_label,key_location,key_show
- configure axis visibility:
axes,xaxis,yaxis
- configure axis ticks, labels and scaling:
xticks,xticklabels,yticks,yticklabels,xlabel,ylabel,ylog
- configure general plot style:
title,color,zorder,titles,alpha
- Parameters:
u -- u-component of the vector field.
v -- v-component of the vector field.
x -- x-coordinates of the grid points for u and v.
y -- y-coordinates of the grid points for u and v.
scale -- Data units per arrow length unit. Smaller values produce larger vectors. Generally accepts a single value; if two values are supplied, the second scaling value applies to the v field.
stride -- Plot vectors at intervals of the specified number of grid points. Accepts one or two values, specifying the intervals along the x- and y-axes, respectively.
pts -- Use bilinear interpolation to interpolate vectors onto a new grid. Accepts one or two values. If one value is supplied, it is used for both the x- and y-axes.
magmin -- Minimum vector magnitude to plot. Vectors with magnitudes below this threshold are omitted.
ptype --
Plot type. Not required for CF fields. The available options are:
Value
Plot type
0
No specific plot type
1
Longitude–latitude
2
Latitude–height
3
Longitude–height
4
Latitude–time
5
Longitude–time
6
Rotated pole
width -- Arrow shaft width in arrow units. Defaults to
0.005times the width of the plot.headwidth -- Arrowhead width as a multiple of the shaft width. Defaults to
3.headlength -- Arrowhead length as a multiple of the shaft width. Defaults to
5.headaxislength -- Arrowhead length at the shaft intersection, as a multiple of the shaft width. Defaults to
4.5.pivot -- Position on the arrow that coincides with the grid point and about which the arrow rotates. Options are
'tail','middle', and'tip'. Defaults to'middle'.key_length -- Length of the vector key. Generally accepts a single value; if two values are supplied, the second scaling value applies to the v field.
key_label -- Label for the vector key. Generally accepts a single value; if two values are supplied, the second scaling value applies to the v field.
key_location -- Location of the vector key relative to the plot, in normalised coordinates. Defaults to
[0.9, -0.06].key_show -- If
True, draw the vector key. Defaults toTrue.axes -- If
True, display the x- and y-axes.xaxis -- If
True, display the x-axis.yaxis -- If
True, display the y-axis.xticks -- x-axis tick positions.
xticklabels -- x-axis tick labels.
yticks -- y-axis tick positions.
yticklabels -- y-axis tick labels.
xlabel -- x-axis label.
ylabel -- y-axis label.
ylog -- If
True, use a logarithmic y-axis.title -- Plot title. Defaults to
None.color -- Colour of the vectors. Defaults to
'k'(black).zorder -- Plotting order. Defaults to
3.titles -- If not
None, generate dimension and cell-methods titles for the plot.alpha -- Transparency setting. Defaults to
1.0(fully opaque).
- Returns:
None.