plot

mantidplot.plot(*args, **kwargs)

Plot the data in various forms depending on what arguments are passed. Currently supported inputs: arrays (as Python lists or numpy arrays) and workspaces (by name or workspace objects).

@param args :: curve data and options @param kwargs :: plot line options

Returns :: the list of curves included in the plot

args can take different forms depending on what you plot. You can plot:

  • a python list or array (x) for example like this: plot(x)
  • a workspace (ws) for example like this: plot(ws, [100,101]) # this will plot spectra 100 and 101
  • a list of workspaces (ws, ws2, ws3, etc.) for example like this: plot([ws, ws2, ws3], [100,101])
  • workspaces identified by their names: plot([‘HRP39182’, ‘MAR11060.nxs’], [100,101])

You can also pass matplotlib/pyplot style strings as arguments, for example: plot(x, ‘-.’)

As keyword arguments (kwargs) you can specify multiple parameters, for example: linewidth, linestyle, marker, color.

An important keyword argument is tool. At the moment the following values are supported (they have long and short aliases):

  • To plot spectra: ‘plot_spectrum’ OR ‘spectrum’ OR ‘plot_sp’ OR ‘sp’ (default for workspaces).
  • To plot bins: ‘plot_bin’ OR ‘bin’
  • To do an MD plot: ‘plot_md’ OR ‘md’

Please see the documentation of this module (use help()) for more details.