matlab 雙坐標折線圖畫法



%%各時段電量需求
clc
close all
clear all
cost_gd = [2200 1800 3800 4600];
cost_bj = [2.7 2.2 1.8 3.6];
cost_qd = [4000 1500 2500 1000];
fontsize = 24;
axes('Parent',figure,'FontSize',fontsize);
t=1:length(cost_gd);
yyaxis left ;
ylim([0,5000]);
xlim = ([-2,6]);
plot(t,cost_gd,'ro-',t,cost_qd,'b*-','LineWidth',2)
ylabel('固定成本/啟動成本');
tick = {'型號1' ''  '型號2' '' '型號3' '' '型號4'};
set(gca,'XTickLabel',tick)
yyaxis right;
ylim([0,5]);
xlim = ([-1,5]);
plot(t,cost_bj,'gx-','LineWidth',2);
ylabel('邊際成本');
title('各型號發電機成本對比')
xlabel('各型號發電機')
legend('固定成本(單位:元/小時)','啟動成本(單位:元/次)','邊際成本(單位:元/小時)')
legend('Location','NorthWest')


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM