Violinplot in Python using axes class of Matplotlib Last Updated : 21 Apr, 2020 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. #Sample Code Python3 # Implementation of matplotlib function import matplotlib.pyplot as plt import numpy as np # make an agg figure fig, ax = plt.subplots() ax.plot([1, 2, 3]) ax.set_title('matplotlib.axes.Axes function') fig.canvas.draw() plt.show() Output: Violinplot using Axes Class The Axes.violinplot() function in axes module of matplotlib library is used to make a violin plot for each column of dataset or each vector in sequence dataset. Syntax: Axes.violinplot(self, dataset, positions=None, vert=True, widths=0.5, showmeans=False, showextrema=True, showmedians=False, points=100, bw_method=None, *, data=None) Parameters: This method accept the following parameters that are described below: dataset: This parameter is a sequence of data. positions : This parameter is used to sets the positions of the violins. vert: This parameter is an optional parameter and contain boolean value. It makes the vertical violin plot if true.Otherwise horizontal. widths: This parameter is used to sets the width of each violin either with a scalar or a sequence. showmeans : This parameter contain boolean value. It is used to toggle rendering of the means. showextrema : This parameter contain boolean value. It is used to toggle rendering of the extrema. showmedians : This parameter contain boolean value. It is used to toggle rendering of the medians. points : This parameter is used to defines the number of points to evaluate each of the gaussian kernel density estimations at. Returns: This returns the following: result :This returns the dictionary which maps each component of the violinplot to a list of the matplotlib.collections instances. Below examples illustrate the matplotlib.axes.Axes.violinplot() function in matplotlib.axes: Example-1: Python3 # Implementation of matplotlib function import matplotlib.pyplot as plt import numpy as np # create test data np.random.seed(10**7) data = np.random.normal(0, 5, 100) fig, ax1 = plt.subplots() val = ax1.violinplot(data) ax1.set_title('matplotlib.axes.Axes.violinplot() Example') plt.show() Output: Example-2: Python3 # Implementation of matplotlib function import matplotlib.pyplot as plt import numpy as np # create test data np.random.seed(10**7) data = [sorted(np.random.normal(0, std, 100)) for std in range(1, 5)] fig, ax1 = plt.subplots() val = ax1.violinplot(data) ax1.set_ylabel('Result') ax1.set_xlabel('Domain Name') for i in val['bodies']: i.set_facecolor('green') i.set_alpha(1) ax1.set_title('matplotlib.axes.Axes.violinplot() Example') plt.show() Output: Comment More infoAdvertise with us Next Article Violinplot in Python using axes class of Matplotlib S SHUBHAMSINGH10 Follow Improve Article Tags : Python Python-matplotlib Practice Tags : python Similar Reads Matplotlib.axes.Axes.set_visible() 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. 1 min read matplotlib.axes.Axes.vlines() 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.stackplot() 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.set_axis_off() 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.pyplot.violinplot() in Python Matplotlib is an amazing visualization library in Python for 2D plots of arrays. Matplotlib is a multi-platform data visualization library built on NumPy arrays and designed to work with the broader SciPy stack. Matplotlib.pyplot.violinplot() The matplotlib.pyplot.violinplot() is as the name explain 4 min read Matplotlib.axes.Axes.set_axis_on() in Python Axes.set_axis_on() function in Matplotlib is used to turn on the axis lines, ticks, tick labels, and axis labels on a given Axes object. It is a simple way to make the axis visible if it was previously turned off. It's key features include:Turns on the axis lines, ticks, tick labels and axis labels. 2 min read Matplotlib.axes.Axes.set() in Python Axes.set() function in Matplotlib is used to set multiple Axes properties at once using keyword arguments (**kwargs). This is a convenient way to configure an Axes object with labels, limits, title and more, all in one call. It's key features include:Acts as a batch property setter for Axes.Uses key 2 min read Matplotlib.axes.Axes.quiver() 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.spy() 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.update() 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 Like