class_docstr: A basic class for Principal Component Analysis (PCA).
  
  p is the number of dimensions, while N is the number of data points
docstr: Generates a 2-dimensional plot of the data set and principle components
  using matplotlib.
  
  ix specifies which p-dimension to put on the x-axis of the plot
  and iy specifies which to put on the y-axis (0-indexed)
docstr_tok: ["Generates","a","2-dimensional","plot","of","the","data","set","and","principle","components","using","matplotlib",".","ix","specifies","which","p-dimension","to","put","on","the","x-axis","of","the","plot","and","iy","specifies","which","to","put","on","the","y-axis","(","0-indexed",")"]
code: def plot2d(self, ix=0, iy=1, clf=True):
      """
      Generates a 2-dimensional plot of the data set and principle components
      using matplotlib.
  
      ix specifies which p-dimension to put on the x-axis of the plot
      and iy specifies which to put on the y-axis (0-indexed)
      """
      import matplotlib.pyplot as plt
  
      x, y = self.N[:, ix], self.N[:, iy]
      if clf:
          plt.clf()
      plt.scatter(x, y)
      vals, evs = self.getEigensystem()
      # evx,evy=evs[:,ix],evs[:,iy]
      xl, xu = plt.xlim()
      yl, yu = plt.ylim()
      dx, dy = (xu - xl), (yu - yl)
      for val, vec, c in zip(vals, evs.T, self._colors):
          plt.arrow(
              0,
              0,
              val * vec[ix],
              val * vec[iy],
              head_width=0.05 * (dx * dy / 4) ** 0.5,
              fc=c,
              ec=c,
          )
      # plt.arrow(0,0,vals[ix]*evs[ix,ix],vals[ix]*evs[iy,ix],head_width=0.05*(dx*dy/4)**0.5,fc='g',ec='g')
      # plt.arrow(0,0,vals[iy]*evs[ix,iy],vals[iy]*evs[iy,iy],head_width=0.05*(dx*dy/4)**0.5,fc='r',ec='r')
      if self.names is not None:
          plt.xlabel("$" + self.names[ix] + "/\\sigma$")
          plt.ylabel("$" + self.names[iy] + "/\\sigma$")
  
file_path: statsmodels/statsmodels/sandbox/pca.py
imports: import numpy
label_desc: Use image node_id 8 for calling the Pca obj's underlying member method code with example usage: obj.plot2d(ix, iy, clf) without return types