필터 지우기
필터 지우기

Histogram Colors Not True

조회 수: 7 (최근 30일)
J Shaw
J Shaw 2015년 5월 7일
댓글: Sara Cecilia Abecia Hernanz 2021년 10월 20일
I have a histogram, and I am trying to change its color using:
set(get(gca,'child'),'FaceColor','k')
However, when I do this, the color comes out more of a gray than black. The same thing happens with red--it comes out more of a pink! Any ideas?

채택된 답변

Kelly Kearney
Kelly Kearney 2015년 5월 7일
What is the FaceAlpha value of the child patch objects? It sounds as though it may be set to a value less than 1, which would lead to semi-transparent patches, hence the lighter look.
  댓글 수: 1
Sara Cecilia Abecia Hernanz
Sara Cecilia Abecia Hernanz 2021년 10월 20일
I might be a llitle too late but this is the only thread I see about the topic. I had the same problem and changing the 'FaceAlpha' value to 1 seems to have solved it, as @Kelly suggested (by default the value is set to 0.6).
Thank you!
Also the documentation on Histogram Properties might be checked here:
https://www.mathworks.com/help/matlab/ref/matlab.graphics.chart.primitive.histogram-properties.html

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
Image Analyst 2015년 5월 7일
Plot it with bar and change the color there
bar(bins, counts, 'FaceColor', 'b', 'BarWidth', 1);

카테고리

Help CenterFile Exchange에서 Histograms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by