Changeset 8cb6cd6 in sasview for src/sas/qtgui/Plotter.py
- Timestamp:
- Jul 12, 2016 6:44:53 AM (8 years ago)
- Branches:
- ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- e3ae090
- Parents:
- a95260d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Plotter.py
ra95260d r8cb6cd6 1 import logging 2 1 3 from PyQt4 import QtGui 2 4 … … 9 11 import matplotlib.pyplot as plt 10 12 13 import PlotHelper 14 11 15 class Plotter(QtGui.QDialog): 12 16 def __init__(self, parent=None): 13 17 super(Plotter, self).__init__(parent) 18 19 # Required for the communicator 20 self.parent = parent 14 21 15 22 # a figure instance to plot on … … 39 46 self._ax = self.figure.add_subplot(self._current_plot) 40 47 48 # Notify the helper 49 PlotHelper.addPlot(self) 50 # Notify the listeners 51 self.parent.communicator.activeGraphsSignal.emit(PlotHelper.currentPlots()) 41 52 42 53 def data(self, data=None): 43 """ 44 """ 54 """ data setter """ 45 55 self._data = data 46 56 47 57 def title(self, title=""): 48 """ 49 """ 58 """ title setter """ 50 59 self._title = title 51 60 52 61 def id(self, id=""): 53 """ 54 """ 62 """ id setter """ 55 63 self._id = id 56 64 57 65 def x_label(self, xlabel=""): 58 """ 59 """ 66 """ x-label setter """ 60 67 self._xlabel = xlabel 61 68 62 69 def y_label(self, ylabel=""): 63 """ 64 """ 70 """ y-label setter """ 65 71 self._ylabel = ylabel 66 72 67 73 def clean(self): 68 74 """ 75 Redraw the graph 69 76 """ 70 77 self.figure.delaxes(self._ax) … … 73 80 def plot(self): 74 81 """ 75 plot self._data82 Plot self._data 76 83 """ 77 84 # create an axis … … 92 99 # refresh canvas 93 100 self.canvas.draw() 101 102 def closeEvent(self, event): 103 """ 104 Overwrite the close event adding helper notification 105 """ 106 # Please remove me from your database. 107 PlotHelper.deletePlot(PlotHelper.idOfPlot(self)) 108 # Notify the listeners 109 self.parent.communicator.activeGraphsSignal.emit(PlotHelper.currentPlots()) 110 event.accept() 111
Note: See TracChangeset
for help on using the changeset viewer.