Previous topic

util.gos

Next topic

util.grandom

This Page

util.gplot

Miscellaneous functions for plotting data with Matplotlib.

glimpse.util.gplot.Show2DArray(fg, bg=None, mapper=None, annotation=None, title=None, axes=None, show=True, colorbar=False, **fg_args)

Deprecated since version 0.1: Use Show2dArray instead.

glimpse.util.gplot.Show2DArrayList(xs, annotations=None, normalize=True, colorbar=False, colorbars=False, cols=None, center_zero=True, axes=None, figure=None, show=True, titles=None, **args)

Deprecated since version 0.1: Use Show2dArrayList instead.

glimpse.util.gplot.Show2dArray(fg, bg=None, mapper=None, annotation=None, title=None, axes=None, show=True, colorbar=False, **fg_args)

Show a 2-D array using matplotlib.

Parameters:
  • fg (2D ndarray.) – Foreground array to display, shown with a spectral colormap.
  • bg (2D ndarray) – Optional background array, shown as grayscale.
  • mapper – Function to map locations in the foreground to corresponding locations in the background. (Required if bg is set.)
  • annotation (2D ndarray) – Small array to display in top-left corner of plot.
  • title (str) – String to display above plot.
glimpse.util.gplot.Show2dArrayList(xs, annotations=None, normalize=True, colorbar=False, colorbars=False, cols=None, center_zero=True, axes=None, figure=None, show=True, titles=None, **args)

Display a list of 2-D arrays using matplotlib.

Parameters:
  • annotations (list of 2D ndarray) – Small images to show with each array visualization.
  • normalize (bool) – Whether to use the same colormap range for all subplots.
  • colorbar (bool) – Whether to show the meaning of the colormap as an extra subplot (implies normalize = True).
  • colorbars (bool) – Whether to show a different colorbar for each subplot.
  • cols (int) – Number of subplot columns to use.
  • center_zero (bool) – When normalizing a range that spans zero, make sure zero is in the center of the colormap range.
  • titles (list of str) – Title string to include above each plotted array.
glimpse.util.gplot.Show3DArray(xs, annotations=None, figure=None, **args)

Deprecated since version 0.1: Use Show3dArray instead.

glimpse.util.gplot.Show3dArray(xs, annotations=None, figure=None, **args)

Display slices of a 3-D array using matplotlib.

Parameters:
  • annotations (list of 2D ndarray) – Small images to show with each array visualization.
  • figure – The matplotlib figure into which to plot.
  • args – Arguments to pass to Show2dArrayList().
glimpse.util.gplot.ShowImagePowerSpectrum(data, width=None, **plot_args)

Display the 1-D power spectrum of an image.

Parameters:
  • data (2D ndarray) – Image data.
  • width (int) – Effective width of image (with padding) for FFT.
  • plot_args (dict) – Optional arguments passed to matplotlib plot() command.
glimpse.util.gplot.ShowListWithCallback(xs, cb, cols=None, figure=None, nsubplots=None, colorbar=False)

Show each slice of a 3-D array using a callback function.

Parameters:
  • xs (iterable) – Values to pass to callback function. For example, this could be a 3-D array (which is a list of 2-D arrays), or a 1-D array of indices.
  • cb (callable) – Function taking an axes object and the current dataset.
  • nsubplots (int) – Number of total subplots. This could be more than the number of elements in xs.