ineed help with legendinfo in plotyy
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (0)
Vedere anche
Categorie
Scopri di più su Two y-axis in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!