class_docstr: Base class for an anomaly detection model.
class_docstr_tok: ["Base","class","for","an","anomaly","detection","model","."]
docstr: Plots the time series in matplotlib as a line graph, with points in the
  series overlaid as points color-coded to indicate their severity as
  anomalies.
  
  :param time_series: The `TimeSeries` we wish to plot & predict anomaly scores for.
  :param time_series_prev: a `TimeSeries` immediately preceding
      ``time_series``. Plotted as context if given.
  :param filter_scores: whether to filter the anomaly scores by the
      post-rule before plotting them.
  :param plot_time_series_prev: whether to plot ``time_series_prev`` (and
      the model's fit for it). Only used if ``time_series_prev`` is given.
  :param figsize: figure size in pixels
  :param ax: matplotlib axes to add this plot to
  :return: matplotlib figure & axes
docstr_tok: ["Plots","the","time","series","in","matplotlib","as","a","line","graph",",","with","points","in","the","series","overlaid","as","points","color-coded","to","indicate","their","severity","as","anomalies",".",":","param","time_series",":","The","`","TimeSeries","`","we","wish","to","plot","&","predict","anomaly","scores","for",".",":","param","time_series_prev",":","a","`","TimeSeries","`","immediately","preceding","``","time_series","``",".","Plotted","as","context","if","given",".",":","param","filter_scores",":","whether","to","filter","the","anomaly","scores","by","the","post-rule","before","plotting","them",".",":","param","plot_time_series_prev",":","whether","to","plot","``","time_series_prev","``","(","and","the","model","'s","fit","for","it",")",".","Only","used","if","``","time_series_prev","``","is","given",".",":","param","figsize",":","figure","size","in","pixels",":","param","ax",":","matplotlib","axes","to","add","this","plot","to",":","return",":","matplotlib","figure","&","axes"]
code: def plot_anomaly(
      self,
      time_series: TimeSeries,
      time_series_prev: TimeSeries = None,
      *,
      filter_scores=True,
      plot_time_series_prev=False,
      figsize=(1000, 600),
      ax=None,
  ):
      """
      Plots the time series in matplotlib as a line graph, with points in the
      series overlaid as points color-coded to indicate their severity as
      anomalies.
  
      :param time_series: The `TimeSeries` we wish to plot & predict anomaly scores for.
      :param time_series_prev: a `TimeSeries` immediately preceding
          ``time_series``. Plotted as context if given.
      :param filter_scores: whether to filter the anomaly scores by the
          post-rule before plotting them.
      :param plot_time_series_prev: whether to plot ``time_series_prev`` (and
          the model's fit for it). Only used if ``time_series_prev`` is given.
      :param figsize: figure size in pixels
      :param ax: matplotlib axes to add this plot to
      :return: matplotlib figure & axes
      """
      metric_name = time_series.names[0]
      title = f"{type(self).__name__}: Anomalies in {metric_name}"
      fig = self.get_figure(
          time_series=time_series,
          time_series_prev=time_series_prev,
          filter_scores=filter_scores,
          plot_time_series_prev=plot_time_series_prev,
      )
      return fig.plot(title=title, figsize=figsize, ax=ax)
  
imports: from abc import abstractmethod
  import copy
  import inspect
  import logging
  from typing import Any, Dict, List, Union
  import pandas
  from scipy.stats import norm
  from merlion.models.base import Config, ModelBase, MultipleTimeseriesModelMixin
  from merlion.plot import Figure, MTSFigure
  from merlion.post_process.calibrate import AnomScoreCalibrator
  from merlion.post_process.factory import PostRuleFactory
  from merlion.post_process.sequence import PostRuleSequence
  from merlion.post_process.threshold import AggregateAlarms, Threshold
  from merlion.utils import TimeSeries, UnivariateTimeSeries
  from merlion.utils.misc import call_with_accepted_kwargs
label_desc: Use image node_id 14 for calling the DetectorBase obj's underlying member method code with example usage: obj.plot_anomaly(time_series, time_series_prev) and returns: fig