to plot two barcharts, I used the subplot command. It is necessary to align both plots exactly under each other.
The problem is the legend. If both legends have not the same number of letters (or space), one of the plots is shorter. I tried to solve this with position of legend or plot, and overwriting the second plots legend or plot position.
data1=[1 2 3 4 5];
data2=[5 4 3 2 1];
legend('Data from measurements and some space so its wide enough','Location','EastOutside')