ineed help with legendinfo in plotyy

1 次查看(过去 30 天)
Abdulaziz
Abdulaziz 2013-9-24
Hi all,
Please,I have quesion regarding how to use legendinfo in plotyy. the legend has name that changes every loop (Case_Name{i}). The plotting part of the code, which shows only one of the plotted variables, is as following :
Case_Name={'unducted turbine','ducted turbine','multi-turbine system'};tt=1;
for j=1:n % j refers to every raw of matrix
for i=1:2 % i is matrices indices
figure(tt)
[AX,H1,H2] = plotyy(x_TSR_2{i}(j,:),y_P{i}(j,:),x_TSR{i}(j,:),y_Cp{i}(j,:), @(X,Y) plot(X,Y,plotStyle1{j}), @(X,Y) plot(X,Y,plotStyle2{j}));
set(get(AX(1),'Ylabel'),'String',' Power (W)'); set(get(AX(2),'Ylabel'),'String','Power Coefficient (Cp)'); xlabel('TSR');
set(H1,'MarkerFaceColor','k');
title({[' Generated Power and Power Coefficient vs. TSR '];['at Flow Speed of ',num2str(U{1}(j,1))]});
*legendInfo{i}=([Case_Name{i},': Power',Case_Name{i},': Cp']);set(gcf, 'Color', ones(1, 3));grid on;
hold on
end
legend(legendInfo)
hold off
tt=tt+1;
end*

回答(0 个)

类别

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