Line color in plotyy graph

18 次查看(过去 30 天)
Fotis
Fotis 2015-5-25
评论: Fotis 2015-5-25
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!

回答(1 个)

Walter Roberson
Walter Roberson 2015-5-25
[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 个评论
Walter Roberson
Walter Roberson 2015-5-25
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}'

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Two y-axis 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by