什么是`matplotlib.collections`中的`antialiased`,你如何为它设置参数? [英] What is `antialiased` in `matplotlib.collections` and how do you set the parameter for it?

查看:1236
本文介绍了什么是`matplotlib.collections`中的`antialiased`,你如何为它设置参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

推荐答案

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

The antialiased keyword argument controls whether or not a particular matplotlib artist (e.g. line, polygon, etc) is drawn with antialising or not.

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

As an example, notice the difference in the two plots below:

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()

非抗锯齿的绘图会更快,所以如果你正在绘制一个ge数据量,关闭它是值得的。

Non-antialiased plotting will be faster, so if you're plotting a large amount of data, it can be worthwhile to turn it off.

这篇关于什么是`matplotlib.collections`中的`antialiased`,你如何为它设置参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆