code: def plot_in_2d(
      self, X, y=None, title=None, accuracy=None, legend_labels=None
  ):
      X_transformed = self._transform(X, dim=2)
      x1 = X_transformed[:, 0]
      x2 = X_transformed[:, 1]
      class_distr = []
  
      y = np.array(y).astype(int)
  
      colors = [
          self.cmap(i) for i in np.linspace(0, 1, len(np.unique(y)))
      ]
  
      # Plot the different class distributions
      for i, l in enumerate(np.unique(y)):
          _x1 = x1[y == l]
          _x2 = x2[y == l]
          _y = y[y == l]
          class_distr.append(plt.scatter(_x1, _x2, color=colors[i]))
  
      # Plot legend
      if not legend_labels is None:
          plt.legend(class_distr, legend_labels, loc=1)
  
      # Plot title
      if title:
          if accuracy:
              perc = 100 * accuracy
              plt.suptitle(title)
              plt.title("Accuracy: %.1f%%" % perc, fontsize=10)
          else:
              plt.title(title)
  
      # Axis labels
      plt.xlabel("Principal Component 1")
      plt.ylabel("Principal Component 2")
  
      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 4 for calling the Plot obj's underlying member method code with example usage: obj.plot_in_2d(X, y, title, accuracy, legend_labels) without return types