MATLAB Answers

How to transparent histogram or mix colors of different histograms

116 ビュー (過去 30 日間)
Mustafa Vural
Mustafa Vural 2020 年 9 月 24 日
コメント済み: Adam Danz 2020 年 9 月 24 日
I have a problem with my histogram. Even if I try the sensitive of the red histogram to 0, Its absolutely red. The problem is, the number of my bars are really REALLY high.
How can I see the blue bars OR mix them in the middle. So when blue and red come together, they get some different colors.
fplot(pdf2p,[0,10], 'LineWidth',2, "Color", 'b')
hold on
fplot(pdf3p,[0,10], 'LineWidth',2, "Color", 'r', 'LineStyle', '--')
hold on
h1= histogram(data2p(:,v_b, v_T),'Normalization','pdf');
h2= histogram(data3p(:,v_b, v_T),'Normalization','pdf');
set(h1,'FaceColor',[0 0 1],'EdgeColor',[0 0 1],'facealpha',0.7);
set(h2,'FaceColor',[1 0 0],'EdgeColor',[1 0 0],'facealpha',0);

  0 件のコメント

サインインしてコメントする。

採用された回答

Adam Danz
Adam Danz 2020 年 9 月 24 日
編集済み: Adam Danz 2020 年 9 月 24 日
Set the FaceAlpha and EdgeAlpha values to something like 0.5.
The reason you're not seeing any transparency even though you're setting the FacelAlpha to something less than 1 is because the edges are dense and not transparent.

  2 件のコメント

Mustafa Vural
Mustafa Vural 2020 年 9 月 24 日
It works, thank you very much!
Adam Danz
Adam Danz 2020 年 9 月 24 日
Glad I could help.

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by