how do i control the histograms generated by scatterhist?

7 visualizaciones (últimos 30 días)
Mike Wilson
Mike Wilson el 15 de Mzo. de 2017
Respondida: Adam Danz el 4 de Oct. de 2018
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().

Respuestas (1)

Adam Danz
Adam Danz el 4 de Oct. de 2018
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'

Categorías

Más información sobre Histograms en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by