I have two vectors, one is ~10x larger than the other. I'm trying to represent both on a probability distribution function histogram where each vector has a different color, but the PDF applies to the entire dataset...
If I use histogram(data), the output is in counts which is appropriately proportional. However, if I specify PDF normalization as below, both are scaled to their individual normalizations.
How can I plot all data as one single PDF, but maintain the colors?
Here is mock code:
% sample data
dist1 = normrnd(-2,1, [1, 750]); % Inthws vector
dist2 = normrnd(2,1, [1, 12000]); % Pchws vector
% Create histogram with dist1 in red
hold on
histogram(dist1, 'Normalization', 'pdf')
% Create histogram with dist2 in blue
histogram(dist2, 'Normalization', 'pdf')
% Add legend and axis labels
legend('dist1', 'dist2')
xlabel('Data values')
ylabel('Frequency or count')
hold off