メインコンテンツ

plot

Plot detected anomalies and anomaly scores generated from trained machine learning anomaly detectors

Since R2026a

Description

Add-On Required: This feature requires the Time Series Anomaly Detection for MATLAB add-on.

plot(detector,data) plots the anomaly detection data in data that result from executing detect with the machine-learning anomaly detection model detector.

plot plots two figures—one for the anomalies and the other for the anomaly score.

For an example of using plot as part of the detector development workflow, see Train and Test TCN Anomaly Detector.

plot(___,Name=Value) sets additional options using one or more name-value arguments.

Input Arguments

collapse all

Trained machine learning anomaly detector, specified as a TimeSeriesIForestDetector, TimeSeriesRRCForestDetector, TimeSeriesLOFDetector, or TimeSeriesOCSVMDetector object.

Single-member anomaly data to be plotted, specified as a table that is the output of detect.

Name-Value Arguments

expand all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: plot(detector_if,PlotType="all") plots both the anomaly scores and the anomaly detections.

All Machine Learning Detectors

expand all

Type of figure to plot, specified as "all", "anomaly", or "anomalyScores".

  • The "anomaly" plot type overlays the detected anomaly on the observed signal.

  • The anomalyScores plot type plots the anomaly scores against the threshold so that you can evaluate visually how effective the threshold is.

For an example of these plot types, see Train and Test TCN Anomaly Detector.

Version History

Introduced in R2026a