从给定多边形内的数据3D矩阵制作多个图

问题描述 投票:0回答:1

我有一个420 * 940 * 12矩阵(每个网格的值范围从0到100)我想在多边形S内绘制数据,lat(420 * 1)和lon(940 * 1)作为网格参考。

我们可以创建一个只有点的单个图,没有它的值(0-100):

S = shaperead(polygon);
N = length(S);
[X,Y] = meshgrid(lon,lat);
data= test;
for k = 1:N
    idx =  insidepoly(X(:),Y(:),S(k).X,S(k).Y);
    hold on
    plot(X(idx), Y(idx), 'r*')
end

但是这个数字只显示了点而不是它的值(0-100)并且输出是这样的:

但是我必须将多个数据一起绘制,比如说一年中的12个月,那么如何根据值(0-100)一起制作12个图,如下图所示?

enter image description here

matlab plot matlab-figure
1个回答
0
投票

一种可能的解决方案是使用蒙太奇,请看这里:

img = imread('peppers.png');
img = repmat(img,1,1,1,6);
montage(img)
© www.soinside.com 2019 - 2024. All rights reserved.