How can I color an angle histogram created by the ROSE function in MATLAB?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I use the ROSE function to create an angle histogram:
theta = 2*pi*rand(1,50);
rose(theta);
In the resulting plot, the angled bars are not colored. I would like to fill the histogram with a certain color.
Akzeptierte Antwort
MathWorks Support Team
am 27 Jun. 2009
You can use the FILL command to color the angle histogram. The following example the fill color is red:
theta = 2*pi*rand(1,50);
[tout, rout] = rose(theta);
polar(tout, rout);
[xout, yout] = pol2cart(tout, rout);
set(gca, 'nextplot', 'add');
fill(xout, yout, 'r');
You can substitute any colorspec or color triplet for 'r'.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Descriptive Statistics and Visualization finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!