How to differentiate range color on frequency counts plot

2 次查看(过去 30 天)
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
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 个)

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

标签

尚未输入任何标签。

产品


版本

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by