我正在使用封装在 skimage 中的绘图函数来绘制两组关键点之间的匹配。特别是,我正在使用这个函数:plot_matches
这很好用,但是绘制的线条很粗。我知道使用 matplotlib 可以使用绘图中的 linewidth
参数控制线宽。在这种情况下,绘图函数由链接中的 plot_matches
函数调用。
顺便,我是这样使用的:
import matplotlib.pyplot as plt
from skimage.feature import plot_matches
fig, ax = plt.subplots()
plt.gray()
plot_matches(ax, img1, img2, k1[:, [0, 1]],
k2[:, [0, 1]], matches, only_matches=True)
ax.axis('off')
plt.show()
有没有办法控制这种用法中的线宽属性?
最佳答案
另一种可能的解决方案是获取 line2D 对象的列表,然后使用 set_linewidth()
更改线宽
lines = ax.lines
for line in lines:
line.set_linewidth(2)
关于python - matplotlib 更改现有 skimage 图上的线宽,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48547230/