我有 3 个对象(一张照片和 2 个图)放入一个图的子图中。它应该如下所示:
但正如人们注意到的那样,照片不应该是方形的,而是矩形的。我试图这样做(在这里找到Matlab: How to align the axes of subplots when one contains a colorbar?):
main=subplot(4,4,[5,6,7,9,10,11,13,14,15]) %photo
imagesc(im);
axis('image')
pion=subplot(4,4,[8,12,16]); %right plot (rotated)
view(90, 90)
plot(ypion,Ppion,'.k');
poz=subplot(4,4,1:3); %upper plot
plot(xpoz,Ppoz,'.k');
pos1=get(poz,'Position')
pos2=get(main,'Position')
pos3=get(pion,'Position')
pos1(3) = pos2(3); %width for the upper plot
set(poz,'Position',pos1)
pos3(4) = pos2(4); %height for the right plot
set(pion,'Position',pos3)
我得到的只是这样:
如何强制上部图的宽度作为照片本身(而不是照片子图)?设置子图的相等宽度不起作用,因为照片没有填满子图区域。