%%各时段电量需求 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')
matlab 画折线图,matlab 双坐标折线图画法
最新推荐文章于 2023-04-20 15:49:21 发布