class_docstr: Visualize Multiple-dimensional data
  
  This class enables the visualization of multi-dimensional data, using
  a triangular grid of 2D plots.
  
  Parameters
  ----------
  ndim : integer
      Number of data dimensions
  inner_labels : bool
      If true, then label the inner axes.  If false, then only the outer
      axes will be labeled
  fig : matplotlib.Figure
      if specified, draw the plot on this figure.  Otherwise, use the
      current active figure.
  left, bottom, right, top, wspace, hspace : floats
      these parameters control the layout of the plots.  They behave have
      an identical effect as the arguments to plt.subplots_adjust.  If not
      specified, default values from the rc file will be used.
  
  Examples
  --------
  A grid of scatter plots can be created as follows::
  
      x = np.random.normal((4, 1000))
      R = np.random.random((4, 4))  # projection matrix
      x = np.dot(R, x)
      ax = MultiAxes(4)
      ax.scatter(x)
      ax.set_labels(['x1', 'x2', 'x3', 'x4'])
  
  Alternatively, the scatter plot can be visualized as a density::
  
      ax = MultiAxes(4)
      ax.density(x, bins=[20, 20, 20, 20])
docstr: Density plot of data
  
  This function calls np.histogram2D to bin the data in each axes, then
  calls plt.imshow() on the result.  All extra arguments or
  keyword arguments are passed to the plt.imshow function.
  
  Parameters
  ----------
  data : ndarray
      shape of data is [n_samples, ndim], and ndim should match that
      passed to the MultiAxes constructor.
  bins : int, array, list of ints, or list of arrays
      specify the bins for each dimension. If bins is a list, then the
      length must match the data dimension
docstr_tok: ["Density","plot","of","data","This","function","calls","np.histogram2D","to","bin","the","data","in","each","axes",",","then","calls","plt.imshow","(",")","on","the","result",".","All","extra","arguments","or","keyword","arguments","are","passed","to","the","plt.imshow","function",".","Parameters","--","--","--","--","--","data",":","ndarray","shape","of","data","is","[","n_samples",",","ndim","]",",","and","ndim","should","match","that","passed","to","the","MultiAxes","constructor",".","bins",":","int",",","array",",","list","of","ints",",","or","list","of","arrays","specify","the","bins","for","each","dimension",".","If","bins","is","a","list",",","then","the","length","must","match","the","data","dimension"]
code: def density(self, data, bins=20, **kwargs):
      """Density plot of data
  
      This function calls np.histogram2D to bin the data in each axes, then
      calls plt.imshow() on the result.  All extra arguments or
      keyword arguments are passed to the plt.imshow function.
  
      Parameters
      ----------
      data : ndarray
          shape of data is [n_samples, ndim], and ndim should match that
          passed to the MultiAxes constructor.
      bins : int, array, list of ints, or list of arrays
          specify the bins for each dimension. If bins is a list, then the
          length must match the data dimension
      """
      data = self._check_data(data)
  
      if not hasattr(bins, "__len__"):
          bins = [bins for i in range(self.ndim)]
      elif len(bins) != self.ndim:
          bins = [bins for i in range(self.ndim)]
  
      for i in range(self.ndim):
          for j in range(self.ndim):
              ax = self.axes[i, j]
              if ax is None:
                  continue
  
              H, xbins, ybins = np.histogram2d(
                  data[:, i], data[:, j], (bins[i], bins[j])
              )
              ax.imshow(
                  H.T,
                  origin="lower",
                  aspect="auto",
                  extent=(xbins[0], xbins[-1], ybins[0], ybins[-1]),
                  **kwargs,
              )
  
              ax.set_xlim(xbins[0], xbins[-1])
              ax.set_ylim(ybins[0], ybins[-1])
  
file_path: astroML/astroML/plotting/multiaxes.py
imports: from copy import deepcopy
  import numpy
label_desc: Use image node_id 11 for calling the MultiAxes obj's underlying member method code with example usage: obj.density(data, bins) without return types