如何在一幅图中并排显示多幅图像? [英] How to display multiple images next to each other in one figure?

查看:118
本文介绍了如何在一幅图中并排显示多幅图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Julia,PyPlot和Images处理一些图片.因为不可能显示几十个图,所以我想像下面那样堆叠图像.

I'm using Julia, PyPlot and Images to handle some pictures. Because showing dozens of plots is out of the question I want to stack images like you can see below.

我已经将Array{Array{Float64, 2}, 1}中的图像数据标准化了.

I have the image-data in an Array{Array{Float64, 2}, 1} already normalized.

以下代码仅显示最后一个最小的图像.数组从最大图片到最小图片进行排序.

The following code shows only the last, smallest image. The array is sorted from the largest to the smallest picture.

for i = 1:size(P, 1)
  imshow(P[i], "gray", interpolation = "none")
end


我想要达到以下效果:


I want to achieve the following effect:

推荐答案

以下是使用Plots的解决方案:

Here's a solution with Plots:

using Plots, TestImages
img = testimage("cameraman")
p = plot(
    axis = nothing,
    layout = @layout([a [b [c [d;_]; _]; _]]),
    size = (800,400)
)

for i=1:4
    plot!(p[i], img, ratio=1)
end
p

这篇关于如何在一幅图中并排显示多幅图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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