Change color of x axis and y axis barplot
Mostra commenti meno recenti
I want a barplot with two different y axis in different colors. The x axis should be in black.
Here is my code:
a=[rand(3,1)*100 zeros(3,1) ];
b=[zeros(3,1) rand(3,1)*5 ];
[AX,H1,H2] =plotyy([1:3],a, [1:3],b, 'bar', 'bar');
set(H1,'FaceColor','r') % a
set(H2,'FaceColor','b') % b
set(AX,{'ycolor'},{'r';'b'})
The problem is the x axis whisch should be in black.
I tried
set(AX,{'ycolor'},{'r';'b'}, {'xcolor'}, {'k'})
but the x axis colour did not change.
Does anybody know how to fix this problem?

Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Grid Lines, Tick Values, and Labels in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
