errShade(x,y,ePlus,eMinus,lineCol,lineWidth,lt)
This code plots a shaded error region and a curve that goes through it on any type of 2-D plot (e.g. semilog, loglog, regular plot). Note: You must first specify the plot type by plotting a curve before calling this function. The recommended usage is to plot your curve first, then call the function which will overplot the error region and curve.
Usage:
INPUTS:
x - array of x values for line
y - array of y values for line
ePlus - upper error value above the line (i.e. maxError(x)-y(x))
eMinus - lower error value below the line (i.e. y(x)-minError(x))
lineCol - color of line (either string: 'r'-red, or RGB triplet)
lineWidth - width of line
lt - lightness (mix ratio of color with pure white) [Note: 0.2 works quite nicely with common MATLAB colors 'r','b']
OUTPUT:
cH - handle of plotted curve
eH - handle of shaded error region
Cite As
Alan Seltzer (2024). errShade(x,y,ePlus,eMinus,lineCol,lineWidth,lt) (https://www.mathworks.com/matlabcentral/fileexchange/53494-errshade-x-y-eplus-eminus-linecol-linewidth-lt), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- AI, Data Science, and Statistics > Statistics and Machine Learning Toolbox > Probability Distributions > Exploration and Visualization >
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 | added new functionality to control the shading of the filled error region with a mixing ratio between the line color and white
|