drives      = {'Elmo','EVLSERVO1 in Low Power State - MCU in Standby mode, analog electronics powered down, no hardware mods','Revised EVLSERVO1 in Low Power State - hardware chages','Custom Design heavily based on EVLSERVO1'};
idle_power  = [10,      0.9,             0.21,               0.030]; 
x           = 1:numel(drives);

figure;
hold on;

colors = [
    1 0 0;
    1 1 0;    
    0 1 0;   
    0 0 1     
];

bar_handles = gobjects(1, numel(drives));

for i = 1:numel(drives)
    bar_handles(i) = bar(x(i), idle_power(i), 0.5, 'FaceColor', colors(i, :));
end





y_max = max(idle_power) * 1.2;
y_min = 0;
ytick_interval = 0.05;
ylim([y_min y_max]);
yticks(y_min:ytick_interval:y_max);



ax = gca;
ax.XTick = x;
ax.XTickLabel = [];
ax.YGrid = 'on';
ax.FontSize = 14;
ylabel('Idle Power (W)');
title('Idle Power Comparison');

legend(bar_handles, drives, 'Location', 'northeast', 'FontSize', 12);


gains = (idle_power(1) - idle_power) ./ idle_power(1) * 100;
offset = 0.05 * (max(idle_power) - min(idle_power));

for i = 1:numel(idle_power)
    if i == numel(idle_power)
        wattLabel = sprintf('%.0f W', idle_power(i));
    else
        wattLabel = sprintf('%.2f W', idle_power(i));
    end

    if i > 1
        gainLabel = sprintf('%.1f%% ↓', gains(i));
        txt = {wattLabel, gainLabel};
    else
        txt = {wattLabel};
    end
    
    text(x(i), idle_power(i) + offset, txt, ...
         'HorizontalAlignment','center', ...
         'VerticalAlignment','bottom', ...
         'FontWeight','bold', ...
         'FontSize',12);
end

hold off;
