Python中的 Matplotlib.axis.Axis.get_agg_filter()函数
Matplotlib是Python中的一个库,它是 NumPy 库的数值数学扩展。它是Python中用于二维数组图的惊人可视化库,用于处理更广泛的 SciPy 堆栈。
Matplotlib.axis.Axis.get_agg_filter()函数
matplotlib库的axis模块中的axis.get_agg_filter()函数用于获取用于agg filter的filter函数。
Syntax: Axis.get_agg_filter(self)
Parameters: This method does not accepts any parameter.
Return value: This method return the filter function to be used for agg filter.
以下示例说明了 matplotlib.axis 中的 matplotlib.axis.Axis.get_agg_filter()函数:
示例 1:
Python3
# Implementation of matplotlib function
from matplotlib.axis import Axis
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.artist import Artist
xx = np.random.rand(6, 5)
fig, axs = plt.subplots()
m = axs.pcolor(xx)
m.set_zorder(-2)
# use of get_agg_filter() method
val = Axis.get_agg_filter(axs)
axs.set_title("Value Return by get_agg_filter(): "
+ str(val))
fig.suptitle("""matplotlib.axis.Axis.get_agg_filter()
function Example\n""", fontweight ="bold")
plt.show()
Python3
# Implementation of matplotlib function
from matplotlib.axis import Axis
import numpy as np
import matplotlib.pyplot as plt
np.random.seed(10**7)
geeks = np.random.randn(40)
fig, axs = plt.subplots()
axs.acorr(geeks, usevlines=True, normed=True,
maxlags=30, lw=2)
axs.grid(True)
# use of get_agg_filter() method
val = Axis.get_agg_filter(axs)
axs.set_title("Value Return by get_agg_filter(): "
+ str(val))
fig.suptitle("""matplotlib.axis.Axis.get_agg_filter()
function Example\n""", fontweight ="bold")
plt.show()
输出:
示例 2:
Python3
# Implementation of matplotlib function
from matplotlib.axis import Axis
import numpy as np
import matplotlib.pyplot as plt
np.random.seed(10**7)
geeks = np.random.randn(40)
fig, axs = plt.subplots()
axs.acorr(geeks, usevlines=True, normed=True,
maxlags=30, lw=2)
axs.grid(True)
# use of get_agg_filter() method
val = Axis.get_agg_filter(axs)
axs.set_title("Value Return by get_agg_filter(): "
+ str(val))
fig.suptitle("""matplotlib.axis.Axis.get_agg_filter()
function Example\n""", fontweight ="bold")
plt.show()
输出: