UPDATE: THIS VERSION HAS BEEN DEPRECATED. There's nothing wrong with it, per se, but I'm no longer maintaining it. You'll find a better version in the Climate Data Toolbox for MATLAB: https://www.mathworks.com/matlabcentral/fileexchange/70338
This function simply plots shaded anomaly plots like the ones you might find in IPCC reports.
Chad Greene (2021). anomaly (https://www.mathworks.com/matlabcentral/fileexchange/61327-anomaly), MATLAB Central File Exchange. Retrieved .
One question, I do have x as a Class 'datetime' (like... 2018-01-17), but getting this error:
Error using datetime/horzcat (line 1286)
All inputs must be datetimes or date/time character
vectors or date/time strings.
Error in anomaly>intersections (line 290)
xy1 = [x1 y1];
Error in anomaly (line 115)
[xc,yc] = intersections(x,y,[x(1) x(end)],[base base]);
% intersections is a subfunction by Douglas Schwarz,
Inspired by: Shade area between two curves, IPCC2mat, Shade Anomaly, gtfill(x,y1,y2,n,c1,c2), b2r(cmin_input,cmax_input), fill_between, mseb(x,y,errBar,lineProps,transparent), cmocean perceptually-uniform colormaps, Fast and Robust Curve Intersections
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!