Skip to content

Commit

Permalink
Revert "Change import of mantidplot to mantiplotpy in applicable plac…
Browse files Browse the repository at this point in the history
…es."

This reverts commit 432e2fd (Re #1037)
Back to mantidplot again. Re #4538.
  • Loading branch information
RussellTaylor committed Jan 17, 2012
1 parent 00a7b57 commit 7c9601a
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from MantidFramework import *
mtd.initialise()
from reduction.command_interface import *
import mantidplotpy
import mantidplot
IS_IN_MANTIDPLOT = True
except:
pass
Expand All @@ -23,6 +23,6 @@ def update(self):
self.log_text = ReductionSingleton().log_text
try:
for item in ReductionSingleton().output_workspaces:
mantidplotpy.plotSpectrum(item, 0, True)
mantidplot.plotSpectrum(item, 0, True)
except:
raise RuntimeError, "Could not plot resulting output\n %s" % sys.exc_value
raise RuntimeError, "Could not plot resulting output\n %s" % sys.exc_value
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# Check whether we are running in MantidPlot
IS_IN_MANTIDPLOT = False
try:
import mantidplotpy
import mantidplot
IS_IN_MANTIDPLOT = True
except:
pass
Expand Down Expand Up @@ -170,4 +170,4 @@ def reset(self):
# self.data_files = []
#



Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# Check whether we are running in MantidPlot
IS_IN_MANTIDPLOT = False
try:
import mantidplotpy
import mantidplot
IS_IN_MANTIDPLOT = True
except:
pass
Expand Down Expand Up @@ -157,4 +157,4 @@ def reset(self):
# self.data_files = []
#



Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# Check whether we are running in MantidPlot
IS_IN_MANTIDPLOT = False
try:
import mantidplotpy
import mantidplot
IS_IN_MANTIDPLOT = True
except:
pass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# Check whether we are running in MantidPlot
IS_IN_MANTIDPLOT = False
try:
import mantidplotpy
import mantidplot
IS_IN_MANTIDPLOT = True
except:
pass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# Check whether we are running in MantidPlot
IS_IN_MANTIDPLOT = False
try:
import mantidplotpy
import mantidplot
IS_IN_MANTIDPLOT = True
except:
pass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Check whether we are running in MantidPlot
IS_IN_MANTIDPLOT = False
try:
import mantidplotpy
import mantidplot
IS_IN_MANTIDPLOT = True
except:
pass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# Check whether we are running in MantidPlot
IS_IN_MANTIDPLOT = False
try:
import mantidplotpy
import mantidplot
IS_IN_MANTIDPLOT = True
except:
pass
Expand Down
14 changes: 7 additions & 7 deletions Code/Mantid/scripts/SANS/ISISCommandInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

# disable plotting if running outside Mantidplot
try:
import mantidplotpy
import mantidplot
except:
#this should happen when this is called from outside Mantidplot and only then, the result is that attempting to plot will raise an exception
pass
Expand Down Expand Up @@ -396,7 +396,7 @@ def CompWavRanges(wavelens, plot=True):
_refresh_singleton()

if plot:
mantidplotpy.plotSpectrum(calculated, 0)
mantidplot.plotSpectrum(calculated, 0)

#return just the workspace name of the full range
return calculated[0]
Expand Down Expand Up @@ -429,7 +429,7 @@ def PhiRanges(phis, plot=True):
_refresh_singleton()

if plot:
mantidplotpy.plotSpectrum(calculated, 0)
mantidplot.plotSpectrum(calculated, 0)

#return just the workspace name of the full range
return calculated[0]
Expand Down Expand Up @@ -575,16 +575,16 @@ def PlotResult(workspace, canvas=None):

try:
if numSpecs == 1:
graph = mantidplotpy.plotSpectrum(workspace,0)
graph = mantidplot.plotSpectrum(workspace,0)
else:
graph = mantidplotpy.importMatrixWorkspace(workspace.getName()).plotGraph2D()
graph = mantidplot.importMatrixWorkspace(workspace.getName()).plotGraph2D()

except NameError:
issueWarning('Plot functions are not available, is this being run from outside Mantidplot?')

if not canvas is None:
#we were given a handle to an existing graph, use it
mantidplotpy.mergePlots(canvas, graph)
mantidplot.mergePlots(canvas, graph)
graph = canvas

return graph
Expand Down Expand Up @@ -743,7 +743,7 @@ def FindBeamCentre(rlow, rupp, MaxIter = 10, xstart = None, ystart = None):
try :
if not graph_handle:
#once we have a plot it will be updated automatically when the workspaces are updated
graph_handle = mantidplotpy.plotSpectrum(centre.QUADS, 0)
graph_handle = mantidplot.plotSpectrum(centre.QUADS, 0)
graph_handle.activeLayer().setTitle(
centre.status_str(it, resX, resY))
except :
Expand Down

0 comments on commit 7c9601a

Please sign in to comment.