code: def decomposed_plot(decomposed_tuple, figure_kwargs=None, show=True):
      """Plot the decomposition of a time series.
  
      Plots the results of the time series decomposition in four plots:
      the 'x', 'trend', 'seasonal', and 'random' components.
  
      Parameters
      ----------
      decomposed_tuple : tuple, namedtuple or iterable
          Named tuple of series that consist of data, trend, seasonal, and
          random. Should be the result of :func:`pmdarima.arima.decompose`.
  
      figure_kwargs : dict, optional (default=None)
          Optional dictionary of keyword arguments that are passed to figure.
  
      show : bool, optional (default=True)
          Whether to show the plot after it's been created. If not, will return
          the plot as an Axis object instead.
  
      Notes
      -----
      This method will only show the plot if ``show=True`` (which is the default
      behavior). To simply get the axis back (say, to add to another canvas),
      use ``show=False``.
      """
  
      _err_for_no_mpl()
  
      fig, axes = mpl.subplots(4, 1, sharex=True, **figure_kwargs)
  
      y_labels = ["data", "trend", "seasonal", "random"]
  
      for ax in axes.flat:
          ax.set(ylabel=y_labels.pop(0))
  
      # Unpack positionally so that user could pass as a tuple, if they have
      # pre-computed...
      x, trend, ssnl, rand = decomposed_tuple
  
      axes[0].plot(x)
      axes[1].plot(trend)
      axes[2].plot(ssnl)
      axes[3].plot(rand)
  
      return _show_or_return(axes, show)
  
file_path: pmdarima/pmdarima/utils/visualization.py
imports: from .array import check_endog
  from ..compat.pandas import plotting
  from ..compat.matplotlib import get_compatible_pyplot
  from statsmodels.graphics import tsaplots
  import numpy
  import os
label_desc: Use image node_id 4 for calling a global function with example usage: decomposed_plot(decomposed_tuple, figure_kwargs, show) and returns: _show_or_return