diff --git a/Code/Mantid/MantidPlot/mantidplot.py b/Code/Mantid/MantidPlot/mantidplot.py index 4f0ae32b980bac7f9499c40aa39e44f65d0284ae..3e69995510c96b98859f8dffde29b5f488fa37c8 100644 --- a/Code/Mantid/MantidPlot/mantidplot.py +++ b/Code/Mantid/MantidPlot/mantidplot.py @@ -17,11 +17,18 @@ from MantidFramework import WorkspaceProxy, WorkspaceGroup, MatrixWorkspace, mtd def workspace(name): return mtd[name] -def plotSpectrum(source, indices, error_bars = False, style = -1): +# Intercept qtiplot "plot" command and forward to plotSpectrum for a workspace +def plot(source, *args, **kwargs): + if isinstance(source,WorkspaceProxy): + return plotSpectrum(source, *args, **kwargs) + else: + return qti.app.plot(source, *args, **kwargs) + +def plotSpectrum(source, indices, error_bars = False, type = -1): workspace_names = __getWorkspaceNames(source) index_list = __getWorkspaceIndices(indices) if len(workspace_names) > 0 and len(index_list) > 0: - return __tryPlot(workspace_names, index_list, error_bars, style) + return __tryPlot(workspace_names, index_list, error_bars, type) else: return None diff --git a/Code/Mantid/MantidPlot/qtiplotrc.py b/Code/Mantid/MantidPlot/qtiplotrc.py index b6e4b0eb8c0ca4e5e172a54ff9a2c75b5ade1abe..9ea1e62da2f92a16e68bbac667b2446dfa8a2c9c 100644 --- a/Code/Mantid/MantidPlot/qtiplotrc.py +++ b/Code/Mantid/MantidPlot/qtiplotrc.py @@ -55,7 +55,7 @@ appImports = ( "clone", "setWindowName", "importImage", "setPreferences", - "plot", "plot3D", + "plot3D", "activeFolder", "rootFolder", "addFolder", "deleteFolder", "changeFolder", "copyFolder", "saveFolder", "appendProject", "saveProjectAs"