Azzera filtri
Azzera filtri

Line color in plotyy graph

39 visualizzazioni (ultimi 30 giorni)
Fotis
Fotis il 25 Mag 2015
Commentato: Fotis il 25 Mag 2015
Hi all,
I use this code to plot a yy graph.
ratio=((Power./1000)-1240)./(Power./1000);
plotyy(P.e_hp./100,Power./1000,P.e_hp./100,ratio,'plot','plot');
Power and P.e_hp are 1*53 vectors. I want to give color to the plotted lines but at the same time set the color of all axes black. Any ideas how to do it? I am looking it up without much help. Thanks in advance!

Risposte (1)

Walter Roberson
Walter Roberson il 25 Mag 2015
[hAx,hLine1,hLine2] = plotyy(P.e_hp./100,Power./1000,P.e_hp./100,ratio);
set(hLine1, 'Color', 'r');
set(hLine2, 'Color', 'b');
set(hAx, 'Color', 'k');
  2 Commenti
Walter Roberson
Walter Roberson il 25 Mag 2015
Note: the Color property of axes is the backplane color. If you want to set the color of the box, set XColor and YColor. If you want to set the color of the tick labels, then leave the TickLabelInterpreter property set to its default 'tex' and modify the XTickLabel and YTickLabel properties so that each string is of the form '\color{NAME}TICKTEXT' or '\color[rgb]{R,G,B}TICKTEXT' such as '\color{magenta}1.5x10^{4}'
Fotis
Fotis il 25 Mag 2015
Thanks!

Accedi per commentare.

Categorie

Scopri di più su Two y-axis in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by