- Timestamp:
- Oct 24, 2017 7:11:43 AM (7 years ago)
- Children:
- f7b73d5
- Parents:
- 22e6043
- git-author:
- Adam Washington <adam.washington@…> (10/24/17 07:05:40)
- git-committer:
- Adam Washington <adam.washington@…> (10/24/17 07:11:43)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Corfunc/CorfuncPerspective.py
r22e6043 rf159d1b 28 28 self.fig = Figure(figsize=(width, height), dpi=dpi) 29 29 self.axes = self.fig.add_subplot(111) 30 # # We want the axes cleared every time plot() is called31 # self.axes.hold(False)32 self.axes.set_xscale("log")33 self.axes.set_yscale("log")34 35 # self.compute_initial_figure()36 30 37 31 FigureCanvas.__init__(self, self.fig) … … 43 37 # FigureCanvas.updateGeometry(self) 44 38 45 def sizeHint(self): 46 w, h = self.get_width_height() 47 return QSize(w, h) 48 49 def minimumSizeHint(self): 50 return QSize(10, 10) 39 self.data = None 40 self.qmin = None 41 self.qmax1 = None 42 self.qmax2 = None 43 self.extrap = None 44 45 def drawQSpace(self): 46 self.fig.clf() 47 48 self.axes = self.fig.add_subplot(111) 49 self.axes.set_xscale("log") 50 self.axes.set_yscale("log") 51 52 if self.data: 53 self.axes.plot(self.data.x, self.data.y) 54 if self.qmin: 55 self.axes.axvline(self.qmin) 56 if self.qmax1: 57 self.axes.axvline(self.qmax1) 58 if self.qmax2: 59 self.axes.axvline(self.qmax2) 60 if self.extrap: 61 print(self.extrap) 62 self.axes.plot(self.extrap.x, self.extrap.y) 63 64 self.draw() 65 66 67 68 # def sizeHint(self): 69 # w, h = self.get_width_height() 70 # return QSize(w, h) 71 72 # def minimumSizeHint(self): 73 # return QSize(10, 10) 51 74 52 75 … … 68 91 69 92 self._canvas = MyMplCanvas(self) 70 self.verticalLayout_7. addWidget(self._canvas)93 self.verticalLayout_7.insertWidget(0,self._canvas) 71 94 72 95 # Connect buttons to slots. … … 109 132 self.qMin.setValue(value) 110 133 self._calculator.lowerq = value 134 self._canvas.qmin = value 111 135 elif item.row() == W.W_QMAX: 112 136 value = float(self.model.item(W.W_QMAX).text()) 113 137 self.qMax1.setValue(value) 114 138 self._calculator.upperq = (value, self._calculator.upperq[1]) 139 self._canvas.qmax1 = value 115 140 elif item.row() == W.W_QCUTOFF: 116 141 value = float(self.model.item(W.W_QCUTOFF).text()) 117 142 self.qMax2.setValue(value) 118 143 self._calculator.upperq = (self._calculator.upperq[0], value) 144 self._canvas.qmax2 = value 119 145 elif item.row() == W.W_BACKGROUND: 120 146 value = float(self.model.item(W.W_BACKGROUND).text()) … … 123 149 else: 124 150 print("{} Changed".format(item)) 151 152 self._canvas.drawQSpace() 125 153 126 154 … … 132 160 self.porodSigma.setValue(params['sigma']) 133 161 print(params) 162 self._canvas.extrap = extrapolation 163 self._canvas.drawQSpace() 134 164 135 165 … … 182 212 self._calculator.set_data(data) 183 213 184 self._canvas.axes.plot(data.x, data.y) 214 self._canvas.data = data 215 self._canvas.drawQSpace() 185 216 186 217 # self.model.item(WIDGETS.W_FILENAME).setData(QtCoreQVariant(self._model_item.text()))
Note: See TracChangeset
for help on using the changeset viewer.