フィルターのクリア

Change Secod Axis Color And Tick Label Colors

131 ビュー (過去 30 日間)
Stephen Molnar
Stephen Molnar 2012 年 5 月 31 日
I have a snippet of code that uses plotyy
figure;
x = 1:size(X1,1);
xlim([1,max(x)]);
y1 = env_data_values(1:m,12);
y2 = I_spec_max;
[haxes,hline1,hline2] = plotyy(x,y1,x,y2,'plot');
axes(haxes(1))
ylabel('Temperature ({^o}C)','Color','b')
axes(haxes(2))
ylabel('I_m_a_x','Color','r')
set(hline2,'Color','r')
set(hline1,'Color','b')
title('Dev OA TE Cooler vs. I_m_a_x');
hleg1=legend('I_m_a_x');
set(hleg1,'Location','NorthEast', 'Color', 'none', 'Box', 'off');
The right y-axis, tick marks and tick mark labels are green. I can't figure out how to change the color to red to match the color of the lie plot.
I've searched Answers, but haven't found anything that I can understand.
Thanks in advance.

回答 (1 件)

Geoff
Geoff 2012 年 6 月 1 日
set(haxes(2), 'YColor', 'r');

カテゴリ

Help Center および File ExchangeTwo y-axis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by