How do i plot probability density plot with actual values?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
israt fatema
am 16 Nov. 2021
Kommentiert: Star Strider
am 16 Nov. 2021
How do i plot probability density curve with actual values as vertical line (as the picture attached)? And how to interpret that according to the distribution? Thank you.
2 Kommentare
Akzeptierte Antwort
Star Strider
am 16 Nov. 2021
If the distribution function is provided, along with the necessary parameters (none of which are prrovided here), this is straightforward —
x = linspace(1500, 2100);
mu = 1800;
sigma = 75;
npdf = normpdf(x, mu, sigma); % Use Normal Distribution To Demonstrate
figure
patch([x flip(x)], [zeros(size(npdf)) flip(npdf) ], 'b', 'FaceAlpha',0.25)
hold on
plot([1 1]*mu, [0 normpdf(mu, mu, sigma)], '-r', 'LineWidth',2)
hold off
Experiment with the intended distribution function and parameters.
.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!