Matplotlib.axes.Axes.barbs() in Python Last Updated : 28 Apr, 2025 Comments Improve Suggest changes Like Article Like Report Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text, Polygon, etc., and sets the coordinate system. And the instances of Axes supports callbacks through a callbacks attribute. matplotlib.axes.Axes.barbs() Function The Axes.barbs() function in axes module of matplotlib library is also used to plot a 2D field of barbs. Syntax: Axes.barbs(self, *args, data=None, **kw) Parameters: This method accept the following parameters that are described below: X, Y : These parameter are the x and y coordinates of the barb locations.U, V: These parameter are the x and y components of the barb shaft.C : This parameter contains the numeric data that defines the barb colors by colormapping via norm and cmap.length : This parameter is the length of the barb in points.pivot : This parameter is the part of the arrow that is anchored to the X, Y grid.barbcolor : This parameter is analogous to the edgecolor parameter for polygons, which can be used instead.flagcolor : This parameter is analogous to the facecolor parameter for polygons.sizes : This parameter is the dictionary of coefficients specifying the ratio of a given feature to the length of the barb.fill_empty : This parameter is used to fill the empty barbs with the flag color.barb_increments : This parameter is the dictionary of increments specifying values to associate with different parts of the barb.flip_barb : This parameter is the single value is applied to all barbs. Returns: This method returns the following: barbs : This return the Barbs. Note: This function works in Matplotlib version >= 3.1 Below examples illustrate the matplotlib.axes.Axes.barbs() function in matplotlib.axes: Example 1: Python3 # Implementation of matplotlib function import matplotlib.pyplot as plt import numpy as np x = np.linspace(0, 15, 5) fig1, axs1 = plt.subplots() axs1.barbs(x**3, x**3, x * 2, x * 2, x * 3, fill_empty = True) axs1.set_title('matplotlib.axes.Axes.barbs()\ Example', fontsize = 14, fontweight ='bold') plt.show() Output: Example 2: Python3 # Implementation of matplotlib function import matplotlib.pyplot as plt import numpy as np x = np.linspace(0, 15, 5) X, Y = np.meshgrid(x, x) U, V = X**2, Y**2 fig1, axs1 = plt.subplots() axs1.barbs(X, Y, U, V, U * 2, fill_empty = True) axs1.set_title('matplotlib.axes.Axes.barbs()\ Example', fontsize = 14, fontweight ='bold') plt.show() Output: Comment More infoAdvertise with us Next Article Matplotlib.axes.Axes.barbs() in Python S SHUBHAMSINGH10 Follow Improve Article Tags : Python Python-matplotlib Practice Tags : python Similar Reads Matplotlib.axes.Axes.bar() in Python Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text, Polygon, etc., and sets the coordinate system. And the instances of Axes supports callbacks through a callbacks attribute. 2 min read matplotlib.axes.Axes.barh() in Python Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text, Polygon, etc., and sets the coordinate system. And the instances of Axes supports callbacks through a callbacks attribute. 2 min read Matplotlib.axes.Axes.axis() in Python The Axes.axis() function in Matplotlib is used to get or set the properties of the x-axis and y-axis limits on a given Axes object. It provides an easy way to control the view limits, aspect ratio, and visibility of the axes in a plot. It's key feature include:Get the current axis limits as [xmin, x 2 min read Matplotlib.axes.Axes.bxp() in Python Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text, Polygon, etc., and sets the coordinate system. And the instances of Axes supports callbacks through a callbacks attribute. 3 min read Matplotlib.axes.Axes.errorbar() in Python Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text, Polygon, etc., and sets the coordinate system. And the instances of Axes supports callbacks through a callbacks attribute. 3 min read Like