三维横向柱状图(`bar3h`)
三维横向柱状图(bar3h)
02_柱与散点 5 张 MATLAB R2023b 100 mm 宽 @ 300 dpi
这个方法适合什么
bar3 的横向版本,类别轴在竖直方向。适合:设备×年份的容量或故障次数,标签较长时比 bar3 易读。
电气场景
1 设备年份新增数量三维横向柱

2 变电站年份增容三维横向柱

3 指标年份改造投资三维横向柱

4 馈线年份供电量三维横向柱

5 设备年份检修工时三维横向柱

代码
脚本 p2_bar_scatter.m 中对应 bar3h 的一段,SEL 用于选择只跑某几个方法。
if any(SEL==4)
% ---- 4.1 设备 × 年份 新增容量 ----
dv = {'主变压器','开关柜','环网柜','电缆','无功装置'};
yv = {'2022 年','2023 年','2024 年'};
Y = [42.5 51.2 63.8
126 148 172
38 46 54
186 214 248
24 31 38];
f = ml_fig(PP,100,80);
ax = axes('Parent',f,'Position',[0.210 0.215 0.720 0.730]);
hb = bar3h(ax,Y,0.55);
for k = 1:3, set(hb(k),'FaceColor',C(k,:),'EdgeColor',[0.25 0.25 0.25],'LineWidth',0.2); end
set(ax,'YTick',1:5,'YTickLabel',ml_tx(dv),'ZTick',1:3,'ZTickLabel',ml_tx(yv));
ylabel(ml_tx('设备类型'));
xlabel(ml_tx('新增数量 / 台(套)'));
zlabel(ml_tx('年份'));
ylim(ax,[0.4 5.6]); xlim(ax,[0 300]); zlim(ax,[0.4 3.6]); set(ax,'XTick',0:100:300);
view(ax,-40,28); grid(ax,'on'); set(ax,'PlotBoxAspectRatio',[1 2.6 1.0]);
lg = legend(ax,hb,ml_tx(yv),'Location','northeast');
ml_style_legend(lg,PP);
save_png(f,FIGD,'设备年份新增数量三维横向柱');
% ---- 4.2 变电站 × 年份 增容改造 ----
sv = {'城东站','城西站','工业站','新区站'};
yv = {'2022 年','2023 年','2024 年'};
Y = [ 8.0 12.0 16.0
6.0 8.0 10.0
20.0 25.0 31.5
4.0 6.0 8.0];
f = ml_fig(PP,100,80);
ax = axes('Parent',f,'Position',[0.210 0.215 0.720 0.730]);
hb = bar3h(ax,Y,0.55);
for k = 1:3, set(hb(k),'FaceColor',C(k+1,:),'EdgeColor',[0.25 0.25 0.25],'LineWidth',0.2); end
set(ax,'YTick',1:4,'YTickLabel',ml_tx(sv),'ZTick',1:3,'ZTickLabel',ml_tx(yv));
ylabel(ml_tx('变电站'));
xlabel(ml_tx('变电容量 / MV·A'));
zlabel(ml_tx('年份'));
ylim(ax,[0.4 4.6]); xlim(ax,[0 42]); zlim(ax,[0.4 3.6]); set(ax,'XTick',0:10:40);
view(ax,-40,28); grid(ax,'on'); set(ax,'PlotBoxAspectRatio',[1 2.6 1.0]);
lg = legend(ax,hb,ml_tx(yv),'Location','northeast');
ml_style_legend(lg,PP);
save_png(f,FIGD,'变电站年份增容三维横向柱');
% ---- 4.3 指标 × 年份 评分 ----
iv = {'可靠性','电压质量','线损治理','谐波治理','自动化'};
yv = {'2022 年','2023 年','2024 年'};
Y = [320 150 90
180 210 260
260 180 120
90 140 210
480 620 860];
f = ml_fig(PP,100,80);
ax = axes('Parent',f,'Position',[0.210 0.215 0.720 0.730]);
hb = bar3h(ax,Y,0.55);
for k = 1:3, set(hb(k),'FaceColor',C(k,:),'EdgeColor',[0.25 0.25 0.25],'LineWidth',0.2); end
set(ax,'YTick',1:5,'YTickLabel',ml_tx(iv),'ZTick',1:3,'ZTickLabel',ml_tx(yv));
ylabel(ml_tx('评价指标'));
xlabel(ml_tx('改造投资 / 万元'));
zlabel(ml_tx('年份'));
ylim(ax,[0.4 5.6]); xlim(ax,[0 980]); zlim(ax,[0.4 3.6]); set(ax,'XTick',0:200:800);
view(ax,-40,28); grid(ax,'on'); set(ax,'PlotBoxAspectRatio',[1 2.6 1.0]);
lg = legend(ax,hb,ml_tx(yv),'Location','northeast');
ml_style_legend(lg,PP);
save_png(f,FIGD,'指标年份改造投资三维横向柱');
% ---- 4.4 馈线 × 年份 线损率 ----
fv = {'城东 I 回','城西 II 回','工业园 III 回','新区 IV 回'};
yv = {'2022 年','2023 年','2024 年'};
Y = [186 204 226
142 158 172
620 692 764
96 118 142];
f = ml_fig(PP,100,80);
ax = axes('Parent',f,'Position',[0.210 0.215 0.720 0.730]);
hb = bar3h(ax,Y,0.55);
for k = 1:3, set(hb(k),'FaceColor',C(k+2,:),'EdgeColor',[0.25 0.25 0.25],'LineWidth',0.2); end
set(ax,'YTick',1:4,'YTickLabel',ml_tx(fv),'ZTick',1:3,'ZTickLabel',ml_tx(yv));
ylabel(ml_tx('10 kV 馈线'));
xlabel(ml_tx('年供电量 <i>W</i> / GW·h'));
zlabel(ml_tx('年份'));
ylim(ax,[0.4 4.6]); xlim(ax,[0 850]); zlim(ax,[0.4 3.6]); set(ax,'XTick',0:200:800);
view(ax,-40,28); grid(ax,'on'); set(ax,'PlotBoxAspectRatio',[1 2.6 1.0]);
lg = legend(ax,hb,ml_tx(yv),'Location','northeast');
ml_style_legend(lg,PP);
save_png(f,FIGD,'馈线年份供电量三维横向柱');
% ---- 4.5 设备 × 年份 检修工时 ----
ev = {'断路器','隔离开关','互感器','避雷器','蓄电池组'};
yv = {'2022 年','2023 年','2024 年'};
Y = [286 264 242
198 176 154
142 132 118
96 88 76
152 168 186];
f = ml_fig(PP,100,80);
ax = axes('Parent',f,'Position',[0.210 0.215 0.720 0.730]);
hb = bar3h(ax,Y,0.55);
for k = 1:3, set(hb(k),'FaceColor',C(k,:),'EdgeColor',[0.25 0.25 0.25],'LineWidth',0.2); end
set(ax,'YTick',1:5,'YTickLabel',ml_tx(ev),'ZTick',1:3,'ZTickLabel',ml_tx(yv));
ylabel(ml_tx('一次设备'));
xlabel(ml_tx('检修工时 / h'));
zlabel(ml_tx('年份'));
ylim(ax,[0.4 5.6]); xlim(ax,[0 360]); zlim(ax,[0.4 3.6]); set(ax,'XTick',0:100:300);
view(ax,-40,28); grid(ax,'on'); set(ax,'PlotBoxAspectRatio',[1 2.6 1.0]);
lg = legend(ax,hb,ml_tx(yv),'Location','northeast');
ml_style_legend(lg,PP);
save_png(f,FIGD,'设备年份检修工时三维横向柱');
end

浙公网安备 33010602011771号