MetPy - BarbPlot()
#
This class is designed to plot wind barbs from gridded data, most commonly model output from the GFS, NAM, or RAP.
BarbPlot()
#
Attribute |
Description |
---|---|
A float value that changes the length of the wind barbs. |
|
A string value that controls the color of the vectors. |
|
Xarray dataset that contains the field to be plotted. |
|
A boolean value to indicate whether the vector to be plotted is earth- or grid-relative. |
|
A tuple containing the two components of the vector field from the dataset in the form (east-west component, north-south component). |
|
The level of the field to be plotted. |
|
A string setting the pivot point of the vector. |
|
The desired units to plot the field in. |
|
Scale the field to be plotted by the value given. |
|
A tuple of integers to indicate the number of grid points to skip between plotting vectors. |
|
Set the valid time to be plotted as a datetime object. |
|
Supply a dictionary of valid Matplotlib keyword arguments to modify how the plot variable is drawn. |
Attribute Descriptions#
data#
This attribute must be set to the variable that contains the vector components to be plotted.
field#
This attribute is a list of the vector components to be plotted. For the typical meteorological case it would be the [‘u-component’, ‘v-component’].
time#
This attribute should be set to a datetime object, the same as for all other declarative classes.
skip#
Set this to an integer value to skip the plotting of wind barbs in the x and y directions to thin the number of wind barbs plotted.
barblength#
This attribute sets the length of the wind barbs. The default value is based on the font size.
color#
This attribute sets the color of the wind barbs, which can be any Matplotlib color. Default color is ‘black’.
earth_relative#
This attribute can be set to False if the vector components are grid relative (e.g., for NAM or NARR output)
pivot#
This attribute can be set to a string value about where the wind barb will pivot relative to the grid point. Possible values include ‘tip’ or ‘middle’. Default is ‘middle’.
mpl_args#
This attribute can be set to a dictionary containing keyword arguments (kwarg) valid for the various Matplotlib plotting functions to enhance how a plot is created. For example, you can use this attribute to set the
zorder
kwarg to alter what aspects of the your plot are on top of one another. NOTE: Setting the mpl_args trait will override any other trait that corresponds to a specific kwarg for the particular plot type (e.g., linecolor, linewidth).