Matplotlib.artist.artist.get_agg_filter()
Python matplotlib库的artist模块中的get_agg_filter()方法 用于获取用于agg滤波的滤波函数。
语法:Artist.get_agg_filter(self)
参数:该方法不接受任何参数。
返回: 该方法返回用于 agg 过滤器的过滤器函数。
下面的例子说明了matplotlib.artist.artist.get_agg_filter()函数的使用:
示例1
# Implementation of matplotlib function
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.artist import Artist
xx = np.random.rand(16, 30)
fig, axs = plt.subplots()
m = axs.pcolor(xx)
m.set_zorder(-20)
# use of get_agg_filter() method
val = Artist.get_agg_filter(axs)
axs.set_title("Value Return by get_agg_filter(): "
+ str(val))
fig.suptitle('matplotlib.artist.Artist.get_agg_filter() \
function Example', fontweight="bold")
plt.show()
输出:
示例2
# Implementation of matplotlib function
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.artist import Artist
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 = Artist.get_agg_filter(axs)
axs.set_title("Value Return by get_agg_filter(): "
+ str(val))
fig.suptitle('matplotlib.artist.Artist.get_agg_filter() \
function Example', fontweight="bold")
plt.show()
输出: