how do i control the histograms generated by scatterhist?

8 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Histograms 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by