yyaxis plot is not working properly
Show older comments
Hi,
I have this double axis plot. the right side plot consists of 14 plots itself and I want it to be shown with different colors (like the second plot below), but I get them all with the same weird brown color.
Left side plot:

right side plot:

combined:

and here's the code I'm using:
figure(9)
yyaxis left
for i=1:size(w_SSI_r,2)
y_mode{i} = ones(size(w_SSI_r{i},1),1)*(i+n_o_min-1);
xlim([0 35])%%%%%%%%%%
ylim([n_o_min n_o_max])
scatter(w_SSI_r{i}/(2*pi),y_mode{i},'MarkerFaceColor','r','MarkerEdgeColor','k')
hold on
grid on
y_mode_st0{i} = ones(size(w_SSI_r_st{i},1),1)*(i+n_o_min-1);
scatter(w_SSI_r_st{i}/(2*pi),y_mode_st0{i},'MarkerFaceColor','g','MarkerEdgeColor','k')
hold on
grid on
end
%legend('Unstable Poles in Frequency','Stable Poles in Frequency')
ylabel('Model Order');
xlabel('Frequency (Hz)');
%title('Stabilization Diagram');
yyaxis right
for i=1:NDOF
plot(f_FDD,pow2db(SV_FDD{i}),'DisplayName',['SV ',num2str(i)]);
xlabel('Frequency (Hz)');
ylabel('Singular Value (Power Spectral Density)(dB)');
title('Singular Values of the SD Matrix')
%xlim([0 round(max(Peaks_FDD_x))+1])
%legend
hold on
grid on
end
ax = gca;
ax.YAxis(1).Color = 'k';
ax.YAxis(2).Color = 'k';
Accepted Answer
More Answers (0)
Categories
Find more on Graphics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

