Plot two histograms over one another
225 次查看(过去 30 天)
显示 更早的评论
Good evening,
I created a plot with histograms and corresponding pdfs. How can I plot the two histograms in each diagram such that the bars of the blue histogram aren't hidden behind the red ones? I found some related answers, in which the parameter facecolor was changed in order to introduce some opacity, but the result did not look satisfy to me regarding the ability to visually distinguish between the two histograms.
Thank you very much for your help!
0 个评论
回答(1 个)
David Hill
2022-8-2
编辑:David Hill
2022-8-2
Play with the color and alpha face to get something you like.
h1 = 0.05 * randn(1, 10000);
h2 = 0.20 * randn(1, 10000);
histogram(h1,'facealpha',.7,'edgecolor','none');
hold on;
histogram(h2,'facealpha',.3,'edgecolor','none');
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Histograms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!