Plot specific percentile for any 2d or 1d data set. The plotted percentiles color scheme follows that found in colorSpectrum. Color goes from red to green to blue. The percentiles from largest to smallest follow this color transition.
Example - To make figure in screenshot
f = @(x,y) y.*sin(2.*pi.*x);
X = linspace(0,1,1000);
Y = linspace(1,5,100);
X = kron(ones(100,1),X);
Y = kron(ones(1,1000),Y');
Data = f(X,Y);
Two Easy Directions:
Generate data set: Data
Plot percentiles: percentilePlot(Data,Percentiles)
Kirk (2021). percentilePlot: Plot Any Percentile for Time Series Data (https://www.mathworks.com/matlabcentral/fileexchange/44615-percentileplot-plot-any-percentile-for-time-series-data), MATLAB Central File Exchange. Retrieved .
Useful addition. I'd prefer the percentiles to be in numbers like 50 and 75 rather than 0.5 and 0.75 but that was easy to accomodate with a small tweak.
I like the colorSpectrum as well - returning just crisp straightforward colours in a gradation that is sensible to me.
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!