matlab 双坐标折线图画法

matlab 双坐标折线图画法,第1张

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')

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/586358.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-12
下一篇 2022-04-12

发表评论

登录后才能评论

评论列表(0条)

保存