image thumbnail

MATLAB Plot Gallery - Bar Graph 3D

by

 

24 Feb 2012 (Updated )

Create a 3D bar chart

Bar_Plot_3D

This is an example of how to create a 3D bar chart in MATLAB®.

Read about the bar3 function in the MATLAB documentation.

For more examples, go to MATLAB Plot Gallery

% Load monthly temperature data
load MonthlyTemps temperatures months years

% Create the 3D bar chart
figure
bar3(temperatures)
axis([0 13 0 12 0 80])

% Add title and axis labels
title('Boston Monthly Temperatures 1900-2000')
xlabel('Month')
ylabel('Year')
zlabel('Temperature')

% Change the x and y axis tick labels
set(gca, 'XTickLabel', months)
set(gca, 'YTickLabel', years)

Contact us