关于python:`matplotlib.collections`中的`antialiased`是什么,如何为它设置参数?

What is `antialiased` in `matplotlib.collections` and how do you set the parameter for it?

matplotlib.collections中的antialiased是什么,如何为它设置参数?


antialiased关键字参数控制是否使用抗锯齿绘制特定的matplotlib艺术家(例如线条,多边形等)。

例如,请注意以下两个图中的差异:

1
2
3
4
5
6
7
8
9
10
11
import matplotlib.pyplot as plt

plt.subplot(1,2,1)
plt.plot(range(10), antialiased=False)
plt.title('Antialiasing Off')

plt.subplot(1,2,2)
plt.plot(range(10), antialiased=True)
plt.title('Antialiasing On')

plt.show()

enter image description here

非抗锯齿打印将更快,因此,如果要打印大量数据,则有必要将其关闭。