drtsans.plots package

Submodules

This module contains methods for plotting data objects

drtsans.plots.api module

drtsans.plots.api.plot_IQazimuthal(workspace, filename, backend: str = 'd3', qmin: float | None = None, qmax: float | None = None, wedges: List[Any] | None = None, symmetric_wedges: bool = True, mask_alpha=0.6, imshow_kwargs: Dict = {}, **kwargs)[source]

Save a plot of I(Qx, Qy). If qmin is specified, all I(Q) with Q less than qmin will be masked in output plot. If qmax is specified, all I(Q) with Q greater than qmax will be masked in output plot. If wedges are specified, all I(Q) out side of wedges will be masked in output plot.

Parameters:
  • workspace (IQazimuthal) – The workspace (i.e., I(Qx, Qy)) to plot. This assumes the data is binned on a constant grid.

  • filename (str) – The name of the file to save to. For the MATPLOTLIB backend, the type of file is determined from the file extension

  • qmin (float) – minimum 1D Q for plotting selection area

  • qmax (float) – maximum 1D Q for plotting selection area

  • wedges (~list or None) – list of tuples (angle_min, angle_max) for the wedges. Select wedges to plot. Both numbers have to be in the [-90,270) range. It will add the wedge offset by 180 degrees dependent on symmetric_wedges

  • symmetric_wedges (bool) – Add the wedge offset by 180 degrees if True

  • mask_alpha (float) – Opacity for for selection area

  • backend – Which backend to save the file using

  • imshow_kwargs (~dict) – Optional arguments to matplotlib.axes.Axes.imshow e.g. {"norm": LogNorm()}

  • kwargs (~dict) – Additional key word arguments for matplotlib.axes.Axes

drtsans.plots.api.plot_IQmod(workspaces, filename, loglog=True, backend: str = 'd3', errorbar_kwargs={}, **kwargs)[source]

Save a plot representative of the supplied workspaces

Parameters:
  • workspaces (list, tuple) – A collection of IQmod workspaces to plot. If only one is desired, it must still be supplied in a list or tuple.

  • filename (str) – The name of the file to save to. For the MATPLOTLIB backend, the type of file is determined from the file extension

  • loglog (bool) – If true will set both axis to logarithmic, otherwise leave them as linear

  • backend – Which backend to save the file using

  • errorbar_kwargs (dict) – Optional arguments to matplotlib.axes.Axes.errorbar Can be a comma separated list for each workspace e.g. {'label':'main,wing,both', 'color':'r,b,g', 'marker':'o,v,.'}

  • kwargs (dict) – Additional key word arguments for matplotlib.axes.Axes

drtsans.plots.api.plot_detector(input_workspace, filename=None, backend: str = 'd3', axes_mode='tube-pixel', panel_name=None, figure_kwargs={'figsize': (8, 6)}, imshow_kwargs={'norm': <matplotlib.colors.LogNorm object>})[source]

Save a 2D plot representative of the supplied workspace

Parameters:
  • input_workspace (str, MatrixWorkspace) – The workspace to plot

  • filename (str) – The name of the file to save to. For the MATPLOTLIB backend, the type of file is determined from the file extension

  • backend – Which backend to save the file using

  • axes_mode (str) – Plot intensities versus different axes. Options are: ‘xy’ for plotting versus pixel coordinates; ‘tube-pixel’ for plotting versus tube and pixel index.

  • panel_name (str) – Name of the double panel detector array. If None, plots will be generated for all arrays.

  • figure_kwargs (str) – Optional arguments to matplotlib.pyplot.figure

  • imshow_kwargs (dict) – Optional arguments to matplotlib.axes.Axes.imshow

Module contents

drtsans.plots.plot_IQazimuthal(workspace, filename, backend: str = 'd3', qmin: float | None = None, qmax: float | None = None, wedges: List[Any] | None = None, symmetric_wedges: bool = True, mask_alpha=0.6, imshow_kwargs: Dict = {}, **kwargs)[source]

Save a plot of I(Qx, Qy). If qmin is specified, all I(Q) with Q less than qmin will be masked in output plot. If qmax is specified, all I(Q) with Q greater than qmax will be masked in output plot. If wedges are specified, all I(Q) out side of wedges will be masked in output plot.

Parameters:
  • workspace (IQazimuthal) – The workspace (i.e., I(Qx, Qy)) to plot. This assumes the data is binned on a constant grid.

  • filename (str) – The name of the file to save to. For the MATPLOTLIB backend, the type of file is determined from the file extension

  • qmin (float) – minimum 1D Q for plotting selection area

  • qmax (float) – maximum 1D Q for plotting selection area

  • wedges (~list or None) – list of tuples (angle_min, angle_max) for the wedges. Select wedges to plot. Both numbers have to be in the [-90,270) range. It will add the wedge offset by 180 degrees dependent on symmetric_wedges

  • symmetric_wedges (bool) – Add the wedge offset by 180 degrees if True

  • mask_alpha (float) – Opacity for for selection area

  • backend – Which backend to save the file using

  • imshow_kwargs (~dict) – Optional arguments to matplotlib.axes.Axes.imshow e.g. {"norm": LogNorm()}

  • kwargs (~dict) – Additional key word arguments for matplotlib.axes.Axes

drtsans.plots.plot_IQmod(workspaces, filename, loglog=True, backend: str = 'd3', errorbar_kwargs={}, **kwargs)[source]

Save a plot representative of the supplied workspaces

Parameters:
  • workspaces (list, tuple) – A collection of IQmod workspaces to plot. If only one is desired, it must still be supplied in a list or tuple.

  • filename (str) – The name of the file to save to. For the MATPLOTLIB backend, the type of file is determined from the file extension

  • loglog (bool) – If true will set both axis to logarithmic, otherwise leave them as linear

  • backend – Which backend to save the file using

  • errorbar_kwargs (dict) – Optional arguments to matplotlib.axes.Axes.errorbar Can be a comma separated list for each workspace e.g. {'label':'main,wing,both', 'color':'r,b,g', 'marker':'o,v,.'}

  • kwargs (dict) – Additional key word arguments for matplotlib.axes.Axes

drtsans.plots.plot_detector(input_workspace, filename=None, backend: str = 'd3', axes_mode='tube-pixel', panel_name=None, figure_kwargs={'figsize': (8, 6)}, imshow_kwargs={'norm': <matplotlib.colors.LogNorm object>})[source]

Save a 2D plot representative of the supplied workspace

Parameters:
  • input_workspace (str, MatrixWorkspace) – The workspace to plot

  • filename (str) – The name of the file to save to. For the MATPLOTLIB backend, the type of file is determined from the file extension

  • backend – Which backend to save the file using

  • axes_mode (str) – Plot intensities versus different axes. Options are: ‘xy’ for plotting versus pixel coordinates; ‘tube-pixel’ for plotting versus tube and pixel index.

  • panel_name (str) – Name of the double panel detector array. If None, plots will be generated for all arrays.

  • figure_kwargs (str) – Optional arguments to matplotlib.pyplot.figure

  • imshow_kwargs (dict) – Optional arguments to matplotlib.axes.Axes.imshow