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.
XData
Array containing values of x-coordinates for both plots y1 and y2. Note: x-coordinates for both y1 and y2 should be commonY1Data
y-coordinates of y1 plotY2Data
y-coordinates of y2 plotCondition
The condition property selectively shades the area based on the condition provided by the user.ShadeInverse
Shades all the unshaded regions between 2 curves with a different color.OptimizePerformance
Calculate the vertices of triangles that compose the patch manually instead of asking patch to do it
FaceAlpha
Describes opacity of shaded area. If set to 1, the shaded area is completely opaque. If set to 0, the shaded area is completely transparent.FaceColor
Describes the color of shaded area specified by ConditionInverseFaceColor
If ShadeInverse is set to true, we shade the unshaded region with InverseFaceColorLine1Color
Line color for plot describing y1 valuesLine2Color
Line color for plot describing y2 valuesXLabel
Label for x axisYLabel
Label for y axisLine1LineStyle
Line Spec for plot describing y1 valuesLine2LineStyle
Line Spec for plot describing y2 valuesLine1LineWidth
Line Width for plot describing y1 valuesLine2LineWidth
Line Width for plot describing y2 valuesLabel1
Label for plot describing y1 valuesLabel2
Label for plot describing y2 valuesTitle
Title 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;