我有一个样本数据,其中包含有关人的体重的信息。我已根据性别拆分了这些数据,并按性别分组了箱形图:
我是通过以下代码实现的:
function boxplotByGender(malesData, femalesData, overallData,...
graphName, figureLocation)
% group the samples by gender
grouping = [ones(size(malesData));
2 * ones(size(femalesData));
3 * ones(size(overallData))];
boxGraph = figure('Name', 'Box Plot', 'NumberTitle', 'off');
boxplot([malesData; femalesData; overallData], grouping);
title(graphName);
set(gca, 'XTickLabel', {'Males', 'Females', 'Both'});
movegui(boxGraph, figureLocation)
end
现在我想对直方图做同样的事情。有什么想法可以解决吗?