gpt4 book ai didi

matplotlib - 如何在一个图中并排显示多个图像?

转载 作者:行者123 更新时间:2023-12-04 01:04:02 24 4
gpt4 key购买 nike

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

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


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

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

我想达到如下效果:

Stacked images

最佳答案

这是一个带有 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

enter image description here

关于matplotlib - 如何在一个图中并排显示多个图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40836882/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com