Skip to content

Commit

Permalink
Do plotBin for ws lists if they only have a single element.
Browse files Browse the repository at this point in the history
It should only raise an error if more than a single source is provided.
Refs #6955
  • Loading branch information
martyngigg committed Apr 29, 2013
1 parent 018e6d0 commit 7c389e4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Code/Mantid/MantidPlot/mantidplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,12 @@ def _callPlotBin(workspace, indexes, errors, graph_type):
indexes = [indexes]
return new_proxy(proxies.Graph,_qti.app.mantidUI.plotBin,wkspname, indexes, errors,graph_type)

if isinstance(source, list) or isinstance(source, tuple):
raise RuntimeError("Currently unable to handle multiple sources for bin plotting. Merging must be done by hand.")
else:
return _callPlotBin(source, indices, error_bars, graph_type)
if hasattr(source, "__len__"):
if len(source) > 1:
raise RuntimeError("Currently unable to handle multiple sources for bin plotting. Merging must be done by hand.")
else:
source = source[0]
return _callPlotBin(source, indices, error_bars, graph_type)

#-----------------------------------------------------------------------------
def stemPlot(source, index, power=None, startPoint=None, endPoint=None):
Expand Down

0 comments on commit 7c389e4

Please sign in to comment.