File Exchange

image thumbnail

Shade Anomaly

version 1.2 (2.43 KB) by

The fills in graphs above and below the x-axis different colors.

7 Downloads

Updated

View License

Shade Anomaly fills in graphs above and below the x-axis different colors. It allows you to create offsets, so that values above a certain threshold are shaded. This is good to use if you would like shade values above a standard deviation.

There is an example in the script if you do not enter any inputs.

Please share comments and suggestions!

Comments and Ratings (8)

Amore Fu

Dear Alec, the function is great. However, I want to ask that how can we shade the parts, whose centre is not zero? for example, the area bigger than 10 and smaller the 3.Thanks !

Nieves

Nieves (view profile)

Dear Alec, the function is great. However, I have a little problem and I don't know why.
When I make my shaded_anomaly graph, the graph doesn't show shaded all values above offset. Somebody have detected the same problem?

Nieves

Nieves (view profile)

ASONG ZILEFAC

Hey Alec,

How can one modify this file to plot bars and shade the bars instead of area plots?

Thanks.
Z.

Deborah

Great work, and it's exactly what I was looking for! Thank you

Deborah

Alec

Alec (view profile)

The function requires the use of a function called hline. You can download it from the file exchange or you can comment out that line. It is for appearance only. A new version will include those changes in the near future.

Alec

Alec (view profile)

The function does not deal well with NaNs (it will not shade). One can add the following simple lines just above the TOP section to remove NaNs.
x=x(~isnan(y));
y=y(~isnan(y));

Updates

1.2

Added the requirement of a function called within the shade_anomaly function.

MATLAB Release
MATLAB 7.8 (R2009a)
Acknowledgements

Inspired: fill_between, anomaly, EOF, xcorr3

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video