% define mu and sigma mus = [5 6 7 9.5 10 10.5 13 14 17 17.5 18]'; sigma = 1; figure; hold on; axis([-sampleSize sampleSize 0 (max(probValues)+0.05)]); set(gca,'FontSize', 22,'FontName','Times New Roman'); % calculate actual pdf values allXs = [1:0.01:22]'; sumOfPdfs = zeros(size(allXs),1); for i = 1:size(mus,1) mu = mus(i); % xs = [(mu-4):0.01:(mu+4)]'; targetValues = zeros(size(allXs,1),1); for j=1:size(allXs,1) targetValues(j) = normpdf(allXs(j),mu,sigma); end sumOfPdfs = sumOfPdfs + targetValues; h1 = semilogy(allXs(((mu-4)*100+1):((mu+2)*100),1),targetValues(((mu-4)*100+1):((mu+2)*100),1)); h2 = plot(mu,0); markerSize = 6; set(h1, 'LineStyle', ':', 'LineWidth', 1.0, 'Color', 'Black'); % set(h1, 'Marker', 'o', 'MarkerFaceColor', [0.5 0.5 0.5], 'MarkerEdgeColor', [0 0 0], 'MarkerSize', markerSize); set(h2, 'LineStyle', '-', 'LineWidth', 1.0, 'Color',' Black'); set(h2, 'Marker', 'o', 'MarkerFaceColor', [0.5 0.5 0.5], 'MarkerEdgeColor', [0 0 0], 'MarkerSize', markerSize); end h3 = plot(allXs,sumOfPdfs); set(h3, 'LineStyle', '-', 'LineWidth', 1.0, 'Color',' Black'); set(h3,'LineWidth', 1.5, 'MarkerFaceColor', [1 1 1], 'MarkerEdgeColor', [0 0 0], 'MarkerSize', markerSize); hold off;