Fill color inside stair.
Hi all, I has two figures are plotted together. I want to fille colors within stairs but don’t know how to do.
figure;
h1 = histogram(data1, ‘BinWidth’, 0.1,’DisplayStyle’,’stairs’,’Normalization’, ‘probability’);
h1.EdgeColor = ‘k’;
h1.LineWidth = 2;
% h1.FaceAlpha = 0.2;
hold on;
h2 = histogram(data2, ‘BinWidth’, 0.1,’DisplayStyle’,’stairs’,’Normalization’, ‘probability’);
h2.EdgeColor = [0.772, 0.012, 0.314];
h2.LineWidth = 2;
% h2.FaceAlpha = 0.2; %
xlim([0 2]);
xticks(0:0.1:2);
% Customize font and frame properties
ax = gca;
ax.FontSize = 16;
ax.FontWeight = ‘bold’;
ax.LineWidth = 4;Hi all, I has two figures are plotted together. I want to fille colors within stairs but don’t know how to do.
figure;
h1 = histogram(data1, ‘BinWidth’, 0.1,’DisplayStyle’,’stairs’,’Normalization’, ‘probability’);
h1.EdgeColor = ‘k’;
h1.LineWidth = 2;
% h1.FaceAlpha = 0.2;
hold on;
h2 = histogram(data2, ‘BinWidth’, 0.1,’DisplayStyle’,’stairs’,’Normalization’, ‘probability’);
h2.EdgeColor = [0.772, 0.012, 0.314];
h2.LineWidth = 2;
% h2.FaceAlpha = 0.2; %
xlim([0 2]);
xticks(0:0.1:2);
% Customize font and frame properties
ax = gca;
ax.FontSize = 16;
ax.FontWeight = ‘bold’;
ax.LineWidth = 4; Hi all, I has two figures are plotted together. I want to fille colors within stairs but don’t know how to do.
figure;
h1 = histogram(data1, ‘BinWidth’, 0.1,’DisplayStyle’,’stairs’,’Normalization’, ‘probability’);
h1.EdgeColor = ‘k’;
h1.LineWidth = 2;
% h1.FaceAlpha = 0.2;
hold on;
h2 = histogram(data2, ‘BinWidth’, 0.1,’DisplayStyle’,’stairs’,’Normalization’, ‘probability’);
h2.EdgeColor = [0.772, 0.012, 0.314];
h2.LineWidth = 2;
% h2.FaceAlpha = 0.2; %
xlim([0 2]);
xticks(0:0.1:2);
% Customize font and frame properties
ax = gca;
ax.FontSize = 16;
ax.FontWeight = ‘bold’;
ax.LineWidth = 4; histogram MATLAB Answers — New Questions