matlab绘制三组xy的累积式直方图代码
时间: 2023-03-27 19:03:52 浏览: 88
ZhiFangTu.rar_matlab画直方图
以下是 Matlab 绘制三组 xy 的累积式直方图的代码:
x1 = randn(100,1);
y1 = randn(100,1);
x2 = randn(100,1)+2;
y2 = randn(100,1)+2;
x3 = randn(100,1)-2;
y3 = randn(100,1)-2;
figure;
hold on;
histogram2(x1,y1,'DisplayStyle','stairs','Normalization','cdf','LineWidth',2);
histogram2(x2,y2,'DisplayStyle','stairs','Normalization','cdf','LineWidth',2);
histogram2(x3,y3,'DisplayStyle','stairs','Normalization','cdf','LineWidth',2);
xlabel('X');
ylabel('Y');
legend('Group 1','Group 2','Group 3');
title('Cumulative Histogram of Three Groups of XY Data');
阅读全文