将不同大小阵列的多个概率图(使用Matlab中的probplot)组合在一个图形中
我试图在同一个数字中获得多个概率图,但我无法做到这一点。你能在这方面提供你的帮助吗?这是我一直尝试做的一个示例代码将不同大小阵列的多个概率图(使用Matlab中的probplot)组合在一个图形中,matlab,Matlab,我试图在同一个数字中获得多个概率图,但我无法做到这一点。你能在这方面提供你的帮助吗?这是我一直尝试做的一个示例代码 cmap=colormap(jet(10)); close; for pp = 1:10 numelements = randi(10e4,1,1); data = rand(numelements,1)*2; figure(1); h1 = probplot('lognormal',data,'nor
cmap=colormap(jet(10));
close;
for pp = 1:10
numelements = randi(10e4,1,1);
data = rand(numelements,1)*2;
figure(1);
h1 = probplot('lognormal',data,'noref');
set(h1(1),'marker','+','color',cmap(pp,:),'markersize',10);
hold on;
end
按住不放在这里不起作用。您希望仅在第一次创建图形,并获取已创建轴的控制柄。随后,您需要告诉
probplot
使用相同的轴,例如
cmap=colormap(jet(10));
close;
h1 = nan(1,10); % Preallocate a vector to store all the line handles
for pp = 1:10
numelements = randi(10e4,1,1);
data = rand(numelements,1)*2;
if pp == 1
figure(1);
h1(pp) = probplot('lognormal',data,'noref');
ha = get(h1(pp),'Parent'); % get the handle to the created axis
else
h1(pp) = probplot(ha,'lognormal',data,'noref'); % reuse the same axis
end
set(h1(pp),'marker','+','color',cmap(pp,:),'markersize',10);
hold on; % This doesn't do anything and can be removed.
end
您希望仅在第一次创建地物,并获取所创建轴的控制柄。随后,您需要告诉
probplot
使用相同的轴,例如
cmap=colormap(jet(10));
close;
h1 = nan(1,10); % Preallocate a vector to store all the line handles
for pp = 1:10
numelements = randi(10e4,1,1);
data = rand(numelements,1)*2;
if pp == 1
figure(1);
h1(pp) = probplot('lognormal',data,'noref');
ha = get(h1(pp),'Parent'); % get the handle to the created axis
else
h1(pp) = probplot(ha,'lognormal',data,'noref'); % reuse the same axis
end
set(h1(pp),'marker','+','color',cmap(pp,:),'markersize',10);
hold on; % This doesn't do anything and can be removed.
end