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

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

问题描述

我正在使用 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天全站免登陆