Вместо area
вы также можете использовать fill
, что может быть немного более интуитивно с точки зрения использования.
figure;
plot(1:10, 1:10,'r');
% Define the "shading"
% Note how each x_points(i) corresponds to y_points(i)
x_points = [5, 5, 7, 7];
y_points = [0, 10, 10, 0];
color = [0, 0, 1];
hold on;
a = fill(x_points, y_points, color);
a.FaceAlpha = 0.1;