How to fill the area under the 3D-graphics in MATLAB?

I created the following 3D plot in MATLAB using the function plot3:

enter image description here

Now I want to get the shaded area under the "2nd subgraphs" (i.e. below the blue and red curves). Unfortunately, I do not know how to implement this.

I would really appreciate if anyone had an idea.

+5
source share
1 answer

, fill3 2D case, , , "" . (.. ) , , - . :

x = 1:10;
y = rand(1, 10);
hFill = fill3(zeros(1, 12), x([1 1:end end]), [0 y 0], 'b', 'FaceAlpha', 0.5);
grid on

:

enter image description here

fill3. 4 :

nPoints = 10;  % Number of data points
nPlots = 4;    % Number of curves
data = rand(nPoints, nPlots);  % Sample data, one curve per column

% Create data matrices:
[X, Y] = meshgrid(0:(nPlots-1), [1 1:nPoints nPoints]);
Z = [zeros(1, nPlots); data; zeros(1, nPlots)];
patchColor = [0 0.4470 0.7410];  % RGB color for patch edge and face

% Plot patches:
hFill = fill3(X, Y, Z, patchColor, 'LineWidth', 1, 'EdgeColor', patchColor, ...
              'FaceAlpha', 0.5);
set(gca, 'YDir', 'reverse', 'YLim', [1 nPoints]);
grid on

:

enter image description here

+5

Source: https://habr.com/ru/post/1674047/


All Articles