Borrar filtros
Borrar filtros

ineed help with legendinfo in plotyy

1 visualización (últimos 30 días)
Abdulaziz
Abdulaziz el 24 de Sept. de 2013
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*

Respuestas (0)

Categorías

Más información sobre Two y-axis en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by