image thumbnail
from MATLAB Plot Gallery - Area Plot by Plot Gallery
Create an area plot

Area_Plot

This is an example of how to create an area plot in MATLAB®.

Read about the area function in the MATLAB® documentation.

Go to MATLAB Plot Gallery

% Load population data
load PopulationAge years population groups;

% Create the area plot using the area function
figure;
area(years, population/1000000);
colormap winter;

% Add a legend
legend(groups, 'Location', 'NorthWest');

% Add title and axis labels
title('US Population by Age (1860 - 2000)');
xlabel('Years');
ylabel('Population in Millions');

Contact us