相关疑难解决方法(0)

使用plt.imshow()显示多个图像

如何使用matlib函数plt.imshow(图像)显示多个图像?

例如我的代码如下:

for file in images:
    process(file)

def process(filename):
    image = mpimg.imread(filename)
    <something gets done here>
    plt.imshow(image)
Run Code Online (Sandbox Code Playgroud)

我的结果显示只有最后处理的图像才能有效地覆盖其他图像

python matplotlib

11
推荐指数
3
解决办法
2万
查看次数

单个窗口中的多个数字

我想创建一个功能,在一个窗口中在屏幕上绘制一组图形.到现在为止我写这段代码:

import pylab as pl

def plot_figures(figures):
    """Plot a dictionary of figures.

    Parameters
    ----------
    figures : <title, figure> dictionary

    """
    for title in figures:
        pl.figure()
        pl.imshow(figures[title])
        pl.gray()
        pl.title(title)
        pl.axis('off')
Run Code Online (Sandbox Code Playgroud)

它工作得很好,但我想有选择在单个窗口中绘制所有数字.而这段代码没有.我读了一些关于subplot的东西,但看起来很棘手.

python image matplotlib subplot

7
推荐指数
1
解决办法
1万
查看次数

标签 统计

matplotlib ×2

python ×2

image ×1

subplot ×1