how do i control the histograms generated by scatterhist?

7 ビュー (過去 30 日間)
Mike Wilson
Mike Wilson 2017 年 3 月 15 日
回答済み: Adam Danz 2018 年 10 月 4 日
In scatterhist() output, I want standard bar histogram (vs. 'kernel','on' line plots). Need to control histogram color. The scatterhist() docs only describe how to control the scatter plot marker colors, but not the histograms. The 'FaceColor' parameter that normally controls histogram color is not recognized by scatterhist().

回答 (1 件)

Adam Danz
Adam Danz 2018 年 10 月 4 日
The output to scatterhist() is a vector of handles to the scatter plot, the x histogram, and the y histogram axes, respectively. To change the face color of a bar plot, you just need to get the children of the histogram axis and then change the FaceColor. The example below changes the face color of the x axis histogram.
h = scatterhist(...);
h(2).Children(1).FaceColor = 'r'

カテゴリ

Help Center および File ExchangeHistograms についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by