更改matlab子图函数的默认大小调整属性

时间:2015-03-17 00:49:54

标签: matlab matlab-figure

我想用子图显示三个不同的数字。其中一个是原始的,另一个是x因子过采样。但是subplot调整过采样图像的大小以适应并将其显示为原始图像,即使其大小比原始图像大约x倍。如何更改我的代码以实际大小显示它们。 这是我的功能:

function zp_over=zp_oversample(zp,fs,N,f)
% zp is my 2d image, fs is sampling frequency, N is dimension of image, f is used for scaling the sampling factor
    % Over-Sampling and plot
    x=round(fs/f);
    zp_ov = zeros(N*x); 
    zp_ov(1:x:end,1:x:end)=zp; 
    figure,subplot(121), imshow(zp_ov); title (' over sampled');
subplot(122);imshow(zp); % Original image
title('Original');

1 个答案:

答案 0 :(得分:0)

您需要使用'职位' " subplot"的选项用于手动指定子图的位置和大小的功能。

例如:

figure;
subplot('Position', [0.35, 0.25, 0.5, 0.6]); % [left, bottom, width, height]
imshow(zp_ov);

subplot('Position', [0.35, 0.15, 0.5, 0.6]);
imshow(zp);

当然,坐标的确切值和尺寸取决于图像的大小。