MATLAB: How to make floating bar graphs using BAR3 command in MATLAB 7.5 (R2007b)

barbar3bar333detachedfloatinggraphMATLABmaximumminimum

I would like to know if it is possible to create 3D bar graphs using the BAR3 command that do not start at the value zero. I need each bar in the graph to float, as in start the bar at say z_min and extend until z_max.

Best Answer

The ability to make floating 3D bar graphs with minimum and maximum values using BAR3 is not available in MATLAB 7.5 (R2007b)
As a workaround, download the attached 'bar3New.m' file and use it as follows to achieve the functionality:
plotMatrix = randi(20,2,5)
% matrix that contains the base z-values for each bar:
zMin = [1 2 3 4 5; 3 4 5 5 6];
% maximum z-values are the sum of base z-values and the bar height from plotMatrix:
zMax = zMin + plotMatrix;
% plot the 3-D bar graph
bar3New(zMax,zMin,'detached');