【发布时间】:2016-07-25 09:20:02
【问题描述】:
在 matplotlib 中,当使用imshow() 时,默认行为是使用双线性插值显示图像。
我知道我可以通过调用 imshow(...,interpolation='none') 来明确更改此设置。但这对于许多拨打imshow 的电话来说很麻烦。
如何将默认行为更改为例如interpolation='none'?
【问题讨论】:
标签: python matplotlib imshow
在 matplotlib 中,当使用imshow() 时,默认行为是使用双线性插值显示图像。
我知道我可以通过调用 imshow(...,interpolation='none') 来明确更改此设置。但这对于许多拨打imshow 的电话来说很麻烦。
如何将默认行为更改为例如interpolation='none'?
【问题讨论】:
标签: python matplotlib imshow
找到了!
显然,有一个字典控制 matplotlib 的许多方面,称为
rcParams。直接来自the matplotlib docs:
import matplotlib as mpl
mpl.rcParams['lines.linewidth'] = 2
mpl.rcParams['lines.color'] = 'r'
就我而言,我必须设置:
rcParams['image.interpolation']='none'
【讨论】: