Conditionally colored line plot

Versione 1.1 (3,62 KB) da Matt Tearle
Plots (2D line) graph split into two colors above and below a given threshold value
1,7K download
Aggiornato 3 mar 2020

Visualizza la licenza

Plots vectors x & y using one color for when y is greater than a given threshold value, and another color when y is less than the threshold.
You can optionally specify any standard formatting string that PLOT accepts (eg 'rx:' for a red dotted line with cross markers).

The plotting follows the standard MATLAB PLOT approach of linearly interpolating between data values. The coloring/linestyle changes at y = threshold, even on the interpolated line.

Cita come

Matt Tearle (2024). Conditionally colored line plot (https://www.mathworks.com/matlabcentral/fileexchange/30423-conditionally-colored-line-plot), MATLAB Central File Exchange. Recuperato .

Compatibilità della release di MATLAB
Creato con R2010b
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS Linux
Categorie
Scopri di più su Line Plots in Help Center e MATLAB Answers
Riconoscimenti

Ispirato: Conditionally Colored Plot (CCPLOT)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Versione Pubblicato Note della release
1.1

Made a quick hack to the input-parsing utility to deal with the change in precedence rules. It should now work in 19b and in previous versions. Hasn't been really thoroughly tested, though, so please report any problems.

1.0.0.1

Updated license

1.0.0.0