MATLAB Examples

This is an example of how to create transparent objects in MATLAB®.

Read about the FaceAlpha property in the MATLAB documentation. This feature is available in R2015b or newer.

For more examples, go to MATLAB Plot Gallery

% Create 2 sets of data
x = linspace(0,10);
y1 = 4 + sin(x).*exp(0.1*x);
y2 = 4 + cos(x).*exp(0.1*x);

% Create semitransparent area plots
hold on
hold off

% Add title
title('Semi-transparent area plots')