Skip to content
Snippets Groups Projects
Commit dd18e874 authored by Ewan Cook's avatar Ewan Cook
Browse files

refs #23260 add workspace plotting

parent 3b3ba3b0
No related merge requests found
......@@ -15,6 +15,8 @@ from Muon.GUI.ElementalAnalysis.LoadWidget.load_model import LoadModel, CoLoadMo
from Muon.GUI.Common.load_widget.load_view import LoadView
from Muon.GUI.Common.load_widget.load_presenter import LoadPresenter
import mantid.simpleapi as mantid
class ElementalAnalysisGui(QtGui.QMainWindow):
def __init__(self, parent=None):
......@@ -74,6 +76,8 @@ class ElementalAnalysisGui(QtGui.QMainWindow):
p = self.plotting.add_subplot(name)
p.set_title(name)
self.plotting.update_canvas()
c = mantid.CreateSampleWorkspace()
self.plotting.plot_workspace(name, c)
self.plot_incr += 1
def del_plot(self):
......
......@@ -11,6 +11,9 @@ class PlotPresenter(object):
def add_subplot(self, name):
return self.view.add_subplot(name)
def plot_workspace(self, name, workspace):
self.view.plot_workspace(name, workspace)
def remove_subplot(self, name):
self.view.remove_subplot(name)
......
......@@ -2,8 +2,7 @@ from Muon.GUI.ElementalAnalysis.Plotting import plotting_utils as putils
from Muon.GUI.ElementalAnalysis.Plotting.AxisChanger.axis_changer_presenter import AxisChangerPresenter
from Muon.GUI.ElementalAnalysis.Plotting.AxisChanger.axis_changer_view import AxisChangerView
#from mantid import plots
from mantid import plots
from collections import OrderedDict
......@@ -102,6 +101,11 @@ class PlotView(QtGui.QWidget):
self.plot_selector.clear()
self.plot_selector.addItems(self.plots.keys())
def plot_workspace(self, name, workspace):
subplot = self.plots[name]
plots.plotfunctions.errorbar(subplot, workspace, specNum=1)
self.canvas.draw()
def get_subplot(self, name):
return self.plots[name]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment