How to differentiate range color on frequency counts plot
2 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2020-3-27
回答: MathWorks Support Team
2020-3-27
I would like to use a different color only for a certain range color especially around the median range of frequency counts.
采纳的回答
MathWorks Support Team
2020-3-27
Here is an example code to change the color to red for a certain range around the median of frequency counts.
x = [ 1 3.3 7 10 20 25 25 25 30 30 30 30 30 30 32 32 32 40 50 60];
mask = (22 < x) & (x < 33);
bin_edges = 1:1:60;
figure
histogram(x(~mask),bin_edges);
hold on
histogram(x(mask),bin_edges,'FaceColor','red');
hold off
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!