I am trying to to change the size of the 3D bars accordingly to this figur (file name: "what I want.png"). Is it even possible to do that? I have been trying, but I don't know how to do it. My attempt so far its attached the file "my attempt.jpg".
This is my code so far:
figureY = [20 40 60 100 0 0 0 0]; h=bar3(Y);for i = 1:size(Y,2) zdata = get(h(i),'zdata'); k = 1; for j = 0:6:(6*size(Y,1)-6) if Y(k,i)==0 zdata(j+1:j+6,:)= NaN; end k = k+1; end set(h(i),'zdata',zdata);end xlabel('Frequency [kHz]')ylabel('Current [kA]')zlabel('Voltage [kV]')set(gca,'XTick',[1 2 3])
I would be very thankful for all help I can get,
Thank you
Best Answer
A simple way to do this is to understand that the width is y-axis dimension of the bar. To change the width of each bar, just change (bar handle).YData property of that bar. Remember for the first row of bars, the YData varies from 0.5 to 1.5. You can change either one or both endpoints to change the width. One possibility to do this is for your specific script is
just Add these lines at the end of your script. You can configure width by changing the numbers on RHS of these equations.