Plottong double y axis with data from two different data sets for right y axis. How to create legends for two different data sets in right Y axis for MATLAB 2015a?
조회 수: 1 (최근 30일)
이전 댓글 표시
[hAx,hLine1,hLine2] = plotyy(Altitude1,OcculationAz,[Altitude1',Altitude2'],[COSMIC',Digisonde']);
title('Variation of Electron Density and Occultation Azimuth with Altitude')
xlabel('Altitude (Km)')
ylabel(hAx(1),'Occultation Azimuth (deg)') % left y-axis
ylabel(hAx(2),'Electron Density (/m3)') % right y-axis
댓글 수: 2
madhan ravi
2018년 11월 27일
편집: madhan ravi
2018년 11월 27일
sorry for the inconvenience made @SGMukherjee
답변 (1개)
madhan ravi
2018년 11월 27일
Try this example:
yyaxis right
plot(x,y)
hold on
plot(x1,y1)
legend({'1st','2nd'},'Location',northeast)
yyaxis left
plot(x2,y2)
legend('3rd','Location',northwest)
참고 항목
카테고리
Help Center 및 File Exchange에서 Legend에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!