code: def plotComponent(time, data, result, options):
      """
      Plot the results of a single component in one figure
  
      Args:
          time: the time label
          data: a dictionary contains all information. The basic keys are
                data['filteredMean'] = ...
                data['filteredVar']  = ...
                data['predictedMean']= ...
                data['predictedVar'] = ...
                data['smoothedMean'] = ...
                data['smoothedVar']  = ...
                data['name']         = ...
                not all are needed, depending on the setting in options.
          result: the fitted result from dlm class
          options: options for the plot, for details please refer to @dlm
      """
  
      if options.separatePlot:
          numOfPlots = (
              options.plotFilteredData
              + options.plotPredictedData
              + options.plotSmoothedData
          )
          size = (numOfPlots, 1)
          location = 1
  
      # plot fitered results if needed
      if options.plotFilteredData:
          if options.separatePlot:
              subplot(size, location)
              location += 1
  
          start = result.filteredSteps[0]
          end = result.filteredSteps[1] + 1
          plotData(
              time=time[start:end],
              data=data["filteredMean"],
              showDataPoint=options.showFittedPoint,
              color=options.filteredColor,
              label="filtered " + data["name"],
          )
  
          if options.showConfidenceInterval:
              upper, lower = getInterval(
                  data["filteredMean"],
                  list(map(abs, data["filteredVar"])),
                  p=options.confidence,
              )
  
              plotInterval(
                  time=time[start:end],
                  upper=upper,
                  lower=lower,
                  intervalType=options.intervalType,
                  color=options.filteredColor,
              )
  
          plt.legend(loc="best", shadow=True)
  
      # plot predicted results if needed
      if options.plotPredictedData:
          if options.separatePlot:
              subplot(size, location)
              location += 1
  
          start = result.filteredSteps[0]
          end = result.filteredSteps[1] + 1
          plotData(
              time=time[start:end],
              data=data["predictedMean"],
              showDataPoint=options.showFittedPoint,
              color=options.predictedColor,
              label="one-step predict for " + data["name"],
          )
  
          if options.showConfidenceInterval:
              upper, lower = getInterval(
                  data["predictedMean"],
                  list(map(abs, data["predictedVar"])),
                  p=options.confidence,
              )
  
              plotInterval(
                  time=time[start:end],
                  upper=upper,
                  lower=lower,
                  intervalType=options.intervalType,
                  color=options.predictedColor,
              )
  
          plt.legend(loc="best", shadow=True)
  
      # plot smoothed results if needed
      if options.plotSmoothedData:
          if options.separatePlot:
              subplot(size, location)
              location += 1
  
          start = result.smoothedSteps[0]
          end = result.smoothedSteps[1] + 1
          plotData(
              time=time[start:end],
              data=data["smoothedMean"],
              showDataPoint=options.showFittedPoint,
              color=options.smoothedColor,
              label="smoothed " + data["name"],
          )
  
          if options.showConfidenceInterval:
              upper, lower = getInterval(
                  data["smoothedMean"],
                  list(map(abs, data["smoothedVar"])),
                  p=options.confidence,
              )
  
              plotInterval(
                  time=time[start:end],
                  upper=upper,
                  lower=lower,
                  intervalType=options.intervalType,
                  color=options.smoothedColor,
              )
  
          plt.legend(loc="best", shadow=True)
  
file_path: pydlm/pydlm/plot/dlmPlot.py
imports: import matplotlib.pyplot
  from pydlm.base.tools import getInterval
label_desc: Use image node_id 5 for calling a global function with example usage: plotComponent(time, data, result, options) without return types