Version 1.0
The Fill Between Area Curve creates a shaded area between two data series, effectively highlighting the region of overlap or difference.
For optimal performance and accurate graphs, please install the Mapping Toolbox .
fillBetweenAreaCurve(x, y1, y2)shades the area between 2 lines formed by y1 and y2fillBetweenAreaCurve(x, y1, y2, c)shades the area between 2 lines formed by y1 and y2 with color c.fillBetweenAreaCurve(__, Name, Value)specifies additional options for the FillBetweenAreaCurve using one or more name-value pair arguments. Specify the options after all other input arguments.
XDataArray containing values of x-coordinates for both plots y1 and y2. Note: x-coordinates for both y1 and y2 should be commonY1Datay-coordinates of y1 plotY2Datay-coordinates of y2 plotConditionThe condition property selectively shades the area based on the condition provided by the user.ShadeInverseShades all the unshaded regions between 2 curves with a different color.OptimizePerformanceCalculate the vertices of triangles that compose the patch manually instead of asking patch to do it
FaceAlphaDescribes opacity of shaded area. If set to 1, the shaded area is completely opaque. If set to 0, the shaded area is completely transparent.FaceColorDescribes the color of shaded area specified by ConditionInverseFaceColorIf ShadeInverse is set to true, we shade the unshaded region with InverseFaceColorLine1ColorLine color for plot describing y1 valuesLine2ColorLine color for plot describing y2 valuesXLabelLabel for x axisYLabelLabel for y axisLine1LineStyleLine Spec for plot describing y1 valuesLine2LineStyleLine Spec for plot describing y2 valuesLine1LineWidthLine Width for plot describing y1 valuesLine2LineWidthLine Width for plot describing y2 valuesLabel1Label for plot describing y1 valuesLabel2Label for plot describing y2 valuesTitleTitle of the chart
% Intialize some data
x = linspace(0, 4 * pi, 20);
y_sinx = sin(x);
y_cosx = cos(x);
% Create a basic FillBetweenAreaCurve
areaCurve = fillBetweenAreaCurve(x, y_sinx, y_cosx);
% Create a basic FillBetweenAreaCurve with magneta shading
areaCurveMagneta = fillBetweenAreaCurve(x, y_sinx, y_cosx, 'm');
% Create a FillBetweenAreaCurve with selective shading
areaCurveSelectiveShading = fillBetweenAreaCurve(x, y_sinx, y_cosx, 'Condition', @(x, y1, y2) x > 2 & x < 4);
areaCurveCondition2.ShadeInverse = false;
