How can I make floating bar graphs using BAR3 command in MATLAB 7.5 (R2007b)?

3 views (last 30 days)
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.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 7 Sep 2012
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');

More Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Products


Release

R2007b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!