Matplotlib.axes.Axes.get_agg_filter() in Python
Last Updated :
30 Apr, 2020
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.get_agg_filter() Function
The Axes.get_agg_filter() function in axes module of matplotlib library is used to get the filter function to be used for agg filter.
Syntax: Axes.get_agg_filter(self)
Parameters: This method does not accepts any parameter.
Returns: This method return filter function to be used for agg filter.
Below examples illustrate the matplotlib.axes.Axes.get_agg_filter() function in matplotlib.axes:
Example 1:
import numpy as np
import matplotlib.pyplot as plt
xx = np.random.rand( 16 , 30 )
fig, ax = plt.subplots()
m = ax.pcolor(xx)
m.set_zorder( - 20 )
w = ax.get_agg_filter()
ax.set_title( "Value Return by get_agg_filter(): " + str (w))
fig.suptitle('matplotlib.axes.Axes.get_agg_filter() \
function Example', fontweight = "bold" )
plt.show()
|
Output:
Example 2:
import matplotlib.pyplot as plt
import numpy as np
np.random.seed( 10 * * 7 )
geeks = np.random.randn( 100 )
fig, ax = plt.subplots()
ax.acorr(geeks, usevlines = True , normed = True ,
maxlags = 80 , lw = 3 )
ax.grid( True )
w = ax.get_agg_filter()
ax.set_title( "Value Return by get_agg_filter(): " + str (w))
fig.suptitle('matplotlib.axes.Axes.get_agg_filter()\
function Example', fontweight = "bold" )
plt.show()
|
Output:
Share your thoughts in the comments
Please Login to comment...