Changeset fe48fcc in sasview for sansguiframe/src/sans
- Timestamp:
- Aug 31, 2011 10:56:12 AM (13 years ago)
- Branches:
- master, 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, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 49a470d
- Parents:
- e4a703a
- Location:
- sansguiframe/src/sans/guiframe/local_perspectives/plotting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sansguiframe/src/sans/guiframe/local_perspectives/plotting/Plotter1D.py
re4a703a rfe48fcc 247 247 ## Set the view scale for all plots 248 248 self._onEVT_FUNC_PROPERTY() 249 self.toolbar.update() 249 250 250 251 -
sansguiframe/src/sans/guiframe/local_perspectives/plotting/Plotter2D.py
re4a703a rfe48fcc 20 20 from danse.common.plottools.PlotPanel import PlotPanel 21 21 from danse.common.plottools.plottables import Graph 22 from danse.common.plottools.LabelDialog import LabelDialog 22 23 from sans.guiframe.events import EVT_NEW_PLOT 23 24 from sans.guiframe.events import EVT_SLICER_PARS … … 198 199 self.graph.xaxis(data._xaxis, data._xunit) 199 200 self.graph.yaxis(data._yaxis, data._yunit) 200 self.graph.title(self.data2D.name) 201 if data.label == None: 202 data.label = data.name 203 self.graph.title(data.label) 201 204 self.graph.render(self) 202 205 self.draw_plot() … … 210 213 ylo > data.ymin and yhi < data.ymax): 211 214 self.subplot.set_xlim((xlo, xhi)) 212 self.subplot.set_ylim((ylo, yhi)) 215 self.subplot.set_ylim((ylo, yhi)) 216 else: 217 self.toolbar.update() 213 218 214 219 def onContextMenu(self, event): … … 298 303 wx.EVT_MENU(self, id, self._onEditSlicer) 299 304 slicerpop.AppendSeparator() 305 306 id = wx.NewId() 307 slicerpop.Append(id, '&Edit Label', 'Edit Label') 308 wx.EVT_MENU(self, id, self.onEditLabels) 309 slicerpop.AppendSeparator() 310 300 311 id = wx.NewId() 301 312 slicerpop.Append(id, '&2D Color Map') … … 307 318 pos = self.ScreenToClient(pos) 308 319 self.PopupMenu(slicerpop, pos) 309 320 321 def onEditLabels(self, event): 322 """ 323 Edit legend label 324 """ 325 selected_plot = self.plots[self.graph.selected_plottable] 326 label = selected_plot.label 327 dial = LabelDialog(None, -1, 'Change Label', label) 328 if dial.ShowModal() == wx.ID_OK: 329 newLabel = dial.getText() 330 selected_plot.label = newLabel 331 dial.Destroy() 332 ## render the graph 333 self.subplot.set_title(selected_plot.label) 334 self.subplot.figure.canvas.draw_idle() 335 310 336 def _onEditDetector(self, event): 311 337 """
Note: See TracChangeset
for help on using the changeset viewer.