Changeset 5251ec6 in sasview for src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter2D.py
- Timestamp:
- Oct 11, 2018 12:20:56 PM (5 years ago)
- Branches:
- master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1249
- Children:
- 98b9f32
- Parents:
- 67ed543
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter2D.py
r3e5648b r5251ec6 11 11 12 12 13 import wx14 13 import sys 15 14 import math 15 import logging 16 17 import wx 16 18 import numpy as np 17 import logging 19 from matplotlib.font_manager import FontProperties 20 18 21 from sas.sasgui.plottools.PlotPanel import PlotPanel 19 22 from sas.sasgui.plottools.plottables import Graph … … 24 27 from sas.sasgui.guiframe.events import SlicerEvent 25 28 from sas.sasgui.guiframe.utils import PanelMenu 26 from sas.sasgui.guiframe.local_perspectives.plotting.binder import BindArtist 27 from Plotter1D import ModelPanel1D 29 from sas.sasgui.guiframe.local_perspectives.plotting.binder import BindArtist 28 30 from sas.sasgui.plottools.toolbar import NavigationToolBar 29 from matplotlib.font_manager import FontProperties 30 from graphAppearance import graphAppearance 31 32 from .Plotter1D import ModelPanel1D 33 from .graphAppearance import graphAppearance 34 31 35 (InternalEvent, EVT_INTERNAL) = wx.lib.newevent.NewEvent() 32 36 … … 41 45 def find_key(dic, val): 42 46 """return the key of dictionary dic given the value""" 43 return [k for k, v in dic.ite ritems() if v == val][0]47 return [k for k, v in dic.items() if v == val][0] 44 48 45 49 … … 200 204 ## Update self.data2d with the current plot 201 205 self.data2D = data 202 if data.id in self.plots .keys():206 if data.id in self.plots: 203 207 #replace 204 208 xlo, xhi = self.subplot.get_xlim() … … 326 330 slicerpop.Append(wx_id, item[0], item[1]) 327 331 wx.EVT_MENU(self, wx_id, item[2]) 328 except :332 except Exception as exc: 329 333 msg = "ModelPanel1D.onContextMenu: " 330 msg += "bad menu item %s" % sys.exc_value334 msg += "bad menu item %s" % exc 331 335 wx.PostEvent(self.parent, StatusEvent(status=msg)) 332 336 slicerpop.AppendSeparator() … … 447 451 448 452 """ 449 import detector_dialog453 from . import detector_dialog 450 454 dialog = detector_dialog.DetectorDialog(self, -1, base=self.parent, 451 455 reset_zmin_ctl=self.default_zmin_ctl, … … 630 634 """ 631 635 if self.slicer is not None: 632 from parameters_panel_slicer import SlicerParameterPanel636 from .parameters_panel_slicer import SlicerParameterPanel 633 637 dialog = SlicerParameterPanel(self, -1, "Slicer Parameters") 634 638 dialog.set_slicer(self.slicer.__class__.__name__, … … 641 645 Perform sector averaging on Q and draw sector slicer 642 646 """ 643 from SectorSlicer import SectorInteractor647 from .SectorSlicer import SectorInteractor 644 648 self.onClearSlicer(event) 645 649 wx.PostEvent(self, InternalEvent(slicer=SectorInteractor)) … … 649 653 Perform sector averaging on Phi and draw annulus slicer 650 654 """ 651 from AnnulusSlicer import AnnulusInteractor655 from .AnnulusSlicer import AnnulusInteractor 652 656 self.onClearSlicer(event) 653 657 wx.PostEvent(self, InternalEvent(slicer=AnnulusInteractor)) … … 657 661 """ 658 662 from sas.sasgui.guiframe.gui_manager import MDIFrame 659 from boxSum import BoxSum663 from .boxSum import BoxSum 660 664 self.onClearSlicer(event) 661 665 self.slicer_z += 1 … … 668 672 params = self.slicer.get_params() 669 673 ## Create a new panel to display results of summation of Data2D 670 from parameters_panel_boxsum import SlicerPanel674 from .parameters_panel_boxsum import SlicerPanel 671 675 win = MDIFrame(self.parent, None, 'None', (100, 200)) 672 676 new_panel = SlicerPanel(parent=win, id=-1, … … 699 703 :param event: wx.menu event 700 704 """ 701 from boxSlicer import BoxInteractorX705 from .boxSlicer import BoxInteractorX 702 706 self.onClearSlicer(event) 703 707 wx.PostEvent(self, InternalEvent(slicer=BoxInteractorX)) … … 711 715 712 716 """ 713 from boxSlicer import BoxInteractorY717 from .boxSlicer import BoxInteractorY 714 718 self.onClearSlicer(event) 715 719 wx.PostEvent(self, InternalEvent(slicer=BoxInteractorY))
Note: See TracChangeset
for help on using the changeset viewer.