code: def plot_regression(
      self,
      lines,
      title,
      axis_labels=None,
      mse=None,
      scatter=None,
      legend={"type": "lines", "loc": "lower right"},
  ):
      if scatter:
          scatter_plots = scatter_labels = []
          for s in scatter:
              scatter_plots += [
                  plt.scatter(
                      s["x"], s["y"], color=s["color"], s=s["size"]
                  )
              ]
              scatter_labels += [s["label"]]
          scatter_plots = tuple(scatter_plots)
          scatter_labels = tuple(scatter_labels)
  
      for l in lines:
          li = plt.plot(
              l["x"],
              l["y"],
              color=s["color"],
              linewidth=l["width"],
              label=l["label"],
          )
  
      if mse:
          plt.suptitle(title)
          plt.title("MSE: %.2f" % mse, fontsize=10)
      else:
          plt.title(title)
  
      if axis_labels:
          plt.xlabel(axis_labels["x"])
          plt.ylabel(axis_labels["y"])
  
      if legend["type"] == "lines":
          plt.legend(loc="lower_left")
      elif legend["type"] == "scatter" and scatter:
          plt.legend(scatter_plots, scatter_labels, loc=legend["loc"])
  
      plt.show()
  
file_path: ML-From-Scratch/mlfromscratch/utils/misc.py
imports: import progressbar
  from mpl_toolkits.mplot3d import Axes3D
  import matplotlib.pyplot
  import matplotlib.cm
  import matplotlib.colors
  import numpy
  from mlfromscratch.utils.data_operation import calculate_covariance_matrix
  from mlfromscratch.utils.data_operation import calculate_correlation_matrix
  from mlfromscratch.utils.data_manipulation import standardize
label_desc: Use image node_id 3 for calling the Plot obj's underlying member method code with example usage: obj.plot_regression(lines, title, axis_labels, mse, scatter, legend) without return types