Index: _modules/sas/guiframe/local_perspectives/plotting/AnnulusSlicer.html
===================================================================
--- _modules/sas/guiframe/local_perspectives/plotting/AnnulusSlicer.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
+++ _modules/sas/guiframe/local_perspectives/plotting/AnnulusSlicer.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
@@ -0,0 +1,708 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>sas.guiframe.local_perspectives.plotting.AnnulusSlicer &mdash; SasView 3.0.0 documentation</title>
+    
+    <link rel="stylesheet" href="../../../../../_static/default.css" type="text/css" />
+    <link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '../../../../../',
+        VERSION:     '3.0.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="../../../../../_static/jquery.js"></script>
+    <script type="text/javascript" src="../../../../../_static/underscore.js"></script>
+    <script type="text/javascript" src="../../../../../_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <link rel="top" title="SasView 3.0.0 documentation" href="../../../../../index.html" />
+    <link rel="up" title="sas.guiframe" href="../../../guiframe.html" /> 
+  </head>
+  <body>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" accesskey="U">sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>  
+
+    <div class="document">
+      <div class="documentwrapper">
+        <div class="bodywrapper">
+          <div class="body">
+            
+  <h1>Source code for sas.guiframe.local_perspectives.plotting.AnnulusSlicer</h1><div class="highlight"><pre>
+<span class="c">#TODO: the line slicer should listen to all 2DREFRESH events, get the data and slice it</span>
+<span class="c">#      before pushing a new 1D data update.</span>
+
+<span class="c">#</span>
+<span class="c">#TODO: NEED MAJOR REFACTOR</span>
+<span class="c">#</span>
+
+<span class="kn">import</span> <span class="nn">math</span>
+<span class="kn">import</span> <span class="nn">wx</span>
+<span class="c">#from copy import deepcopy </span>
+<span class="c"># Debug printout</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">NewPlotEvent</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">StatusEvent</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">SlicerParameterEvent</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">EVT_SLICER_PARS</span>
+<span class="kn">from</span> <span class="nn">BaseInteractor</span> <span class="kn">import</span> <span class="n">_BaseInteractor</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.dataFitting</span> <span class="kn">import</span> <span class="n">Data1D</span>
+
+<div class="viewcode-block" id="AnnulusInteractor"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.AnnulusInteractor">[docs]</a><span class="k">class</span> <span class="nc">AnnulusInteractor</span><span class="p">(</span><span class="n">_BaseInteractor</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Select an annulus through a 2D plot.</span>
+<span class="sd">    This interactor is used to average 2D data  with the region </span>
+<span class="sd">    defined by 2 radius.</span>
+<span class="sd">    this class is defined by 2 Ringinterators.</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s">&#39;black&#39;</span><span class="p">,</span> <span class="n">zorder</span><span class="o">=</span><span class="mi">3</span><span class="p">):</span>
+        
+        <span class="n">_BaseInteractor</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="n">color</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">markers</span> <span class="o">=</span> <span class="p">[]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">axes</span> <span class="o">=</span> <span class="n">axes</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span> <span class="o">=</span> <span class="n">base</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">qmax</span> <span class="o">=</span> <span class="nb">min</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmax</span><span class="p">),</span>
+                        <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmin</span><span class="p">))</span>  <span class="c">#must be positive</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">connect</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">connect</span>
+    
+        <span class="c">## Number of points on the plot</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">nbins</span> <span class="o">=</span> <span class="mi">20</span>
+        <span class="c">#Cursor position of Rings (Left(-1) or Right(1))</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">xmaxd</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmax</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">xmind</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmin</span>
+
+        <span class="k">if</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">xmaxd</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">xmind</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">sign</span> <span class="o">=</span> <span class="mi">1</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">sign</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span>
+        <span class="c"># Inner circle</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">inner_circle</span> <span class="o">=</span> <span class="n">RingInteractor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">subplot</span><span class="p">,</span>
+                                            <span class="n">zorder</span><span class="o">=</span><span class="n">zorder</span><span class="p">,</span>
+                                            <span class="n">r</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">qmax</span><span class="o">/</span><span class="mf">2.0</span><span class="p">,</span> <span class="n">sign</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">sign</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">inner_circle</span><span class="o">.</span><span class="n">qmax</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">qmax</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span> <span class="o">=</span> <span class="n">RingInteractor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">subplot</span><span class="p">,</span>
+                                           <span class="n">zorder</span><span class="o">=</span><span class="n">zorder</span><span class="o">+</span><span class="mi">1</span><span class="p">,</span> <span class="n">r</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">qmax</span><span class="o">/</span><span class="mf">1.8</span><span class="p">,</span>
+                                           <span class="n">sign</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">sign</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">qmax</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">qmax</span> <span class="o">*</span> <span class="mf">1.2</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_post_data</span><span class="p">()</span>
+        
+        <span class="c"># Bind to slice parameter events</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">EVT_SLICER_PARS</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_onEVT_SLICER_PARS</span><span class="p">)</span>
+        
+    <span class="k">def</span> <span class="nf">_onEVT_SLICER_PARS</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        receive an event containing parameters values to reset the slicer</span>
+<span class="sd">        </span>
+<span class="sd">        :param event: event of type SlicerParameterEvent with params as </span>
+<span class="sd">            attribute</span>
+<span class="sd">            </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="p">,</span>
+                     <span class="n">StatusEvent</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="s">&quot;AnnulusSlicer._onEVT_SLICER_PARS&quot;</span><span class="p">))</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">Skip</span><span class="p">()</span>
+        <span class="k">if</span> <span class="n">event</span><span class="o">.</span><span class="n">type</span> <span class="o">==</span> <span class="bp">self</span><span class="o">.</span><span class="n">__class__</span><span class="o">.</span><span class="n">__name__</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">set_params</span><span class="p">(</span><span class="n">event</span><span class="o">.</span><span class="n">params</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+
+<div class="viewcode-block" id="AnnulusInteractor.set_layer"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.AnnulusInteractor.set_layer">[docs]</a>    <span class="k">def</span> <span class="nf">set_layer</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">n</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Allow adding plot to the same panel</span>
+<span class="sd">        </span>
+<span class="sd">        :param n: the number of layer</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">layernum</span> <span class="o">=</span> <span class="n">n</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        </div>
+<div class="viewcode-block" id="AnnulusInteractor.clear"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.AnnulusInteractor.clear">[docs]</a>    <span class="k">def</span> <span class="nf">clear</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Clear the slicer and all connected events related to this slicer</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">clear_markers</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">inner_circle</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">connect</span><span class="o">.</span><span class="n">clearall</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">Unbind</span><span class="p">(</span><span class="n">EVT_SLICER_PARS</span><span class="p">)</span>
+        </div>
+<div class="viewcode-block" id="AnnulusInteractor.update"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.AnnulusInteractor.update">[docs]</a>    <span class="k">def</span> <span class="nf">update</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Respond to changes in the model by recalculating the profiles and</span>
+<span class="sd">        resetting the widgets.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># Update locations        </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">inner_circle</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        </div>
+<div class="viewcode-block" id="AnnulusInteractor.save"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.AnnulusInteractor.save">[docs]</a>    <span class="k">def</span> <span class="nf">save</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Remember the roughness for this layer and the next so that we</span>
+<span class="sd">        can restore on Esc.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">freeze_axes</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">inner_circle</span><span class="o">.</span><span class="n">save</span><span class="p">(</span><span class="n">ev</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">save</span><span class="p">(</span><span class="n">ev</span><span class="p">)</span>
+</div>
+    <span class="k">def</span> <span class="nf">_post_data</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">nbins</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Uses annulus parameters to plot averaged data into 1D data.</span>
+<span class="sd">        </span>
+<span class="sd">        :param nbins: the number of points to plot </span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c">#Data to average</span>
+        <span class="n">data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span>
+        <span class="c"># If we have no data, just return</span>
+        <span class="k">if</span> <span class="n">data</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="k">return</span>
+        
+        <span class="kn">from</span> <span class="nn">sas.dataloader.manipulations</span> <span class="kn">import</span> <span class="n">Ring</span>
+        <span class="n">rmin</span> <span class="o">=</span> <span class="nb">min</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">inner_circle</span><span class="o">.</span><span class="n">get_radius</span><span class="p">()),</span>
+                  <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">get_radius</span><span class="p">()))</span>
+        <span class="n">rmax</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">inner_circle</span><span class="o">.</span><span class="n">get_radius</span><span class="p">()),</span>
+                   <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">get_radius</span><span class="p">()))</span>
+        <span class="c">#if the user does not specify the numbers of points to plot </span>
+        <span class="c"># the default number will be nbins= 20</span>
+        <span class="k">if</span> <span class="n">nbins</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">nbins</span> <span class="o">=</span> <span class="mi">20</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">nbins</span> <span class="o">=</span> <span class="n">nbins</span>
+        <span class="c">## create the data1D Q average of data2D    </span>
+        <span class="n">sect</span> <span class="o">=</span> <span class="n">Ring</span><span class="p">(</span><span class="n">r_min</span><span class="o">=</span><span class="n">rmin</span><span class="p">,</span> <span class="n">r_max</span><span class="o">=</span><span class="n">rmax</span><span class="p">,</span> <span class="n">nbins</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">nbins</span><span class="p">)</span>
+        <span class="n">sector</span> <span class="o">=</span> <span class="n">sect</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="p">)</span>
+    
+        <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">sector</span><span class="p">,</span> <span class="s">&quot;dxl&quot;</span><span class="p">):</span>
+            <span class="n">dxl</span> <span class="o">=</span> <span class="n">sector</span><span class="o">.</span><span class="n">dxl</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="n">dxl</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">sector</span><span class="p">,</span> <span class="s">&quot;dxw&quot;</span><span class="p">):</span>
+            <span class="n">dxw</span> <span class="o">=</span> <span class="n">sector</span><span class="o">.</span><span class="n">dxw</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="n">dxw</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="n">new_plot</span> <span class="o">=</span> <span class="n">Data1D</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="p">(</span><span class="n">sector</span><span class="o">.</span><span class="n">x</span> <span class="o">-</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="p">)</span> <span class="o">*</span> <span class="mi">180</span><span class="o">/</span><span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="p">,</span>
+                          <span class="n">y</span><span class="o">=</span><span class="n">sector</span><span class="o">.</span><span class="n">y</span><span class="p">,</span> <span class="n">dy</span><span class="o">=</span><span class="n">sector</span><span class="o">.</span><span class="n">dy</span><span class="p">)</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">dxl</span> <span class="o">=</span> <span class="n">dxl</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">dxw</span> <span class="o">=</span> <span class="n">dxw</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="s">&quot;AnnulusPhi&quot;</span> <span class="o">+</span><span class="s">&quot;(&quot;</span><span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">name</span><span class="o">+</span><span class="s">&quot;)&quot;</span>
+        
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">source</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">source</span>
+        <span class="c">#new_plot.info=self.base.data2D.info</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">interactive</span> <span class="o">=</span> <span class="bp">True</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">detector</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">detector</span>
+        <span class="c"># If the data file does not tell us what the axes are, just assume...</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">xaxis</span><span class="p">(</span><span class="s">&quot;</span><span class="se">\\</span><span class="s">rm{\phi}&quot;</span><span class="p">,</span> <span class="s">&#39;degrees&#39;</span><span class="p">)</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">yaxis</span><span class="p">(</span><span class="s">&quot;</span><span class="se">\\</span><span class="s">rm{Intensity} &quot;</span><span class="p">,</span> <span class="s">&quot;cm^{-1}&quot;</span><span class="p">)</span>
+        <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="s">&quot;scale&quot;</span><span class="p">)</span> <span class="ow">and</span> <span class="n">data</span><span class="o">.</span><span class="n">scale</span> <span class="o">==</span> <span class="s">&#39;linear&#39;</span> <span class="ow">and</span> \
+                <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">name</span><span class="o">.</span><span class="n">count</span><span class="p">(</span><span class="s">&quot;Residuals&quot;</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
+            <span class="n">new_plot</span><span class="o">.</span><span class="n">ytransform</span> <span class="o">=</span> <span class="s">&#39;y&#39;</span>
+            <span class="n">new_plot</span><span class="o">.</span><span class="n">yaxis</span><span class="p">(</span><span class="s">&quot;</span><span class="se">\\</span><span class="s">rm{Residuals} &quot;</span><span class="p">,</span> <span class="s">&quot;/&quot;</span><span class="p">)</span>
+
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">group_id</span> <span class="o">=</span> <span class="s">&quot;AnnulusPhi&quot;</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">name</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">id</span> <span class="o">=</span> <span class="s">&quot;AnnulusPhi&quot;</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">name</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">is_data</span><span class="o">=</span> <span class="bp">True</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">xtransform</span> <span class="o">=</span> <span class="s">&quot;x&quot;</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">ytransform</span> <span class="o">=</span> <span class="s">&quot;y&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">update_theory</span><span class="p">(</span><span class="n">data_id</span><span class="o">=</span><span class="n">data</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> <span class="n">theory</span><span class="o">=</span><span class="n">new_plot</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> <span class="n">NewPlotEvent</span><span class="p">(</span><span class="n">plot</span><span class="o">=</span><span class="n">new_plot</span><span class="p">,</span>
+                                                 <span class="n">title</span><span class="o">=</span><span class="s">&quot;AnnulusPhi&quot;</span><span class="p">))</span>
+        
+<div class="viewcode-block" id="AnnulusInteractor.moveend"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.AnnulusInteractor.moveend">[docs]</a>    <span class="k">def</span> <span class="nf">moveend</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Called when any dragging motion ends.</span>
+<span class="sd">        Post an event (type =SlicerParameterEvent)</span>
+<span class="sd">        to plotter 2D with a copy  slicer parameters</span>
+<span class="sd">        Call  _post_data method</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">thaw_axes</span><span class="p">()</span>
+        <span class="c"># Post parameters to plotter 2D</span>
+        <span class="n">event</span> <span class="o">=</span> <span class="n">SlicerParameterEvent</span><span class="p">()</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">type</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">__class__</span><span class="o">.</span><span class="n">__name__</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">params</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_params</span><span class="p">()</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="p">,</span> <span class="n">event</span><span class="p">)</span>
+        <span class="c"># create a 1D data plot</span>
+        <span class="c">#self._post_data()</span>
+            </div>
+<div class="viewcode-block" id="AnnulusInteractor.restore"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.AnnulusInteractor.restore">[docs]</a>    <span class="k">def</span> <span class="nf">restore</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Restore the roughness for this layer.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">inner_circle</span><span class="o">.</span><span class="n">restore</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">restore</span><span class="p">()</span>
+</div>
+<div class="viewcode-block" id="AnnulusInteractor.move"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.AnnulusInteractor.move">[docs]</a>    <span class="k">def</span> <span class="nf">move</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Process move to a new position, making sure that the move is allowed.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">pass</span>
+        </div>
+<div class="viewcode-block" id="AnnulusInteractor.set_cursor"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.AnnulusInteractor.set_cursor">[docs]</a>    <span class="k">def</span> <span class="nf">set_cursor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">):</span>
+        <span class="k">pass</span>
+        </div>
+<div class="viewcode-block" id="AnnulusInteractor.get_params"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.AnnulusInteractor.get_params">[docs]</a>    <span class="k">def</span> <span class="nf">get_params</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Store a copy of values of parameters of the slicer into a dictionary.</span>
+<span class="sd">        </span>
+<span class="sd">        :return params: the dictionary created</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">params</span> <span class="o">=</span> <span class="p">{}</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;inner_radius&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">inner_circle</span><span class="o">.</span><span class="n">_inner_mouse_x</span><span class="p">)</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;outer_radius&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">_inner_mouse_x</span><span class="p">)</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;nbins&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">nbins</span>
+        <span class="k">return</span> <span class="n">params</span>
+    </div>
+<div class="viewcode-block" id="AnnulusInteractor.set_params"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.AnnulusInteractor.set_params">[docs]</a>    <span class="k">def</span> <span class="nf">set_params</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">params</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Receive a dictionary and reset the slicer with values contained </span>
+<span class="sd">        in the values of the dictionary.</span>
+<span class="sd">        </span>
+<span class="sd">        :param params: a dictionary containing name of slicer parameters and </span>
+<span class="sd">            values the user assigned to the slicer.</span>
+<span class="sd">            </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">inner</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="n">params</span><span class="p">[</span><span class="s">&quot;inner_radius&quot;</span><span class="p">])</span>
+        <span class="n">outer</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="n">params</span><span class="p">[</span><span class="s">&quot;outer_radius&quot;</span><span class="p">])</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">nbins</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">params</span><span class="p">[</span><span class="s">&quot;nbins&quot;</span><span class="p">])</span>
+        <span class="c">## Update the picture</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">inner_circle</span><span class="o">.</span><span class="n">set_cursor</span><span class="p">(</span><span class="n">inner</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">inner_circle</span><span class="o">.</span><span class="n">_inner_mouse_y</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">set_cursor</span><span class="p">(</span><span class="n">outer</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">_inner_mouse_y</span><span class="p">)</span>
+        <span class="c">## Post the data given the nbins entered by the user </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_post_data</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">nbins</span><span class="p">)</span>
+        </div>
+<div class="viewcode-block" id="AnnulusInteractor.freeze_axes"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.AnnulusInteractor.freeze_axes">[docs]</a>    <span class="k">def</span> <span class="nf">freeze_axes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">freeze_axes</span><span class="p">()</span>
+        </div>
+<div class="viewcode-block" id="AnnulusInteractor.thaw_axes"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.AnnulusInteractor.thaw_axes">[docs]</a>    <span class="k">def</span> <span class="nf">thaw_axes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">thaw_axes</span><span class="p">()</span>
+</div>
+<div class="viewcode-block" id="AnnulusInteractor.draw"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.AnnulusInteractor.draw">[docs]</a>    <span class="k">def</span> <span class="nf">draw</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">draw</span><span class="p">()</span>
+
+        </div></div>
+<div class="viewcode-block" id="RingInteractor"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.RingInteractor">[docs]</a><span class="k">class</span> <span class="nc">RingInteractor</span><span class="p">(</span><span class="n">_BaseInteractor</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">     Draw a ring Given a radius </span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s">&#39;black&#39;</span><span class="p">,</span> <span class="n">zorder</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">r</span><span class="o">=</span><span class="mf">1.0</span><span class="p">,</span> <span class="n">sign</span><span class="o">=</span><span class="mi">1</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        :param: the color of the line that defined the ring</span>
+<span class="sd">        :param r: the radius of the ring</span>
+<span class="sd">        :param sign: the direction of motion the the marker </span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">_BaseInteractor</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="n">color</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">markers</span> <span class="o">=</span> <span class="p">[]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">axes</span> <span class="o">=</span> <span class="n">axes</span>
+        <span class="c"># Current radius of the ring</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_inner_mouse_x</span> <span class="o">=</span> <span class="n">r</span>
+        <span class="c">#Value of the center of the ring</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_inner_mouse_y</span> <span class="o">=</span> <span class="mi">0</span>
+        <span class="c"># previous value of that radius</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_inner_save_x</span>  <span class="o">=</span> <span class="n">r</span>
+        <span class="c">#Save value of the center of the ring</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_inner_save_y</span>  <span class="o">=</span> <span class="mi">0</span>
+        <span class="c">#Class instantiating RingIterator class</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span> <span class="o">=</span> <span class="n">base</span>
+        <span class="c">#the direction of the motion of the marker</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">sign</span> <span class="o">=</span> <span class="n">sign</span>
+        <span class="c">## Create a marker </span>
+        <span class="k">try</span><span class="p">:</span>
+            <span class="c"># Inner circle marker</span>
+            <span class="n">x_value</span> <span class="o">=</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">sign</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_inner_mouse_x</span><span class="p">)]</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">inner_marker</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">x_value</span><span class="p">,</span>
+                                               <span class="p">[</span><span class="mi">0</span><span class="p">],</span>
+                                                <span class="n">linestyle</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">,</span>
+                                          <span class="n">marker</span><span class="o">=</span><span class="s">&#39;s&#39;</span><span class="p">,</span> <span class="n">markersize</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span>
+                                          <span class="n">color</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">color</span><span class="p">,</span> <span class="n">alpha</span><span class="o">=</span><span class="mf">0.6</span><span class="p">,</span>
+                                          <span class="n">pickradius</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s">&quot;pick&quot;</span><span class="p">,</span> 
+                                          <span class="n">zorder</span><span class="o">=</span><span class="n">zorder</span><span class="p">,</span>
+                                          <span class="n">visible</span><span class="o">=</span><span class="bp">True</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+        <span class="k">except</span><span class="p">:</span>
+            <span class="n">x_value</span> <span class="o">=</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">sign</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_inner_mouse_x</span><span class="p">)]</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">inner_marker</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">x_value</span><span class="p">,</span>
+                                               <span class="p">[</span><span class="mi">0</span><span class="p">],</span> 
+                                               <span class="n">linestyle</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">,</span>
+                                          <span class="n">marker</span><span class="o">=</span><span class="s">&#39;s&#39;</span><span class="p">,</span> <span class="n">markersize</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span>
+                                          <span class="n">color</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">color</span><span class="p">,</span> <span class="n">alpha</span><span class="o">=</span><span class="mf">0.6</span><span class="p">,</span>
+                                          <span class="n">label</span><span class="o">=</span><span class="s">&quot;pick&quot;</span><span class="p">,</span> 
+                                          <span class="n">visible</span><span class="o">=</span><span class="bp">True</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+            <span class="n">message</span>  <span class="o">=</span> <span class="s">&quot;</span><span class="se">\n</span><span class="s">THIS PROTOTYPE NEEDS THE LATEST&quot;</span>
+            <span class="n">message</span> <span class="o">+=</span> <span class="s">&quot; VERSION OF MATPLOTLIB</span><span class="se">\n</span><span class="s">&quot;</span>
+            <span class="n">message</span> <span class="o">+=</span> <span class="s">&quot;Get the SVN version that is at &quot;</span>
+            <span class="n">message</span> <span class="o">+=</span> <span class="s">&quot; least as recent as June 1, 2007&quot;</span>
+            
+            <span class="n">owner</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">parent</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="n">owner</span><span class="p">,</span> 
+                         <span class="n">StatusEvent</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="s">&quot;AnnulusSlicer: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">message</span><span class="p">))</span>
+            
+        <span class="c"># Draw a circle </span>
+        <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">inner_circle</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">plot</span><span class="p">([],</span> <span class="p">[],</span>
+                                      <span class="n">linestyle</span><span class="o">=</span><span class="s">&#39;-&#39;</span><span class="p">,</span> <span class="n">marker</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">,</span>
+                                      <span class="n">color</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">color</span><span class="p">)</span>
+        <span class="c"># the number of points that make the ring line</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">npts</span> <span class="o">=</span> <span class="mi">40</span>
+            
+        <span class="bp">self</span><span class="o">.</span><span class="n">connect_markers</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">inner_marker</span><span class="p">])</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+
+<div class="viewcode-block" id="RingInteractor.set_layer"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.RingInteractor.set_layer">[docs]</a>    <span class="k">def</span> <span class="nf">set_layer</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">n</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Allow adding plot to the same panel</span>
+<span class="sd">         </span>
+<span class="sd">        :param n: the number of layer</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">layernum</span> <span class="o">=</span> <span class="n">n</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        </div>
+<div class="viewcode-block" id="RingInteractor.clear"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.RingInteractor.clear">[docs]</a>    <span class="k">def</span> <span class="nf">clear</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Clear the slicer and all connected events related to this slicer</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">clear_markers</span><span class="p">()</span>
+        <span class="k">try</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">inner_marker</span><span class="o">.</span><span class="n">remove</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">inner_circle</span><span class="o">.</span><span class="n">remove</span><span class="p">()</span>
+        <span class="k">except</span><span class="p">:</span>
+            <span class="c"># Old version of matplotlib</span>
+            <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">lines</span><span class="p">)):</span>
+                <span class="k">del</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">lines</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
+        </div>
+<div class="viewcode-block" id="RingInteractor.get_radius"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.RingInteractor.get_radius">[docs]</a>    <span class="k">def</span> <span class="nf">get_radius</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        :return self._inner_mouse_x: the current radius of the ring</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_inner_mouse_x</span>
+        </div>
+<div class="viewcode-block" id="RingInteractor.update"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.RingInteractor.update">[docs]</a>    <span class="k">def</span> <span class="nf">update</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Draw the new roughness on the graph.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># Plot inner circle</span>
+        <span class="n">x</span> <span class="o">=</span> <span class="p">[]</span>
+        <span class="n">y</span> <span class="o">=</span> <span class="p">[]</span>
+        <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">npts</span><span class="p">):</span>
+            <span class="n">phi</span> <span class="o">=</span> <span class="mf">2.0</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span> <span class="o">/</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">npts</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> <span class="o">*</span> <span class="n">i</span>
+            
+            <span class="n">xval</span> <span class="o">=</span> <span class="mf">1.0</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">_inner_mouse_x</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">cos</span><span class="p">(</span><span class="n">phi</span><span class="p">)</span> 
+            <span class="n">yval</span> <span class="o">=</span> <span class="mf">1.0</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">_inner_mouse_x</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">sin</span><span class="p">(</span><span class="n">phi</span><span class="p">)</span> 
+            
+            <span class="n">x</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">xval</span><span class="p">)</span>
+            <span class="n">y</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">yval</span><span class="p">)</span>
+            
+        <span class="bp">self</span><span class="o">.</span><span class="n">inner_marker</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">xdata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">sign</span><span class="o">*</span><span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_inner_mouse_x</span><span class="p">)],</span>
+                              <span class="n">ydata</span><span class="o">=</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">inner_circle</span><span class="o">.</span><span class="n">set_data</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">)</span>        
+</div>
+<div class="viewcode-block" id="RingInteractor.save"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.RingInteractor.save">[docs]</a>    <span class="k">def</span> <span class="nf">save</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Remember the roughness for this layer and the next so that we</span>
+<span class="sd">        can restore on Esc.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_inner_save_x</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_inner_mouse_x</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_inner_save_y</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_inner_mouse_y</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">freeze_axes</span><span class="p">()</span>
+</div>
+<div class="viewcode-block" id="RingInteractor.moveend"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.RingInteractor.moveend">[docs]</a>    <span class="k">def</span> <span class="nf">moveend</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Called after a dragging motion</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">moveend</span><span class="p">(</span><span class="n">ev</span><span class="p">)</span>
+            </div>
+<div class="viewcode-block" id="RingInteractor.restore"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.RingInteractor.restore">[docs]</a>    <span class="k">def</span> <span class="nf">restore</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Restore the roughness for this layer.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_inner_mouse_x</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_inner_save_x</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_inner_mouse_y</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_inner_save_y</span>
+</div>
+<div class="viewcode-block" id="RingInteractor.move"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.RingInteractor.move">[docs]</a>    <span class="k">def</span> <span class="nf">move</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Process move to a new position, making sure that the move is allowed.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_inner_mouse_x</span> <span class="o">=</span> <span class="n">x</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_inner_mouse_y</span> <span class="o">=</span> <span class="n">y</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        </div>
+<div class="viewcode-block" id="RingInteractor.set_cursor"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.RingInteractor.set_cursor">[docs]</a>    <span class="k">def</span> <span class="nf">set_cursor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        draw the ring given x, y value </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">move</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="bp">None</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        
+        </div>
+<div class="viewcode-block" id="RingInteractor.get_params"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.RingInteractor.get_params">[docs]</a>    <span class="k">def</span> <span class="nf">get_params</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Store a copy of values of parameters of the slicer into a dictionary.</span>
+<span class="sd">        </span>
+<span class="sd">        :return params: the dictionary created</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">params</span> <span class="o">=</span> <span class="p">{}</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;radius&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_inner_mouse_x</span><span class="p">)</span>
+        <span class="k">return</span> <span class="n">params</span>
+    </div>
+<div class="viewcode-block" id="RingInteractor.set_params"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.RingInteractor.set_params">[docs]</a>    <span class="k">def</span> <span class="nf">set_params</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">params</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Receive a dictionary and reset the slicer with values contained </span>
+<span class="sd">        in the values of the dictionary.</span>
+<span class="sd">        </span>
+<span class="sd">        :param params: a dictionary containing name of slicer parameters and </span>
+<span class="sd">            values the user assigned to the slicer.</span>
+<span class="sd">            </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">x</span> <span class="o">=</span> <span class="n">params</span><span class="p">[</span><span class="s">&quot;radius&quot;</span><span class="p">]</span> 
+        <span class="bp">self</span><span class="o">.</span><span class="n">set_cursor</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_inner_mouse_y</span><span class="p">)</span>
+        </div></div>
+<div class="viewcode-block" id="CircularMask"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.CircularMask">[docs]</a><span class="k">class</span> <span class="nc">CircularMask</span><span class="p">(</span><span class="n">_BaseInteractor</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">     Draw a ring Given a radius </span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s">&#39;grey&#39;</span><span class="p">,</span> <span class="n">zorder</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="n">side</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        </span>
+<span class="sd">        :param: the color of the line that defined the ring</span>
+<span class="sd">        :param r: the radius of the ring</span>
+<span class="sd">        :param sign: the direction of motion the the marker </span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">_BaseInteractor</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="n">color</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">markers</span> <span class="o">=</span> <span class="p">[]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">axes</span> <span class="o">=</span> <span class="n">axes</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span> <span class="o">=</span> <span class="n">base</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">is_inside</span> <span class="o">=</span> <span class="n">side</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">qmax</span> <span class="o">=</span> <span class="nb">min</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmax</span><span class="p">),</span>
+                        <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmin</span><span class="p">))</span>  <span class="c">#must be positive</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">connect</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">connect</span>
+        
+        <span class="c">#Cursor position of Rings (Left(-1) or Right(1))</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">xmaxd</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmax</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">xmind</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmin</span>
+
+        <span class="k">if</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">xmaxd</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">xmind</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">sign</span> <span class="o">=</span> <span class="mi">1</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">sign</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span>
+        <span class="c"># Inner circle</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span> <span class="o">=</span> <span class="n">RingInteractor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">subplot</span><span class="p">,</span> <span class="s">&#39;blue&#39;</span><span class="p">,</span>
+                                            <span class="n">zorder</span><span class="o">=</span><span class="n">zorder</span><span class="o">+</span><span class="mi">1</span><span class="p">,</span> <span class="n">r</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">qmax</span><span class="o">/</span><span class="mf">1.8</span><span class="p">,</span>
+                                            <span class="n">sign</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">sign</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">qmax</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">qmax</span> <span class="o">*</span> <span class="mf">1.2</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_post_data</span><span class="p">()</span>
+        
+        <span class="c"># Bind to slice parameter events</span>
+        <span class="c">#self.base.Bind(EVT_SLICER_PARS, self._onEVT_SLICER_PARS)</span>
+        
+    <span class="k">def</span> <span class="nf">_onEVT_SLICER_PARS</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        receive an event containing parameters values to reset the slicer</span>
+<span class="sd">        </span>
+<span class="sd">        :param event: event of type SlicerParameterEvent with params as </span>
+<span class="sd">            attribute</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="p">,</span>
+                     <span class="n">StatusEvent</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="s">&quot;AnnulusSlicer._onEVT_SLICER_PARS&quot;</span><span class="p">))</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">Skip</span><span class="p">()</span>
+        <span class="k">if</span> <span class="n">event</span><span class="o">.</span><span class="n">type</span> <span class="o">==</span> <span class="bp">self</span><span class="o">.</span><span class="n">__class__</span><span class="o">.</span><span class="n">__name__</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">set_params</span><span class="p">(</span><span class="n">event</span><span class="o">.</span><span class="n">params</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+
+<div class="viewcode-block" id="CircularMask.set_layer"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.CircularMask.set_layer">[docs]</a>    <span class="k">def</span> <span class="nf">set_layer</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">n</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Allow adding plot to the same panel</span>
+<span class="sd">         </span>
+<span class="sd">        :param n: the number of layer</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">layernum</span> <span class="o">=</span> <span class="n">n</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        </div>
+<div class="viewcode-block" id="CircularMask.clear"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.CircularMask.clear">[docs]</a>    <span class="k">def</span> <span class="nf">clear</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Clear the slicer and all connected events related to this slicer</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">clear_markers</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">connect</span><span class="o">.</span><span class="n">clearall</span><span class="p">()</span>
+        <span class="c">#self.base.Unbind(EVT_SLICER_PARS)</span>
+        </div>
+<div class="viewcode-block" id="CircularMask.update"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.CircularMask.update">[docs]</a>    <span class="k">def</span> <span class="nf">update</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Respond to changes in the model by recalculating the profiles and</span>
+<span class="sd">        resetting the widgets.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># Update locations        </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        <span class="c">#if self.is_inside != None:</span>
+        <span class="n">out</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_post_data</span><span class="p">()</span>
+        <span class="k">return</span> <span class="n">out</span>
+</div>
+<div class="viewcode-block" id="CircularMask.save"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.CircularMask.save">[docs]</a>    <span class="k">def</span> <span class="nf">save</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Remember the roughness for this layer and the next so that we</span>
+<span class="sd">        can restore on Esc.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">freeze_axes</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">save</span><span class="p">(</span><span class="n">ev</span><span class="p">)</span>
+</div>
+    <span class="k">def</span> <span class="nf">_post_data</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Uses annulus parameters to plot averaged data into 1D data.</span>
+<span class="sd">        </span>
+<span class="sd">        :param nbins: the number of points to plot </span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c">#Data to average</span>
+        <span class="n">data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data</span>
+              
+        <span class="c"># If we have no data, just return</span>
+        <span class="k">if</span> <span class="n">data</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="k">return</span>
+        <span class="n">mask</span> <span class="o">=</span> <span class="n">data</span><span class="o">.</span><span class="n">mask</span>  
+        <span class="kn">from</span> <span class="nn">sas.dataloader.manipulations</span> <span class="kn">import</span> <span class="n">Ringcut</span>
+    
+        <span class="n">rmin</span> <span class="o">=</span> <span class="mi">0</span>
+        <span class="n">rmax</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">get_radius</span><span class="p">())</span>
+
+        <span class="c">## create the data1D Q average of data2D    </span>
+        <span class="n">mask</span> <span class="o">=</span> <span class="n">Ringcut</span><span class="p">(</span><span class="n">r_min</span><span class="o">=</span><span class="n">rmin</span><span class="p">,</span> <span class="n">r_max</span><span class="o">=</span> <span class="n">rmax</span><span class="p">)</span>
+
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_inside</span><span class="p">:</span>
+            <span class="n">out</span> <span class="o">=</span> <span class="p">(</span><span class="n">mask</span><span class="p">(</span><span class="n">data</span><span class="p">)</span> <span class="o">==</span> <span class="bp">False</span><span class="p">)</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="n">out</span> <span class="o">=</span> <span class="p">(</span><span class="n">mask</span><span class="p">(</span><span class="n">data</span><span class="p">))</span>
+        <span class="c">#self.base.data.mask=out</span>
+        <span class="k">return</span> <span class="n">out</span>                    
+
+         
+<div class="viewcode-block" id="CircularMask.moveend"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.CircularMask.moveend">[docs]</a>    <span class="k">def</span> <span class="nf">moveend</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Called when any dragging motion ends.</span>
+<span class="sd">        Post an event (type =SlicerParameterEvent)</span>
+<span class="sd">        to plotter 2D with a copy  slicer parameters</span>
+<span class="sd">        Call  _post_data method</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">thaw_axes</span><span class="p">()</span>
+        <span class="c"># create a 1D data plot</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_post_data</span><span class="p">()</span>
+            </div>
+<div class="viewcode-block" id="CircularMask.restore"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.CircularMask.restore">[docs]</a>    <span class="k">def</span> <span class="nf">restore</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Restore the roughness for this layer.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">restore</span><span class="p">()</span>
+</div>
+<div class="viewcode-block" id="CircularMask.move"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.CircularMask.move">[docs]</a>    <span class="k">def</span> <span class="nf">move</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Process move to a new position, making sure that the move is allowed.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">pass</span>
+        </div>
+<div class="viewcode-block" id="CircularMask.set_cursor"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.CircularMask.set_cursor">[docs]</a>    <span class="k">def</span> <span class="nf">set_cursor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">):</span>
+        <span class="k">pass</span>
+        </div>
+<div class="viewcode-block" id="CircularMask.get_params"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.CircularMask.get_params">[docs]</a>    <span class="k">def</span> <span class="nf">get_params</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Store a copy of values of parameters of the slicer into a dictionary.</span>
+<span class="sd">        </span>
+<span class="sd">        :return params: the dictionary created</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">params</span> <span class="o">=</span> <span class="p">{}</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;outer_radius&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">_inner_mouse_x</span><span class="p">)</span>
+        <span class="k">return</span> <span class="n">params</span>
+    </div>
+<div class="viewcode-block" id="CircularMask.set_params"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.CircularMask.set_params">[docs]</a>    <span class="k">def</span> <span class="nf">set_params</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">params</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Receive a dictionary and reset the slicer with values contained </span>
+<span class="sd">        in the values of the dictionary.</span>
+<span class="sd">        </span>
+<span class="sd">        :param params: a dictionary containing name of slicer parameters and </span>
+<span class="sd">            values the user assigned to the slicer.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">outer</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="n">params</span><span class="p">[</span><span class="s">&quot;outer_radius&quot;</span><span class="p">]</span> <span class="p">)</span>
+        <span class="c">## Update the picture</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">set_cursor</span><span class="p">(</span><span class="n">outer</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">_inner_mouse_y</span><span class="p">)</span>
+        <span class="c">## Post the data given the nbins entered by the user </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_post_data</span><span class="p">()</span>
+        </div>
+<div class="viewcode-block" id="CircularMask.freeze_axes"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.CircularMask.freeze_axes">[docs]</a>    <span class="k">def</span> <span class="nf">freeze_axes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">freeze_axes</span><span class="p">()</span>
+        </div>
+<div class="viewcode-block" id="CircularMask.thaw_axes"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.CircularMask.thaw_axes">[docs]</a>    <span class="k">def</span> <span class="nf">thaw_axes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">thaw_axes</span><span class="p">()</span>
+</div>
+<div class="viewcode-block" id="CircularMask.draw"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AnnulusSlicer.CircularMask.draw">[docs]</a>    <span class="k">def</span> <span class="nf">draw</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+              </div></div>
+</pre></div>
+
+          </div>
+        </div>
+      </div>
+      <div class="sphinxsidebar">
+        <div class="sphinxsidebarwrapper">
+<div id="searchbox" style="display: none">
+  <h3>Quick search</h3>
+    <form class="search" action="../../../../../search.html" method="get">
+      <input type="text" name="q" />
+      <input type="submit" value="Go" />
+      <input type="hidden" name="check_keywords" value="yes" />
+      <input type="hidden" name="area" value="default" />
+    </form>
+    <p class="searchtip" style="font-size: 90%">
+    Enter search terms or a module, class or function name.
+    </p>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+        </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" >sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>
+    <div class="footer">
+        &copy; Copyright 2013, The SasView Project.
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
+    </div>
+  </body>
+</html>
Index: _modules/sas/guiframe/local_perspectives/plotting/Arc.html
===================================================================
--- _modules/sas/guiframe/local_perspectives/plotting/Arc.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
+++ _modules/sas/guiframe/local_perspectives/plotting/Arc.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
@@ -0,0 +1,263 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>sas.guiframe.local_perspectives.plotting.Arc &mdash; SasView 3.0.0 documentation</title>
+    
+    <link rel="stylesheet" href="../../../../../_static/default.css" type="text/css" />
+    <link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '../../../../../',
+        VERSION:     '3.0.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="../../../../../_static/jquery.js"></script>
+    <script type="text/javascript" src="../../../../../_static/underscore.js"></script>
+    <script type="text/javascript" src="../../../../../_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <link rel="top" title="SasView 3.0.0 documentation" href="../../../../../index.html" />
+    <link rel="up" title="sas.guiframe" href="../../../guiframe.html" /> 
+  </head>
+  <body>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" accesskey="U">sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>  
+
+    <div class="document">
+      <div class="documentwrapper">
+        <div class="bodywrapper">
+          <div class="body">
+            
+  <h1>Source code for sas.guiframe.local_perspectives.plotting.Arc</h1><div class="highlight"><pre>
+<span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Arc slicer for 2D data</span>
+<span class="sd">&quot;&quot;&quot;</span>
+<span class="kn">import</span> <span class="nn">math</span>
+
+<span class="kn">from</span> <span class="nn">BaseInteractor</span> <span class="kn">import</span> <span class="n">_BaseInteractor</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">SlicerParameterEvent</span>
+ 
+<div class="viewcode-block" id="ArcInteractor"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Arc.ArcInteractor">[docs]</a><span class="k">class</span> <span class="nc">ArcInteractor</span><span class="p">(</span><span class="n">_BaseInteractor</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Select an annulus through a 2D plot</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s">&#39;black&#39;</span><span class="p">,</span> <span class="n">zorder</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">r</span><span class="o">=</span><span class="mf">1.0</span><span class="p">,</span> 
+                 <span class="n">theta1</span><span class="o">=</span><span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="o">/</span><span class="mi">8</span><span class="p">,</span> <span class="n">theta2</span><span class="o">=</span><span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="o">/</span><span class="mi">4</span><span class="p">):</span>
+        
+        <span class="n">_BaseInteractor</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="n">color</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">markers</span> <span class="o">=</span> <span class="p">[]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">axes</span> <span class="o">=</span> <span class="n">axes</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_mouse_x</span> <span class="o">=</span> <span class="n">r</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_mouse_y</span> <span class="o">=</span> <span class="mi">0</span>
+        
+        <span class="bp">self</span><span class="o">.</span><span class="n">_save_x</span>  <span class="o">=</span> <span class="n">r</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_save_y</span>  <span class="o">=</span> <span class="mi">0</span>
+        
+        <span class="bp">self</span><span class="o">.</span><span class="n">scale</span> <span class="o">=</span> <span class="mf">10.0</span>
+        
+        <span class="bp">self</span><span class="o">.</span><span class="n">theta1</span> <span class="o">=</span> <span class="n">theta1</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">theta2</span> <span class="o">=</span> <span class="n">theta2</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">radius</span> <span class="o">=</span> <span class="n">r</span>
+        <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">arc</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">plot</span><span class="p">([],</span> <span class="p">[],</span>
+                                      <span class="n">linestyle</span><span class="o">=</span><span class="s">&#39;-&#39;</span><span class="p">,</span> <span class="n">marker</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">,</span>
+                                      <span class="n">color</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">color</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">npts</span> <span class="o">=</span> <span class="mi">20</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">has_move</span> <span class="o">=</span> <span class="bp">False</span>    
+        <span class="bp">self</span><span class="o">.</span><span class="n">connect_markers</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">arc</span><span class="p">])</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+
+<div class="viewcode-block" id="ArcInteractor.set_layer"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Arc.ArcInteractor.set_layer">[docs]</a>    <span class="k">def</span> <span class="nf">set_layer</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">n</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">            Allow adding plot to the same panel</span>
+<span class="sd">            :param n: the number of layer</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">layernum</span> <span class="o">=</span> <span class="n">n</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        </div>
+<div class="viewcode-block" id="ArcInteractor.clear"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Arc.ArcInteractor.clear">[docs]</a>    <span class="k">def</span> <span class="nf">clear</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">            Clear this slicer and its markers</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">clear_markers</span><span class="p">()</span>
+        <span class="k">try</span><span class="p">:</span>
+            <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">markers</span><span class="p">:</span>
+                <span class="n">item</span><span class="o">.</span><span class="n">remove</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">arc</span><span class="o">.</span><span class="n">remove</span><span class="p">()</span>
+        <span class="k">except</span><span class="p">:</span>
+            <span class="c"># Old version of matplotlib</span>
+            <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">lines</span><span class="p">)):</span>
+                <span class="k">del</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">lines</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
+        </div>
+<div class="viewcode-block" id="ArcInteractor.get_radius"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Arc.ArcInteractor.get_radius">[docs]</a>    <span class="k">def</span> <span class="nf">get_radius</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">            Return arc radius</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">radius</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">pow</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_mouse_x</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span> <span class="o">+</span> \
+                           <span class="n">math</span><span class="o">.</span><span class="n">pow</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_mouse_y</span><span class="p">,</span> <span class="mi">2</span><span class="p">))</span>
+        <span class="k">return</span> <span class="n">radius</span>
+        </div>
+<div class="viewcode-block" id="ArcInteractor.update"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Arc.ArcInteractor.update">[docs]</a>    <span class="k">def</span> <span class="nf">update</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">theta1</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">theta2</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">nbins</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">r</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">            Update the plotted arc</span>
+<span class="sd">            :param theta1: starting angle of the arc</span>
+<span class="sd">            :param theta2: ending angle of the arc</span>
+<span class="sd">            :param nbins: number of points along the arc</span>
+<span class="sd">            :param r: radius of the arc</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># Plot inner circle</span>
+        <span class="n">x</span> <span class="o">=</span> <span class="p">[]</span>
+        <span class="n">y</span> <span class="o">=</span> <span class="p">[]</span>
+        <span class="k">if</span> <span class="n">theta1</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">theta1</span> <span class="o">=</span> <span class="n">theta1</span>
+        <span class="k">if</span> <span class="n">theta2</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">theta2</span> <span class="o">=</span> <span class="n">theta2</span>
+        <span class="k">while</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta2</span> <span class="o">&lt;</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta1</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">theta2</span> <span class="o">+=</span> <span class="p">(</span><span class="mi">2</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="p">)</span>
+        <span class="k">while</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta2</span> <span class="o">&gt;=</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">theta1</span> <span class="o">+</span> <span class="mi">2</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="p">):</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">theta2</span> <span class="o">-=</span> <span class="p">(</span><span class="mi">2</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="p">)</span>
+        <span class="n">npts</span> <span class="o">=</span> <span class="nb">int</span><span class="p">((</span><span class="bp">self</span><span class="o">.</span><span class="n">theta2</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta1</span><span class="p">)</span><span class="o">/</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="o">/</span><span class="mi">120</span><span class="p">))</span>  
+             
+        <span class="k">if</span> <span class="n">r</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">radius</span> <span class="o">=</span>  <span class="n">math</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">pow</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_mouse_x</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span> <span class="o">+</span> \
+                                     <span class="n">math</span><span class="o">.</span><span class="n">pow</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_mouse_y</span><span class="p">,</span> <span class="mi">2</span><span class="p">))</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">radius</span> <span class="o">=</span> <span class="n">r</span>
+        <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">npts</span><span class="p">):</span>
+            <span class="n">phi</span> <span class="o">=</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">theta2</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta1</span><span class="p">)</span><span class="o">/</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">npts</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> <span class="o">*</span> <span class="n">i</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta1</span>
+            <span class="n">xval</span> <span class="o">=</span> <span class="mf">1.0</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">radius</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">cos</span><span class="p">(</span><span class="n">phi</span><span class="p">)</span> 
+            <span class="n">yval</span> <span class="o">=</span> <span class="mf">1.0</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">radius</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">sin</span><span class="p">(</span><span class="n">phi</span><span class="p">)</span> 
+            
+            <span class="n">x</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">xval</span><span class="p">)</span>
+            <span class="n">y</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">yval</span><span class="p">)</span>
+        <span class="c">#self.marker.set(xdata=[self._mouse_x],ydata=[0])</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">arc</span><span class="o">.</span><span class="n">set_data</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">)</span> 
+        </div>
+<div class="viewcode-block" id="ArcInteractor.save"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Arc.ArcInteractor.save">[docs]</a>    <span class="k">def</span> <span class="nf">save</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Remember the roughness for this layer and the next so that we</span>
+<span class="sd">        can restore on Esc.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_save_x</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_mouse_x</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_save_y</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_mouse_y</span>
+        <span class="c">#self._save_x = ev.xdata</span>
+        <span class="c">#self._save_y = ev.ydata</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">freeze_axes</span><span class="p">()</span>
+</div>
+<div class="viewcode-block" id="ArcInteractor.moveend"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Arc.ArcInteractor.moveend">[docs]</a>    <span class="k">def</span> <span class="nf">moveend</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">            After a dragging motion reset the flag self.has_move to False</span>
+<span class="sd">            :param ev: event</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">has_move</span> <span class="o">=</span> <span class="bp">False</span>
+        
+        <span class="n">event</span> <span class="o">=</span> <span class="n">SlicerParameterEvent</span><span class="p">()</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">type</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">__class__</span><span class="o">.</span><span class="n">__name__</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">params</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_params</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">moveend</span><span class="p">(</span><span class="n">ev</span><span class="p">)</span>
+            </div>
+<div class="viewcode-block" id="ArcInteractor.restore"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Arc.ArcInteractor.restore">[docs]</a>    <span class="k">def</span> <span class="nf">restore</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Restore the roughness for this layer.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_mouse_x</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_save_x</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_mouse_y</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_save_y</span>
+       </div>
+<div class="viewcode-block" id="ArcInteractor.move"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Arc.ArcInteractor.move">[docs]</a>    <span class="k">def</span> <span class="nf">move</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Process move to a new position, making sure that the move is allowed.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c">#print &quot;ring move x, y&quot;, x,y</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_mouse_x</span> <span class="o">=</span> <span class="n">x</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_mouse_y</span> <span class="o">=</span> <span class="n">y</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">has_move</span> <span class="o">=</span> <span class="bp">True</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        </div>
+<div class="viewcode-block" id="ArcInteractor.set_cursor"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Arc.ArcInteractor.set_cursor">[docs]</a>    <span class="k">def</span> <span class="nf">set_cursor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">radius</span><span class="p">,</span> <span class="n">phi_min</span><span class="p">,</span> <span class="n">phi_max</span><span class="p">,</span> <span class="n">nbins</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">theta1</span> <span class="o">=</span> <span class="n">phi_min</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">theta2</span> <span class="o">=</span> <span class="n">phi_max</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">nbins</span><span class="o">=</span><span class="n">nbins</span><span class="p">,</span> <span class="n">r</span><span class="o">=</span><span class="n">radius</span><span class="p">)</span>
+</div>
+<div class="viewcode-block" id="ArcInteractor.get_params"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Arc.ArcInteractor.get_params">[docs]</a>    <span class="k">def</span> <span class="nf">get_params</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">params</span> <span class="o">=</span> <span class="p">{}</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;radius&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">radius</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;theta1&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta1</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;theta2&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta2</span>
+        <span class="k">return</span> <span class="n">params</span>
+    </div>
+<div class="viewcode-block" id="ArcInteractor.set_params"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Arc.ArcInteractor.set_params">[docs]</a>    <span class="k">def</span> <span class="nf">set_params</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">params</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">x</span> <span class="o">=</span> <span class="n">params</span><span class="p">[</span><span class="s">&quot;radius&quot;</span><span class="p">]</span> 
+        <span class="n">phi_max</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta2</span>
+        <span class="n">nbins</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">npts</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">set_cursor</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_mouse_y</span><span class="p">,</span> <span class="n">phi_max</span><span class="p">,</span> <span class="n">nbins</span><span class="p">)</span>
+        
+    </div></div>
+</pre></div>
+
+          </div>
+        </div>
+      </div>
+      <div class="sphinxsidebar">
+        <div class="sphinxsidebarwrapper">
+<div id="searchbox" style="display: none">
+  <h3>Quick search</h3>
+    <form class="search" action="../../../../../search.html" method="get">
+      <input type="text" name="q" />
+      <input type="submit" value="Go" />
+      <input type="hidden" name="check_keywords" value="yes" />
+      <input type="hidden" name="area" value="default" />
+    </form>
+    <p class="searchtip" style="font-size: 90%">
+    Enter search terms or a module, class or function name.
+    </p>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+        </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" >sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>
+    <div class="footer">
+        &copy; Copyright 2013, The SasView Project.
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
+    </div>
+  </body>
+</html>
Index: _modules/sas/guiframe/local_perspectives/plotting/AzimutSlicer.html
===================================================================
--- _modules/sas/guiframe/local_perspectives/plotting/AzimutSlicer.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
+++ _modules/sas/guiframe/local_perspectives/plotting/AzimutSlicer.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
@@ -0,0 +1,398 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>sas.guiframe.local_perspectives.plotting.AzimutSlicer &mdash; SasView 3.0.0 documentation</title>
+    
+    <link rel="stylesheet" href="../../../../../_static/default.css" type="text/css" />
+    <link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '../../../../../',
+        VERSION:     '3.0.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="../../../../../_static/jquery.js"></script>
+    <script type="text/javascript" src="../../../../../_static/underscore.js"></script>
+    <script type="text/javascript" src="../../../../../_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <link rel="top" title="SasView 3.0.0 documentation" href="../../../../../index.html" />
+    <link rel="up" title="sas.guiframe" href="../../../guiframe.html" /> 
+  </head>
+  <body>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" accesskey="U">sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>  
+
+    <div class="document">
+      <div class="documentwrapper">
+        <div class="bodywrapper">
+          <div class="body">
+            
+  <h1>Source code for sas.guiframe.local_perspectives.plotting.AzimutSlicer</h1><div class="highlight"><pre>
+<span class="c">#TODO: the line slicer should listen to all 2DREFRESH events, get the data and slice it</span>
+<span class="c">#      before pushing a new 1D data update.</span>
+
+<span class="c">#</span>
+<span class="c">#TODO: NEED MAJOR REFACTOR</span>
+<span class="c">#</span>
+
+
+<span class="c"># Debug printout</span>
+<span class="kn">import</span> <span class="nn">math</span>
+<span class="kn">import</span> <span class="nn">wx</span>
+<span class="kn">from</span> <span class="nn">copy</span> <span class="kn">import</span> <span class="n">deepcopy</span>
+<span class="kn">from</span> <span class="nn">BaseInteractor</span> <span class="kn">import</span> <span class="n">_BaseInteractor</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">NewPlotEvent</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">StatusEvent</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">SlicerParameterEvent</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">EVT_SLICER_PARS</span>
+
+
+<div class="viewcode-block" id="SectorInteractor"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AzimutSlicer.SectorInteractor">[docs]</a><span class="k">class</span> <span class="nc">SectorInteractor</span><span class="p">(</span><span class="n">_BaseInteractor</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Select an annulus through a 2D plot</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s">&#39;black&#39;</span><span class="p">,</span> <span class="n">zorder</span><span class="o">=</span><span class="mi">3</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">_BaseInteractor</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="n">color</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">markers</span> <span class="o">=</span> <span class="p">[]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">axes</span> <span class="o">=</span> <span class="n">axes</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">qmax</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmax</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">connect</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">connect</span>
+        
+        <span class="c">## Number of points on the plot</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">nbins</span> <span class="o">=</span> <span class="mi">20</span>
+        <span class="n">theta1</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="o">/</span><span class="mi">8</span>
+        <span class="n">theta2</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="o">/</span><span class="mi">2</span>
+        <span class="n">theta1</span> <span class="o">=</span> <span class="mi">2</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="o">/</span><span class="mi">3</span>
+        <span class="n">theta2</span> <span class="o">=</span> <span class="o">-</span><span class="mi">2</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="o">/</span><span class="mi">3</span>
+        <span class="n">r1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">qmax</span><span class="o">/</span><span class="mf">2.0</span>
+        <span class="n">r2</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">qmax</span><span class="o">/</span><span class="mf">1.8</span>
+       
+        <span class="c"># Inner circle</span>
+        <span class="kn">from</span> <span class="nn">Arc</span> <span class="kn">import</span> <span class="n">ArcInteractor</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">inner_circle</span> <span class="o">=</span> <span class="n">ArcInteractor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">subplot</span><span class="p">,</span>
+                                           <span class="n">zorder</span><span class="o">=</span><span class="n">zorder</span><span class="p">,</span>
+                                           <span class="n">r</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">qmax</span><span class="o">/</span><span class="mf">2.0</span><span class="p">,</span>
+                                           <span class="n">theta1</span><span class="o">=</span><span class="n">theta1</span><span class="p">,</span>
+                                           <span class="n">theta2</span><span class="o">=</span><span class="n">theta2</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">inner_circle</span><span class="o">.</span><span class="n">qmax</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">qmax</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span> <span class="o">=</span> <span class="n">ArcInteractor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">subplot</span><span class="p">,</span>
+                                          <span class="n">zorder</span><span class="o">=</span><span class="n">zorder</span><span class="o">+</span><span class="mi">1</span><span class="p">,</span>
+                                          <span class="n">r</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">qmax</span><span class="o">/</span><span class="mf">1.8</span><span class="p">,</span>
+                                          <span class="n">theta1</span><span class="o">=</span><span class="n">theta1</span><span class="p">,</span>
+                                           <span class="n">theta2</span><span class="o">=</span><span class="n">theta2</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">qmax</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">qmax</span> <span class="o">*</span> <span class="mf">1.2</span>
+        <span class="c">#self.outer_circle.set_cursor(self.base.qmax/1.8, 0)</span>
+        <span class="kn">from</span> <span class="nn">Edge</span> <span class="kn">import</span> <span class="n">RadiusInteractor</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">right_edge</span><span class="o">=</span> <span class="n">RadiusInteractor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">subplot</span><span class="p">,</span>
+                                          <span class="n">zorder</span><span class="o">=</span><span class="n">zorder</span><span class="o">+</span><span class="mi">1</span><span class="p">,</span>
+                                             <span class="n">arc1</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">inner_circle</span><span class="p">,</span>
+                                             <span class="n">arc2</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="p">,</span>
+                                            <span class="n">theta</span><span class="o">=</span><span class="n">theta1</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">left_edge</span><span class="o">=</span> <span class="n">RadiusInteractor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">subplot</span><span class="p">,</span>
+                                         <span class="n">zorder</span><span class="o">=</span><span class="n">zorder</span><span class="o">+</span><span class="mi">1</span><span class="p">,</span>
+                                             <span class="n">arc1</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">inner_circle</span><span class="p">,</span>
+                                             <span class="n">arc2</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="p">,</span>
+                                            <span class="n">theta</span><span class="o">=</span><span class="n">theta2</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_post_data</span><span class="p">()</span>
+        <span class="c"># Bind to slice parameter events</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">EVT_SLICER_PARS</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_onEVT_SLICER_PARS</span><span class="p">)</span>
+
+    <span class="k">def</span> <span class="nf">_onEVT_SLICER_PARS</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c">#printEVT(&quot;AnnulusSlicer._onEVT_SLICER_PARS&quot;)</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">Skip</span><span class="p">()</span>
+        <span class="k">if</span> <span class="n">event</span><span class="o">.</span><span class="n">type</span> <span class="o">==</span> <span class="bp">self</span><span class="o">.</span><span class="n">__class__</span><span class="o">.</span><span class="n">__name__</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">set_params</span><span class="p">(</span><span class="n">event</span><span class="o">.</span><span class="n">params</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+
+<div class="viewcode-block" id="SectorInteractor.set_layer"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AzimutSlicer.SectorInteractor.set_layer">[docs]</a>    <span class="k">def</span> <span class="nf">set_layer</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">n</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">layernum</span> <span class="o">=</span> <span class="n">n</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        </div>
+<div class="viewcode-block" id="SectorInteractor.clear"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AzimutSlicer.SectorInteractor.clear">[docs]</a>    <span class="k">def</span> <span class="nf">clear</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">clear_markers</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">inner_circle</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">right_edge</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">left_edge</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
+        <span class="c">#self.base.connect.disconnect()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">Unbind</span><span class="p">(</span><span class="n">EVT_SLICER_PARS</span><span class="p">)</span>
+        </div>
+<div class="viewcode-block" id="SectorInteractor.update"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AzimutSlicer.SectorInteractor.update">[docs]</a>    <span class="k">def</span> <span class="nf">update</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Respond to changes in the model by recalculating the profiles and</span>
+<span class="sd">        resetting the widgets.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># Update locations   </span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">inner_circle</span><span class="o">.</span><span class="n">has_move</span><span class="p">:</span>    
+            <span class="c">#print &quot;inner circle has moved&quot; </span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">inner_circle</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+            <span class="n">r1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">inner_circle</span><span class="o">.</span><span class="n">get_radius</span><span class="p">()</span>
+            <span class="n">r2</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">get_radius</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">right_edge</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">r1</span><span class="p">,</span> <span class="n">r2</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">left_edge</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">r1</span><span class="p">,</span> <span class="n">r2</span><span class="p">)</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">has_move</span><span class="p">:</span>    
+            <span class="c">#print &quot;outer circle has moved&quot; </span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+            <span class="n">r1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">inner_circle</span><span class="o">.</span><span class="n">get_radius</span><span class="p">()</span>
+            <span class="n">r2</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">get_radius</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">left_edge</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">r1</span><span class="p">,</span> <span class="n">r2</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">right_edge</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">r1</span><span class="p">,</span> <span class="n">r2</span><span class="p">)</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">right_edge</span><span class="o">.</span><span class="n">has_move</span><span class="p">:</span>
+            <span class="c">#print &quot;right edge has moved&quot;</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">right_edge</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">inner_circle</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">theta1</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">right_edge</span><span class="o">.</span><span class="n">get_angle</span><span class="p">(),</span>
+                                     <span class="n">theta2</span><span class="o">=</span><span class="bp">None</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">theta1</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">right_edge</span><span class="o">.</span><span class="n">get_angle</span><span class="p">(),</span>
+                                     <span class="n">theta2</span><span class="o">=</span><span class="bp">None</span><span class="p">)</span>
+        <span class="k">if</span>  <span class="bp">self</span><span class="o">.</span><span class="n">left_edge</span><span class="o">.</span><span class="n">has_move</span><span class="p">:</span>
+            <span class="c">#print &quot;left Edge has moved&quot;</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">left_edge</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">inner_circle</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">theta1</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
+                                     <span class="n">theta2</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">left_edge</span><span class="o">.</span><span class="n">get_angle</span><span class="p">())</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">theta1</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
+                                     <span class="n">theta2</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">left_edge</span><span class="o">.</span><span class="n">get_angle</span><span class="p">())</span>
+             </div>
+<div class="viewcode-block" id="SectorInteractor.save"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AzimutSlicer.SectorInteractor.save">[docs]</a>    <span class="k">def</span> <span class="nf">save</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Remember the roughness for this layer and the next so that we</span>
+<span class="sd">        can restore on Esc.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">freeze_axes</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">inner_circle</span><span class="o">.</span><span class="n">save</span><span class="p">(</span><span class="n">ev</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">save</span><span class="p">(</span><span class="n">ev</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">right_edge</span><span class="o">.</span><span class="n">save</span><span class="p">(</span><span class="n">ev</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">left_edge</span><span class="o">.</span><span class="n">save</span><span class="p">(</span><span class="n">ev</span><span class="p">)</span>
+        </div>
+    <span class="k">def</span> <span class="nf">_post_data</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="k">pass</span>
+    
+<div class="viewcode-block" id="SectorInteractor.post_data"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AzimutSlicer.SectorInteractor.post_data">[docs]</a>    <span class="k">def</span> <span class="nf">post_data</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="n">new_sector</span> <span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot; post data averaging in Q&quot;&quot;&quot;</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">inner_circle</span><span class="o">.</span><span class="n">get_radius</span><span class="p">()</span> <span class="o">&lt;</span> <span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">get_radius</span><span class="p">():</span>
+            <span class="n">rmin</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">inner_circle</span><span class="o">.</span><span class="n">get_radius</span><span class="p">()</span>
+            <span class="n">rmax</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">get_radius</span><span class="p">()</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="n">rmin</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">get_radius</span><span class="p">()</span>
+            <span class="n">rmax</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">inner_circle</span><span class="o">.</span><span class="n">get_radius</span><span class="p">()</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">right_edge</span><span class="o">.</span><span class="n">get_angle</span><span class="p">()</span> <span class="o">&lt;</span> <span class="bp">self</span><span class="o">.</span><span class="n">left_edge</span><span class="o">.</span><span class="n">get_angle</span><span class="p">():</span>
+            <span class="n">phimin</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">right_edge</span><span class="o">.</span><span class="n">get_angle</span><span class="p">()</span>
+            <span class="n">phimax</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">left_edge</span><span class="o">.</span><span class="n">get_angle</span><span class="p">()</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="n">phimin</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">left_edge</span><span class="o">.</span><span class="n">get_angle</span><span class="p">()</span>
+            <span class="n">phimax</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">right_edge</span><span class="o">.</span><span class="n">get_angle</span><span class="p">()</span>   
+        <span class="c">#print &quot;phimin, phimax, rmin ,rmax&quot;,math.degrees(phimin),</span>
+        <span class="c"># math.degrees(phimax), rmin ,rmax</span>
+        <span class="c">#from sas.dataloader.manipulations import SectorQ</span>
+        
+        <span class="n">sect</span> <span class="o">=</span> <span class="n">new_sector</span><span class="p">(</span><span class="n">r_min</span><span class="o">=</span><span class="n">rmin</span><span class="p">,</span> <span class="n">r_max</span><span class="o">=</span><span class="n">rmax</span><span class="p">,</span>
+                          <span class="n">phi_min</span><span class="o">=</span><span class="n">phimin</span><span class="p">,</span> <span class="n">phi_max</span><span class="o">=</span><span class="n">phimax</span><span class="p">)</span>
+        <span class="n">sector</span> <span class="o">=</span> <span class="n">sect</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="p">)</span>
+        
+        <span class="kn">from</span> <span class="nn">sas.guiframe.dataFitting</span> <span class="kn">import</span> <span class="n">Data1D</span>
+        <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">sector</span><span class="p">,</span> <span class="s">&quot;dxl&quot;</span><span class="p">):</span>
+            <span class="n">dxl</span> <span class="o">=</span> <span class="n">sector</span><span class="o">.</span><span class="n">dxl</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="n">dxl</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">sector</span><span class="p">,</span> <span class="s">&quot;dxw&quot;</span><span class="p">):</span>
+            <span class="n">dxw</span> <span class="o">=</span> <span class="n">sector</span><span class="o">.</span><span class="n">dxw</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="n">dxw</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="n">new_plot</span> <span class="o">=</span> <span class="n">Data1D</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="n">sector</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="n">sector</span><span class="o">.</span><span class="n">y</span><span class="p">,</span> <span class="n">dy</span><span class="o">=</span><span class="n">sector</span><span class="o">.</span><span class="n">dy</span><span class="p">,</span>
+                          <span class="n">dxl</span><span class="o">=</span><span class="n">dxl</span><span class="p">,</span> <span class="n">dxw</span><span class="o">=</span><span class="n">dxw</span><span class="p">)</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">new_sector</span><span class="o">.</span><span class="n">__name__</span><span class="p">)</span> <span class="o">+</span> \
+                        <span class="s">&quot;(&quot;</span><span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">name</span><span class="o">+</span><span class="s">&quot;)&quot;</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">source</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">source</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">interactive</span> <span class="o">=</span> <span class="bp">True</span>
+        <span class="c">#print &quot;loader output.detector&quot;,output.source</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">detector</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">detector</span>
+        <span class="c"># If the data file does not tell us what the axes are, just assume...</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">xaxis</span><span class="p">(</span><span class="s">&quot;</span><span class="se">\\</span><span class="s">rm{Q}&quot;</span><span class="p">,</span> <span class="s">&#39;rad&#39;</span><span class="p">)</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">yaxis</span><span class="p">(</span><span class="s">&quot;</span><span class="se">\\</span><span class="s">rm{Intensity} &quot;</span><span class="p">,</span> <span class="s">&quot;cm^{-1}&quot;</span><span class="p">)</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">group_id</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">new_sector</span><span class="o">.</span><span class="n">__name__</span><span class="p">)</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">name</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">update_theory</span><span class="p">(</span><span class="n">data_id</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> \
+                                       <span class="n">theory</span><span class="o">=</span><span class="n">new_plot</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span>
+                    <span class="n">NewPlotEvent</span><span class="p">(</span><span class="n">plot</span><span class="o">=</span><span class="n">new_plot</span><span class="p">,</span> <span class="n">title</span><span class="o">=</span><span class="nb">str</span><span class="p">(</span><span class="n">new_sector</span><span class="o">.</span><span class="n">__name__</span><span class="p">)))</span>
+        </div>
+<div class="viewcode-block" id="SectorInteractor.moveend"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AzimutSlicer.SectorInteractor.moveend">[docs]</a>    <span class="k">def</span> <span class="nf">moveend</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="c">#self.base.thaw_axes()</span>
+        
+        <span class="c"># Post paramters</span>
+        <span class="c">#event = SlicerParameterEvent()</span>
+        <span class="c">#event.type = self.__class__.__name__</span>
+        <span class="c">#event.params = self.get_params()</span>
+        <span class="c">#print &quot;main moveend &quot;, event.params</span>
+        <span class="c">#wx.PostEvent(self.base.parent, event)</span>
+        <span class="c">#self._post_data()</span>
+        <span class="k">pass</span>
+            </div>
+<div class="viewcode-block" id="SectorInteractor.restore"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AzimutSlicer.SectorInteractor.restore">[docs]</a>    <span class="k">def</span> <span class="nf">restore</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Restore the roughness for this layer.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">inner_circle</span><span class="o">.</span><span class="n">restore</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">restore</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">right_edge</span><span class="o">.</span><span class="n">restore</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">left_edge</span><span class="o">.</span><span class="n">restore</span><span class="p">()</span>
+</div>
+<div class="viewcode-block" id="SectorInteractor.move"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AzimutSlicer.SectorInteractor.move">[docs]</a>    <span class="k">def</span> <span class="nf">move</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Process move to a new position, making sure that the move is allowed.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">pass</span>
+        </div>
+<div class="viewcode-block" id="SectorInteractor.set_cursor"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AzimutSlicer.SectorInteractor.set_cursor">[docs]</a>    <span class="k">def</span> <span class="nf">set_cursor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">pass</span>
+        </div>
+<div class="viewcode-block" id="SectorInteractor.get_params"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AzimutSlicer.SectorInteractor.get_params">[docs]</a>    <span class="k">def</span> <span class="nf">get_params</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">params</span> <span class="o">=</span> <span class="p">{}</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;r_min&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">inner_circle</span><span class="o">.</span><span class="n">get_radius</span><span class="p">()</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;r_max&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">get_radius</span><span class="p">()</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;phi_min&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">right_edge</span><span class="o">.</span><span class="n">get_angle</span><span class="p">()</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;phi_max&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">left_edge</span><span class="o">.</span><span class="n">get_angle</span><span class="p">()</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;nbins&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">nbins</span>
+        <span class="k">return</span> <span class="n">params</span>
+    </div>
+<div class="viewcode-block" id="SectorInteractor.set_params"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AzimutSlicer.SectorInteractor.set_params">[docs]</a>    <span class="k">def</span> <span class="nf">set_params</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">params</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c">#print &quot;setparams on main slicer &quot;,params</span>
+        <span class="n">inner</span> <span class="o">=</span> <span class="n">params</span><span class="p">[</span><span class="s">&quot;r_min&quot;</span><span class="p">]</span> 
+        <span class="n">outer</span> <span class="o">=</span> <span class="n">params</span><span class="p">[</span><span class="s">&quot;r_max&quot;</span><span class="p">]</span> 
+        <span class="n">phi_min</span><span class="o">=</span> <span class="n">params</span><span class="p">[</span><span class="s">&quot;phi_min&quot;</span><span class="p">]</span>
+        <span class="n">phi_max</span><span class="o">=</span><span class="n">params</span><span class="p">[</span><span class="s">&quot;phi_max&quot;</span><span class="p">]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">nbins</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">params</span><span class="p">[</span><span class="s">&quot;nbins&quot;</span><span class="p">])</span>
+        
+        <span class="bp">self</span><span class="o">.</span><span class="n">inner_circle</span><span class="o">.</span><span class="n">set_cursor</span><span class="p">(</span><span class="n">inner</span><span class="p">,</span> <span class="n">phi_min</span><span class="p">,</span> <span class="n">phi_max</span><span class="p">,</span><span class="bp">self</span><span class="o">.</span><span class="n">nbins</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">outer_circle</span><span class="o">.</span><span class="n">set_cursor</span><span class="p">(</span><span class="n">outer</span><span class="p">,</span>  <span class="n">phi_min</span><span class="p">,</span> <span class="n">phi_max</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">nbins</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">right_edge</span><span class="o">.</span><span class="n">set_cursor</span><span class="p">(</span><span class="n">inner</span><span class="p">,</span> <span class="n">outer</span><span class="p">,</span> <span class="n">phi_min</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">left_edge</span><span class="o">.</span><span class="n">set_cursor</span><span class="p">(</span><span class="n">inner</span><span class="p">,</span> <span class="n">outer</span><span class="p">,</span> <span class="n">phi_max</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_post_data</span><span class="p">()</span>
+        </div>
+<div class="viewcode-block" id="SectorInteractor.freeze_axes"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AzimutSlicer.SectorInteractor.freeze_axes">[docs]</a>    <span class="k">def</span> <span class="nf">freeze_axes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">freeze_axes</span><span class="p">()</span>
+        </div>
+<div class="viewcode-block" id="SectorInteractor.thaw_axes"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AzimutSlicer.SectorInteractor.thaw_axes">[docs]</a>    <span class="k">def</span> <span class="nf">thaw_axes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">thaw_axes</span><span class="p">()</span>
+</div>
+<div class="viewcode-block" id="SectorInteractor.draw"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AzimutSlicer.SectorInteractor.draw">[docs]</a>    <span class="k">def</span> <span class="nf">draw</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">draw</span><span class="p">()</span>
+</div></div>
+<div class="viewcode-block" id="SectorInteractorQ"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AzimutSlicer.SectorInteractorQ">[docs]</a><span class="k">class</span> <span class="nc">SectorInteractorQ</span><span class="p">(</span><span class="n">SectorInteractor</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s">&#39;black&#39;</span><span class="p">,</span> <span class="n">zorder</span><span class="o">=</span><span class="mi">3</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">SectorInteractor</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="n">color</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">=</span><span class="n">base</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_post_data</span><span class="p">()</span>
+        
+    <span class="k">def</span> <span class="nf">_post_data</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="kn">from</span> <span class="nn">sas.dataloader.manipulations</span> <span class="kn">import</span> <span class="n">SectorQ</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">post_data</span><span class="p">(</span><span class="n">SectorQ</span><span class="p">)</span>   
+        
+</div>
+<div class="viewcode-block" id="SectorInteractorPhi"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.AzimutSlicer.SectorInteractorPhi">[docs]</a><span class="k">class</span> <span class="nc">SectorInteractorPhi</span><span class="p">(</span><span class="n">SectorInteractor</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s">&#39;black&#39;</span><span class="p">,</span> <span class="n">zorder</span><span class="o">=</span><span class="mi">3</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">SectorInteractor</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="n">color</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">=</span><span class="n">base</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_post_data</span><span class="p">()</span>
+        
+    <span class="k">def</span> <span class="nf">_post_data</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="kn">from</span> <span class="nn">sas.dataloader.manipulations</span> <span class="kn">import</span> <span class="n">SectorPhi</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">post_data</span><span class="p">(</span><span class="n">SectorPhi</span> <span class="p">)</span>   
+        
+        </div>
+</pre></div>
+
+          </div>
+        </div>
+      </div>
+      <div class="sphinxsidebar">
+        <div class="sphinxsidebarwrapper">
+<div id="searchbox" style="display: none">
+  <h3>Quick search</h3>
+    <form class="search" action="../../../../../search.html" method="get">
+      <input type="text" name="q" />
+      <input type="submit" value="Go" />
+      <input type="hidden" name="check_keywords" value="yes" />
+      <input type="hidden" name="area" value="default" />
+    </form>
+    <p class="searchtip" style="font-size: 90%">
+    Enter search terms or a module, class or function name.
+    </p>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+        </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" >sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>
+    <div class="footer">
+        &copy; Copyright 2013, The SasView Project.
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
+    </div>
+  </body>
+</html>
Index: _modules/sas/guiframe/local_perspectives/plotting/Edge.html
===================================================================
--- _modules/sas/guiframe/local_perspectives/plotting/Edge.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
+++ _modules/sas/guiframe/local_perspectives/plotting/Edge.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
@@ -0,0 +1,237 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>sas.guiframe.local_perspectives.plotting.Edge &mdash; SasView 3.0.0 documentation</title>
+    
+    <link rel="stylesheet" href="../../../../../_static/default.css" type="text/css" />
+    <link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '../../../../../',
+        VERSION:     '3.0.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="../../../../../_static/jquery.js"></script>
+    <script type="text/javascript" src="../../../../../_static/underscore.js"></script>
+    <script type="text/javascript" src="../../../../../_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <link rel="top" title="SasView 3.0.0 documentation" href="../../../../../index.html" />
+    <link rel="up" title="sas.guiframe" href="../../../guiframe.html" /> 
+  </head>
+  <body>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" accesskey="U">sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>  
+
+    <div class="document">
+      <div class="documentwrapper">
+        <div class="bodywrapper">
+          <div class="body">
+            
+  <h1>Source code for sas.guiframe.local_perspectives.plotting.Edge</h1><div class="highlight"><pre>
+<span class="kn">import</span> <span class="nn">math</span>
+<span class="c">#import wx  </span>
+<span class="c">#from copy import deepcopy</span>
+<span class="kn">from</span> <span class="nn">BaseInteractor</span> <span class="kn">import</span> <span class="n">_BaseInteractor</span>
+<span class="c">#from sas.guiframe.events import NewPlotEvent</span>
+<span class="c">#from sas.guiframe.events import StatusEvent</span>
+<span class="c">#from sas.guiframe.events import SlicerParameterEvent</span>
+<span class="c">#from sas.guiframe.events import EVT_SLICER_PARS</span>
+   
+
+<span class="k">class</span> <span class="nc">RadiusInteractor</span><span class="p">(</span><span class="n">_BaseInteractor</span><span class="p">):</span>
+<div class="viewcode-block" id="RadiusInteractor"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Edge.RadiusInteractor">[docs]</a>    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Select an annulus through a 2D plot</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s">&#39;black&#39;</span><span class="p">,</span> <span class="n">zorder</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">arc1</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
+                 <span class="n">arc2</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">theta</span><span class="o">=</span><span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="o">/</span><span class="mi">8</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">_BaseInteractor</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="n">color</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">markers</span> <span class="o">=</span> <span class="p">[]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">axes</span> <span class="o">=</span> <span class="n">axes</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">r1</span> <span class="o">=</span> <span class="n">arc1</span><span class="o">.</span><span class="n">get_radius</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">r2</span> <span class="o">=</span> <span class="n">arc2</span><span class="o">.</span><span class="n">get_radius</span><span class="p">()</span>
+        <span class="c">#print &quot;radius init&quot;, self.r1, self.r2</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">theta</span> <span class="o">=</span> <span class="n">theta</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_theta</span> <span class="o">=</span> <span class="n">theta</span>
+        <span class="c">#self.scale = 10.0</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">move_stop</span> <span class="o">=</span> <span class="bp">False</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">theta_left</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">theta_right</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">arc1</span> <span class="o">=</span> <span class="n">arc1</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">arc2</span> <span class="o">=</span> <span class="n">arc2</span>
+        <span class="c">#raise &quot;Version error&quot;, message</span>
+        <span class="n">x1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">r1</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">cos</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">theta</span><span class="p">)</span>
+        <span class="n">y1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">r1</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">sin</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">theta</span><span class="p">)</span>
+        <span class="n">x2</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">r2</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">cos</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">theta</span><span class="p">)</span>
+        <span class="n">y2</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">r2</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">sin</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">theta</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">line</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">plot</span><span class="p">([</span><span class="n">x1</span><span class="p">,</span> <span class="n">x2</span><span class="p">],</span> <span class="p">[</span><span class="n">y1</span><span class="p">,</span> <span class="n">y2</span><span class="p">],</span>
+                                      <span class="n">linestyle</span><span class="o">=</span><span class="s">&#39;-&#39;</span><span class="p">,</span> <span class="n">marker</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">,</span>
+                                      <span class="n">color</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">color</span><span class="p">,</span>
+                                      <span class="n">visible</span><span class="o">=</span><span class="bp">True</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">phi</span> <span class="o">=</span> <span class="n">theta</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">npts</span> <span class="o">=</span> <span class="mi">20</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">has_move</span> <span class="o">=</span> <span class="bp">False</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">connect_markers</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">line</span><span class="p">])</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        
+    <span class="k">def</span> <span class="nf">set_layer</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">n</span><span class="p">):</span>
+<div class="viewcode-block" id="RadiusInteractor.set_layer"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Edge.RadiusInteractor.set_layer">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">layernum</span> <span class="o">=</span> <span class="n">n</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        
+    <span class="k">def</span> <span class="nf">clear</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></div>
+<div class="viewcode-block" id="RadiusInteractor.clear"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Edge.RadiusInteractor.clear">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">clear_markers</span><span class="p">()</span>
+        <span class="k">try</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">line</span><span class="o">.</span><span class="n">remove</span><span class="p">()</span>
+        <span class="k">except</span><span class="p">:</span>
+            <span class="c"># Old version of matplotlib</span>
+            <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">lines</span><span class="p">)):</span>
+                <span class="k">del</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">lines</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
+    
+    <span class="k">def</span> <span class="nf">get_angle</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></div>
+<div class="viewcode-block" id="RadiusInteractor.get_angle"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Edge.RadiusInteractor.get_angle">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta</span>
+        
+    <span class="k">def</span> <span class="nf">update</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">r1</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">r2</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">theta</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span></div>
+<div class="viewcode-block" id="RadiusInteractor.update"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Edge.RadiusInteractor.update">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Draw the new roughness on the graph.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">if</span> <span class="n">r1</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">r1</span> <span class="o">=</span> <span class="n">r1</span>
+        <span class="k">if</span> <span class="n">r2</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">r2</span> <span class="o">=</span> <span class="n">r2</span>
+        <span class="k">if</span> <span class="n">theta</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">theta</span> <span class="o">=</span> <span class="n">theta</span>
+        <span class="c">#print &quot;in the edge r1, r2&quot;,self.r1,self.r2,math.degrees(self.theta)</span>
+        <span class="n">x1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">r1</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">cos</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">theta</span><span class="p">)</span>
+        <span class="n">y1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">r1</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">sin</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">theta</span><span class="p">)</span>
+        <span class="n">x2</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">r2</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">cos</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">theta</span><span class="p">)</span>
+        <span class="n">y2</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">r2</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">sin</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">theta</span><span class="p">)</span>  
+        <span class="bp">self</span><span class="o">.</span><span class="n">line</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">xdata</span><span class="o">=</span><span class="p">[</span><span class="n">x1</span><span class="p">,</span> <span class="n">x2</span><span class="p">],</span> <span class="n">ydata</span><span class="o">=</span><span class="p">[</span><span class="n">y1</span><span class="p">,</span> <span class="n">y2</span><span class="p">])</span>
+        
+    <span class="k">def</span> <span class="nf">save</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span></div>
+<div class="viewcode-block" id="RadiusInteractor.save"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Edge.RadiusInteractor.save">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Remember the roughness for this layer and the next so that we</span>
+<span class="sd">        can restore on Esc.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_theta</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">atan2</span><span class="p">(</span><span class="n">ev</span><span class="o">.</span><span class="n">y</span><span class="p">,</span><span class="n">ev</span><span class="o">.</span><span class="n">x</span><span class="p">)</span>
+        <span class="c">#self.save_theta= self.theta</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">freeze_axes</span><span class="p">()</span>
+   
+    <span class="k">def</span> <span class="nf">moveend</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span></div>
+<div class="viewcode-block" id="RadiusInteractor.moveend"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Edge.RadiusInteractor.moveend">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">has_move</span> <span class="o">=</span> <span class="bp">False</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">moveend</span><span class="p">(</span><span class="n">ev</span><span class="p">)</span>
+            
+    <span class="k">def</span> <span class="nf">restore</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span></div>
+<div class="viewcode-block" id="RadiusInteractor.restore"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Edge.RadiusInteractor.restore">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Restore the roughness for this layer.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">theta</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">save_theta</span>
+
+    <span class="k">def</span> <span class="nf">move</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span></div>
+<div class="viewcode-block" id="RadiusInteractor.move"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Edge.RadiusInteractor.move">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Process move to a new position, making sure that the move is allowed.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">theta</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">atan2</span><span class="p">(</span><span class="n">y</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">has_move</span> <span class="o">=</span> <span class="bp">True</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        
+    <span class="k">def</span> <span class="nf">set_cursor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">r_min</span><span class="p">,</span> <span class="n">r_max</span><span class="p">,</span> <span class="n">theta</span><span class="p">):</span></div>
+<div class="viewcode-block" id="RadiusInteractor.set_cursor"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Edge.RadiusInteractor.set_cursor">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">theta</span> <span class="o">=</span> <span class="n">theta</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">r1</span> <span class="o">=</span> <span class="n">r_min</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">r2</span> <span class="o">=</span> <span class="n">r_max</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        
+    <span class="k">def</span> <span class="nf">get_params</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></div>
+<div class="viewcode-block" id="RadiusInteractor.get_params"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Edge.RadiusInteractor.get_params">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">params</span> <span class="o">=</span> <span class="p">{}</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;radius1&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">r1</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;radius2&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">r2</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;theta&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta</span>
+        <span class="k">return</span> <span class="n">params</span>
+    
+    <span class="k">def</span> <span class="nf">set_params</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">params</span><span class="p">):</span></div>
+<div class="viewcode-block" id="RadiusInteractor.set_params"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Edge.RadiusInteractor.set_params">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c">#print &quot;when here set curcor arc&quot;</span>
+        <span class="n">x1</span> <span class="o">=</span> <span class="n">params</span><span class="p">[</span><span class="s">&quot;radius1&quot;</span><span class="p">]</span> 
+        <span class="n">x2</span> <span class="o">=</span> <span class="n">params</span><span class="p">[</span><span class="s">&quot;radius2&quot;</span><span class="p">]</span> 
+        <span class="n">theta</span><span class="o">=</span> <span class="n">params</span><span class="p">[</span><span class="s">&quot;theta&quot;</span><span class="p">]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">set_cursor</span><span class="p">(</span><span class="n">x1</span><span class="p">,</span> <span class="n">x2</span><span class="p">,</span> <span class="n">theta</span><span class="p">)</span>
+        
+    
+</pre></div></div></div>
+
+          </div>
+        </div>
+      </div>
+      <div class="sphinxsidebar">
+        <div class="sphinxsidebarwrapper">
+<div id="searchbox" style="display: none">
+  <h3>Quick search</h3>
+    <form class="search" action="../../../../../search.html" method="get">
+      <input type="text" name="q" />
+      <input type="submit" value="Go" />
+      <input type="hidden" name="check_keywords" value="yes" />
+      <input type="hidden" name="area" value="default" />
+    </form>
+    <p class="searchtip" style="font-size: 90%">
+    Enter search terms or a module, class or function name.
+    </p>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+        </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" >sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>
+    <div class="footer">
+        &copy; Copyright 2013, The SasView Project.
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
+    </div>
+  </body>
+</html>
Index: _modules/sas/guiframe/local_perspectives/plotting/Plotter1D.html
===================================================================
--- _modules/sas/guiframe/local_perspectives/plotting/Plotter1D.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
+++ _modules/sas/guiframe/local_perspectives/plotting/Plotter1D.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
@@ -0,0 +1,978 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>sas.guiframe.local_perspectives.plotting.Plotter1D &mdash; SasView 3.0.0 documentation</title>
+    
+    <link rel="stylesheet" href="../../../../../_static/default.css" type="text/css" />
+    <link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '../../../../../',
+        VERSION:     '3.0.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="../../../../../_static/jquery.js"></script>
+    <script type="text/javascript" src="../../../../../_static/underscore.js"></script>
+    <script type="text/javascript" src="../../../../../_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <link rel="top" title="SasView 3.0.0 documentation" href="../../../../../index.html" />
+    <link rel="up" title="sas.guiframe" href="../../../guiframe.html" /> 
+  </head>
+  <body>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" accesskey="U">sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>  
+
+    <div class="document">
+      <div class="documentwrapper">
+        <div class="bodywrapper">
+          <div class="body">
+            
+  <h1>Source code for sas.guiframe.local_perspectives.plotting.Plotter1D</h1><div class="highlight"><pre>
+<span class="c">################################################################################</span>
+<span class="c">#This software was developed by the University of Tennessee as part of the</span>
+<span class="c">#Distributed Data Analysis of Neutron Scattering Experiments (DANSE)</span>
+<span class="c">#project funded by the US National Science Foundation. </span>
+<span class="c">#</span>
+<span class="c">#See the license text in license.txt</span>
+<span class="c">#</span>
+<span class="c">#copyright 2008, University of Tennessee</span>
+<span class="c">################################################################################</span>
+
+
+<span class="kn">import</span> <span class="nn">wx</span>
+<span class="kn">import</span> <span class="nn">sys</span>
+<span class="kn">import</span> <span class="nn">math</span>
+<span class="kn">import</span> <span class="nn">numpy</span>
+
+<span class="kn">from</span> <span class="nn">sas.plottools.PlotPanel</span> <span class="kn">import</span> <span class="n">PlotPanel</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">StatusEvent</span> 
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">PanelOnFocusEvent</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.utils</span> <span class="kn">import</span> <span class="n">PanelMenu</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.panel_base</span> <span class="kn">import</span> <span class="n">PanelBase</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.gui_style</span> <span class="kn">import</span> <span class="n">GUIFRAME_ICON</span>
+<span class="kn">from</span> <span class="nn">appearanceDialog</span> <span class="kn">import</span> <span class="n">appearanceDialog</span>
+<span class="kn">from</span> <span class="nn">graphAppearance</span> <span class="kn">import</span> <span class="n">graphAppearance</span>
+
+<span class="n">DEFAULT_QMAX</span> <span class="o">=</span> <span class="mf">0.05</span>
+<span class="n">DEFAULT_QSTEP</span> <span class="o">=</span> <span class="mf">0.001</span>
+<span class="n">DEFAULT_BEAM</span> <span class="o">=</span> <span class="mf">0.005</span>
+<span class="n">BIN_WIDTH</span> <span class="o">=</span> <span class="mi">1</span>
+<span class="n">IS_MAC</span> <span class="o">=</span> <span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">platform</span> <span class="o">==</span> <span class="s">&#39;darwin&#39;</span><span class="p">)</span>
+
+
+<span class="k">def</span> <span class="nf">find_key</span><span class="p">(</span><span class="n">dic</span><span class="p">,</span> <span class="n">val</span><span class="p">):</span>
+<div class="viewcode-block" id="find_key"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter1D.find_key">[docs]</a>    <span class="sd">&quot;&quot;&quot;return the key of dictionary dic given the value&quot;&quot;&quot;</span>
+    <span class="k">return</span> <span class="p">[</span><span class="n">k</span> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">dic</span><span class="o">.</span><span class="n">iteritems</span><span class="p">()</span> <span class="k">if</span> <span class="n">v</span> <span class="o">==</span> <span class="n">val</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span>
+
+
+
+<span class="k">class</span> <span class="nc">ModelPanel1D</span><span class="p">(</span><span class="n">PlotPanel</span><span class="p">,</span> <span class="n">PanelBase</span><span class="p">):</span></div>
+<div class="viewcode-block" id="ModelPanel1D"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter1D.ModelPanel1D">[docs]</a>    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Plot panel for use with the GUI manager</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    
+    <span class="c">## Internal name for the AUI manager</span>
+    <span class="n">window_name</span> <span class="o">=</span> <span class="s">&quot;plotpanel&quot;</span>
+    <span class="c">## Title to appear on top of the window</span>
+    <span class="n">window_caption</span> <span class="o">=</span> <span class="s">&quot;Graph&quot;</span>
+    <span class="c">## Flag to tell the GUI manager that this panel is not</span>
+    <span class="c">#  tied to any perspective</span>
+    <span class="n">ALWAYS_ON</span> <span class="o">=</span> <span class="bp">True</span>
+    <span class="c">## Group ID</span>
+    <span class="n">group_id</span> <span class="o">=</span> <span class="bp">None</span>
+    
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="nb">id</span><span class="o">=-</span><span class="mi">1</span><span class="p">,</span> <span class="n">color</span> <span class="o">=</span> <span class="bp">None</span><span class="p">,</span>
+                 <span class="n">dpi</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">NO_FULL_REPAINT_ON_RESIZE</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
+        <span class="n">PlotPanel</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="nb">id</span><span class="o">=</span><span class="nb">id</span><span class="p">,</span> <span class="n">style</span><span class="o">=</span><span class="n">style</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
+        <span class="n">PanelBase</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">)</span>
+        <span class="c">## Reference to the parent window</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="n">parent</span>
+        <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">parent</span><span class="p">,</span> <span class="s">&quot;parent&quot;</span><span class="p">):</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">parent</span>
+        <span class="c">## Plottables</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plots</span> <span class="o">=</span> <span class="p">{}</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">frame</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="c">#context menu</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_slicerpop</span> <span class="o">=</span> <span class="bp">None</span>
+        
+        <span class="bp">self</span><span class="o">.</span><span class="n">_available_data</span> <span class="o">=</span> <span class="p">[]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_menu_add_ids</span> <span class="o">=</span> <span class="p">[]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_symbol_labels</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_symbol_label</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_color_labels</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_color_label</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">currColorIndex</span> <span class="o">=</span> <span class="s">&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_is_changed_legend_label</span> <span class="o">=</span> <span class="bp">False</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">is_xtick</span> <span class="o">=</span> <span class="bp">False</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">is_ytick</span> <span class="o">=</span> <span class="bp">False</span>
+      
+        <span class="bp">self</span><span class="o">.</span><span class="n">hide_menu</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="c">## Unique ID (from gui_manager)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">uid</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">x_size</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="c">## Default locations</span>
+        <span class="c">#self._default_save_location = os.getcwd() </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">size</span> <span class="o">=</span> <span class="bp">None</span>  
+        <span class="bp">self</span><span class="o">.</span><span class="n">vl_ind</span> <span class="o">=</span> <span class="mi">0</span>     
+        <span class="c">## Graph        </span>
+        <span class="c">#self.graph = Graph()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">xaxis</span><span class="p">(</span><span class="s">&quot;</span><span class="se">\\</span><span class="s">rm{Q}&quot;</span><span class="p">,</span> <span class="s">&#39;A^{-1}&#39;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">yaxis</span><span class="p">(</span><span class="s">&quot;</span><span class="se">\\</span><span class="s">rm{Intensity} &quot;</span><span class="p">,</span> <span class="s">&quot;cm^{-1}&quot;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">render</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">cursor_id</span> <span class="o">=</span> <span class="bp">None</span>
+        
+        <span class="c"># In resizing event</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">resizing</span> <span class="o">=</span> <span class="bp">False</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">set_resizing</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">resizing</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_SIZE</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_OnReSize</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_add_more_tool</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">SetFocus</span><span class="p">()</span>
+        
+        
+    <span class="k">def</span> <span class="nf">get_symbol_label</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+<div class="viewcode-block" id="ModelPanel1D.get_symbol_label"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter1D.ModelPanel1D.get_symbol_label">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Associates label to symbol</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">_labels</span> <span class="o">=</span> <span class="p">{}</span>
+        <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;Circle&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;Cross X &#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;Triangle Down&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;Triangle Up&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;Triangle Left&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;Triangle Right&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;Cross +&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;Square&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;diamond&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;Diamond&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;Hexagon1&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;Hexagon2&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;Pentagon&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;Line&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;Dash&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;Vline&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;Step&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="k">return</span> <span class="n">_labels</span>
+    
+    <span class="k">def</span> <span class="nf">get_color_label</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></div>
+<div class="viewcode-block" id="ModelPanel1D.get_color_label"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter1D.ModelPanel1D.get_color_label">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Associates label to a specific color</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">_labels</span> <span class="o">=</span> <span class="p">{}</span>
+        <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;Blue&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;Green&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;Red&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;Cyan&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;Magenta&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;Yellow&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;Black&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="k">return</span> <span class="n">_labels</span>
+
+    
+    <span class="k">def</span> <span class="nf">set_data</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">list</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span></div>
+<div class="viewcode-block" id="ModelPanel1D.set_data"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter1D.ModelPanel1D.set_data">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">pass</span>
+    
+    <span class="k">def</span> <span class="nf">_reset</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></div>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Resets internal data and graph</span>
+<span class="sd">        &quot;&quot;&quot;</span>    
+        <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">reset</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plots</span>      <span class="o">=</span> <span class="p">{}</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">is_zoomed</span> <span class="o">=</span> <span class="bp">False</span>
+        
+    <span class="k">def</span> <span class="nf">_OnReSize</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>   
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        On response of the resize of a panel, set axes_visiable False</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># It was found that wx &gt;= 2.9.3 sends an event even if no size changed.</span>
+        <span class="c"># So manually recode the size (=x_size) and compare here.</span>
+        <span class="c"># Massy code to work around:&lt;</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">_mgr</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="n">max_panel</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">_mgr</span><span class="o">.</span><span class="n">GetPane</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
+            <span class="k">if</span> <span class="n">max_panel</span><span class="o">.</span><span class="n">IsMaximized</span><span class="p">():</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">_mgr</span><span class="o">.</span><span class="n">RestorePane</span><span class="p">(</span><span class="n">max_panel</span><span class="p">)</span>
+                <span class="n">max_panel</span><span class="o">.</span><span class="n">Maximize</span><span class="p">()</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">x_size</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">x_size</span> <span class="o">==</span> <span class="bp">self</span><span class="o">.</span><span class="n">GetSize</span><span class="p">():</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">resizing</span> <span class="o">=</span> <span class="bp">False</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">set_resizing</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">resizing</span><span class="p">)</span>
+                <span class="k">return</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">x_size</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">GetSize</span><span class="p">()</span>
+
+        <span class="c"># Ready for another event</span>
+        <span class="c"># Do not remove this Skip. Otherwise it will get runtime error on wx&gt;=2.9.</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">Skip</span><span class="p">()</span> 
+        <span class="c"># set the resizing flag</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">resizing</span> <span class="o">=</span> <span class="bp">True</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">set_resizing</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">resizing</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">set_schedule</span><span class="p">(</span><span class="bp">True</span><span class="p">)</span>
+        <span class="n">pos_x</span><span class="p">,</span> <span class="n">pos_y</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">GetPositionTuple</span><span class="p">()</span>
+        <span class="k">if</span> <span class="n">pos_x</span> <span class="o">!=</span> <span class="mi">0</span> <span class="ow">and</span> <span class="n">pos_y</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">size</span><span class="p">,</span> <span class="n">_</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">GetClientSizeTuple</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">SetSizer</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">sizer</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">CallAfter</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">disable_app_menu</span><span class="p">,</span><span class="bp">self</span><span class="p">)</span>
+        
+    <span class="k">def</span> <span class="nf">on_plot_qrange</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+<div class="viewcode-block" id="ModelPanel1D.on_plot_qrange"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter1D.ModelPanel1D.on_plot_qrange">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        On Qmin Qmax vertical line event</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">if</span> <span class="n">event</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="k">return</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">Skip</span><span class="p">()</span> 
+        <span class="n">active_ctrl</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">active</span>
+        <span class="k">if</span> <span class="n">active_ctrl</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="k">return</span>
+        <span class="k">if</span> <span class="n">event</span><span class="o">.</span><span class="n">id</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
+            <span class="c"># Set line position and color</span>
+            <span class="n">colors</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;red&#39;</span><span class="p">,</span> <span class="s">&#39;purple&#39;</span><span class="p">]</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">cursor_id</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">id</span>
+            <span class="n">ctrl</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">ctrl</span>
+            <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">ly</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">ly</span> <span class="o">=</span> <span class="p">[]</span>
+                <span class="k">for</span> <span class="n">ind_ly</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">colors</span><span class="p">)):</span>
+                    <span class="bp">self</span><span class="o">.</span><span class="n">ly</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">axvline</span><span class="p">(</span><span class="n">color</span><span class="o">=</span><span class="n">colors</span><span class="p">[</span><span class="n">ind_ly</span><span class="p">],</span> 
+                                                        <span class="n">lw</span><span class="o">=</span><span class="mf">2.5</span><span class="p">,</span> <span class="n">alpha</span><span class="o">=</span><span class="mf">0.7</span><span class="p">))</span>
+                    <span class="bp">self</span><span class="o">.</span><span class="n">ly</span><span class="p">[</span><span class="n">ind_ly</span><span class="p">]</span><span class="o">.</span><span class="n">set_rasterized</span><span class="p">(</span><span class="bp">True</span><span class="p">)</span>      
+            <span class="k">try</span><span class="p">:</span>
+                <span class="c"># Display x,y in the status bar if possible</span>
+                <span class="n">xval</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">active_ctrl</span><span class="o">.</span><span class="n">GetValue</span><span class="p">())</span>
+                <span class="n">position</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_data_xy_vals</span><span class="p">(</span><span class="n">xval</span><span class="p">)</span>
+                <span class="k">if</span> <span class="n">position</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+                    <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> <span class="n">StatusEvent</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="n">position</span><span class="p">))</span>
+            <span class="k">except</span><span class="p">:</span>
+                <span class="k">pass</span>
+            <span class="k">if</span> <span class="ow">not</span> <span class="n">event</span><span class="o">.</span><span class="n">leftdown</span><span class="p">:</span>
+                <span class="c"># text event </span>
+                <span class="k">try</span><span class="p">:</span>
+                    <span class="n">is_moved</span> <span class="o">=</span> <span class="bp">False</span>
+                    <span class="k">for</span> <span class="n">idx</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">ly</span><span class="p">)):</span>
+                        <span class="n">val</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">ctrl</span><span class="p">[</span><span class="n">idx</span><span class="p">]</span><span class="o">.</span><span class="n">GetValue</span><span class="p">())</span>
+                        <span class="c"># check if vline moved</span>
+                        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">ly</span><span class="p">[</span><span class="n">idx</span><span class="p">]</span><span class="o">.</span><span class="n">get_xdata</span><span class="p">()</span> <span class="o">!=</span> <span class="n">val</span><span class="p">:</span>
+                            <span class="bp">self</span><span class="o">.</span><span class="n">ly</span><span class="p">[</span><span class="n">idx</span><span class="p">]</span><span class="o">.</span><span class="n">set_xdata</span><span class="p">(</span><span class="n">val</span><span class="p">)</span>
+                            <span class="n">is_moved</span> <span class="o">=</span> <span class="bp">True</span>
+                    <span class="k">if</span> <span class="n">is_moved</span><span class="p">:</span>
+                        <span class="bp">self</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">draw</span><span class="p">()</span> 
+                <span class="k">except</span><span class="p">:</span>
+                    <span class="k">pass</span>
+                <span class="n">event</span><span class="o">.</span><span class="n">Skip</span><span class="p">()</span> 
+                <span class="k">return</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">q_ctrl</span> <span class="o">=</span> <span class="n">ctrl</span>
+            <span class="k">try</span><span class="p">:</span>
+                <span class="n">pos_x_min</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">q_ctrl</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">GetValue</span><span class="p">())</span>
+            <span class="k">except</span><span class="p">:</span>
+                <span class="n">pos_x_min</span> <span class="o">=</span> <span class="n">xmin</span>
+            <span class="k">try</span><span class="p">:</span>
+                <span class="n">pos_x_max</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">q_ctrl</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">GetValue</span><span class="p">())</span>
+            <span class="k">except</span><span class="p">:</span>
+                <span class="n">pos_x_max</span> <span class="o">=</span> <span class="n">xmax</span>
+            <span class="n">pos_x</span> <span class="o">=</span> <span class="p">[</span><span class="n">pos_x_min</span><span class="p">,</span> <span class="n">pos_x_max</span><span class="p">]</span>
+            <span class="k">for</span> <span class="n">ind_ly</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">colors</span><span class="p">)):</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">ly</span><span class="p">[</span><span class="n">ind_ly</span><span class="p">]</span><span class="o">.</span><span class="n">set_color</span><span class="p">(</span><span class="n">colors</span><span class="p">[</span><span class="n">ind_ly</span><span class="p">])</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">ly</span><span class="p">[</span><span class="n">ind_ly</span><span class="p">]</span><span class="o">.</span><span class="n">set_xdata</span><span class="p">(</span><span class="n">pos_x</span><span class="p">[</span><span class="n">ind_ly</span><span class="p">])</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">draw</span><span class="p">()</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">q_ctrl</span> <span class="o">=</span> <span class="bp">None</span>
+    
+    <span class="k">def</span> <span class="nf">get_data_xy_vals</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">xval</span><span class="p">):</span></div>
+<div class="viewcode-block" id="ModelPanel1D.get_data_xy_vals"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter1D.ModelPanel1D.get_data_xy_vals">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Get x, y data values near x = x_val</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">try</span><span class="p">:</span>
+            <span class="n">x_data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">cursor_id</span><span class="p">]</span><span class="o">.</span><span class="n">x</span>
+            <span class="n">y_data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">cursor_id</span><span class="p">]</span><span class="o">.</span><span class="n">y</span>
+            <span class="n">indx</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_find_nearest</span><span class="p">(</span><span class="n">x_data</span><span class="p">,</span> <span class="n">xval</span><span class="p">)</span>
+            <span class="n">pos_x</span> <span class="o">=</span> <span class="n">x_data</span><span class="p">[</span><span class="n">indx</span><span class="p">]</span>
+            <span class="n">pos_y</span> <span class="o">=</span> <span class="n">y_data</span><span class="p">[</span><span class="n">indx</span><span class="p">]</span>
+            <span class="n">position</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">pos_x</span><span class="p">),</span> <span class="nb">str</span><span class="p">(</span><span class="n">pos_y</span><span class="p">)</span>
+            <span class="k">return</span> <span class="n">position</span>
+        <span class="k">except</span><span class="p">:</span>
+            <span class="k">return</span> <span class="bp">None</span>
+           
+    <span class="k">def</span> <span class="nf">_find_nearest</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">array</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span></div>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Find and return the nearest value in array to the value.</span>
+<span class="sd">        Used in cusor_line()</span>
+<span class="sd">        :Param array: numpy array</span>
+<span class="sd">        :Param value: float</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">idx</span> <span class="o">=</span> <span class="p">(</span><span class="n">numpy</span><span class="o">.</span><span class="n">abs</span><span class="p">(</span><span class="n">array</span> <span class="o">-</span> <span class="n">value</span><span class="p">))</span><span class="o">.</span><span class="n">argmin</span><span class="p">()</span>
+        <span class="k">return</span> <span class="nb">int</span><span class="p">(</span><span class="n">idx</span><span class="p">)</span><span class="c">#array.flat[idx]</span>
+    
+    <span class="k">def</span> <span class="nf">_check_line_positions</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">pos_x</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">nop</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Check vertical line positions</span>
+<span class="sd">        :Param pos_x: position of the current line [float]</span>
+<span class="sd">        :Param nop: number of plots [int]</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">ly</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">ly</span>
+        <span class="n">ly0x</span> <span class="o">=</span> <span class="n">ly</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">get_xdata</span><span class="p">()</span>
+        <span class="n">ly1x</span> <span class="o">=</span> <span class="n">ly</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">get_xdata</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">q_ctrl</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">SetBackgroundColour</span><span class="p">(</span><span class="s">&#39;white&#39;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">q_ctrl</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">SetBackgroundColour</span><span class="p">(</span><span class="s">&#39;white&#39;</span><span class="p">)</span>
+        <span class="k">if</span> <span class="n">ly0x</span> <span class="o">&gt;=</span> <span class="n">ly1x</span><span class="p">:</span>
+            <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">vl_ind</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
+                <span class="n">ly</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">set_xdata</span><span class="p">(</span><span class="n">pos_x</span><span class="p">)</span>
+                <span class="n">ly</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">set_zorder</span><span class="p">(</span><span class="n">nop</span><span class="p">)</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">q_ctrl</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">pos_x</span><span class="p">))</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">q_ctrl</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">SetBackgroundColour</span><span class="p">(</span><span class="s">&#39;pink&#39;</span><span class="p">)</span>
+            <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">vl_ind</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
+                <span class="n">ly</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">set_xdata</span><span class="p">(</span><span class="n">pos_x</span><span class="p">)</span>
+                <span class="n">ly</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">set_zorder</span><span class="p">(</span><span class="n">nop</span><span class="p">)</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">q_ctrl</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">pos_x</span><span class="p">))</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">q_ctrl</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">SetBackgroundColour</span><span class="p">(</span><span class="s">&#39;pink&#39;</span><span class="p">)</span>
+                
+    <span class="k">def</span> <span class="nf">_get_cusor_lines</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Revmove or switch cursor line if drawn</span>
+<span class="sd">        :Param event: LeftClick mouse event</span>
+<span class="sd">        &quot;&quot;&quot;</span>  
+        <span class="n">ax</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">inaxes</span>
+        <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">event</span><span class="p">,</span> <span class="s">&quot;action&quot;</span><span class="p">):</span>
+            <span class="n">dclick</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">action</span> <span class="o">==</span> <span class="s">&#39;dclick&#39;</span>
+            <span class="k">if</span> <span class="n">ax</span> <span class="o">==</span> <span class="bp">None</span> <span class="ow">or</span> <span class="n">dclick</span><span class="p">:</span>
+                <span class="c"># remove the vline</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">_check_zoom_plot</span><span class="p">()</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">draw</span><span class="p">()</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">q_ctrl</span> <span class="o">=</span> <span class="bp">None</span>
+                <span class="k">return</span> 
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">ly</span> <span class="o">!=</span> <span class="bp">None</span> <span class="ow">and</span> <span class="n">event</span><span class="o">.</span><span class="n">xdata</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="c"># Selecting a new line if cursor lines are displayed already</span>
+            <span class="n">dqmin</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="n">event</span><span class="o">.</span><span class="n">xdata</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">ly</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">get_xdata</span><span class="p">())</span>
+            <span class="n">dqmax</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="n">event</span><span class="o">.</span><span class="n">xdata</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">ly</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">get_xdata</span><span class="p">())</span>
+            <span class="n">is_qmax</span> <span class="o">=</span> <span class="n">dqmin</span> <span class="o">&gt;</span> <span class="n">dqmax</span>
+            <span class="k">if</span> <span class="n">is_qmax</span><span class="p">:</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">vl_ind</span> <span class="o">=</span> <span class="mi">1</span>
+            <span class="k">else</span><span class="p">:</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">vl_ind</span> <span class="o">=</span> <span class="mi">0</span> 
+                     
+    <span class="k">def</span> <span class="nf">cusor_line</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+<div class="viewcode-block" id="ModelPanel1D.cusor_line"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter1D.ModelPanel1D.cusor_line">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Move the cursor line to write Q range</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">q_ctrl</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="k">return</span>
+        <span class="c">#release a q range vline</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">ly</span> <span class="o">!=</span> <span class="bp">None</span> <span class="ow">and</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">leftdown</span><span class="p">:</span>
+            <span class="k">for</span> <span class="n">ly</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">ly</span><span class="p">:</span>
+                <span class="n">ly</span><span class="o">.</span><span class="n">set_alpha</span><span class="p">(</span><span class="mf">0.7</span><span class="p">)</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">draw</span><span class="p">()</span>
+            <span class="k">return</span>
+        <span class="n">ax</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">inaxes</span>
+        <span class="k">if</span> <span class="n">ax</span> <span class="o">==</span> <span class="bp">None</span> <span class="ow">or</span> <span class="ow">not</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">event</span><span class="p">,</span> <span class="s">&#39;action&#39;</span><span class="p">):</span>
+            <span class="k">return</span>
+        <span class="n">end_drag</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">action</span> <span class="o">!=</span> <span class="s">&#39;drag&#39;</span> <span class="ow">and</span> <span class="n">event</span><span class="o">.</span><span class="n">xdata</span> <span class="o">!=</span> <span class="bp">None</span>
+        <span class="n">nop</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">)</span>
+        <span class="n">pos_x</span><span class="p">,</span> <span class="n">pos_y</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">event</span><span class="o">.</span><span class="n">xdata</span><span class="p">),</span> <span class="nb">float</span><span class="p">(</span><span class="n">event</span><span class="o">.</span><span class="n">ydata</span><span class="p">)</span>
+        <span class="k">try</span><span class="p">:</span>
+            <span class="n">ly</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">ly</span>
+            <span class="n">ly0x</span> <span class="o">=</span> <span class="n">ly</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">get_xdata</span><span class="p">()</span>
+            <span class="n">ly1x</span> <span class="o">=</span> <span class="n">ly</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">get_xdata</span><span class="p">()</span>
+            <span class="k">if</span> <span class="n">ly0x</span> <span class="o">==</span> <span class="n">ly1x</span><span class="p">:</span>
+                <span class="k">if</span> <span class="n">ly</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">get_zorder</span><span class="p">()</span> <span class="o">&gt;</span> <span class="n">ly</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">get_zorder</span><span class="p">():</span>
+                    <span class="bp">self</span><span class="o">.</span><span class="n">vl_ind</span> <span class="o">=</span> <span class="mi">0</span>
+                <span class="k">else</span><span class="p">:</span>
+                    <span class="bp">self</span><span class="o">.</span><span class="n">vl_ind</span> <span class="o">=</span> <span class="mi">1</span>
+            <span class="n">vl_ind</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">vl_ind</span>
+            <span class="n">x_data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">cursor_id</span><span class="p">]</span><span class="o">.</span><span class="n">x</span>
+            <span class="n">y_data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">cursor_id</span><span class="p">]</span><span class="o">.</span><span class="n">y</span>
+            <span class="n">xmin</span> <span class="o">=</span> <span class="n">x_data</span><span class="o">.</span><span class="n">min</span><span class="p">()</span>
+            <span class="n">xmax</span> <span class="o">=</span> <span class="n">x_data</span><span class="o">.</span><span class="n">max</span><span class="p">()</span>
+            <span class="n">indx</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_find_nearest</span><span class="p">(</span><span class="n">x_data</span><span class="p">,</span> <span class="n">pos_x</span><span class="p">)</span>
+            <span class="c">#pos_x = self._find_nearest(x_data, pos_x)</span>
+            <span class="c">#indx = int(numpy.searchsorted(x_data, [pos_x])[0])</span>
+            <span class="c"># Need to hold LeftButton to drag</span>
+            <span class="k">if</span> <span class="n">end_drag</span><span class="p">:</span>
+                <span class="k">if</span> <span class="n">event</span><span class="o">.</span><span class="n">button</span><span class="p">:</span>
+                    <span class="bp">self</span><span class="o">.</span><span class="n">_check_line_positions</span><span class="p">(</span><span class="n">pos_x</span><span class="p">,</span> <span class="n">nop</span><span class="p">)</span>
+                <span class="k">return</span>   
+            <span class="k">if</span> <span class="n">indx</span> <span class="o">&gt;=</span> <span class="nb">len</span><span class="p">(</span><span class="n">x_data</span><span class="p">):</span>
+                <span class="n">indx</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">x_data</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span>
+            <span class="n">pos_x</span> <span class="o">=</span> <span class="n">x_data</span><span class="p">[</span><span class="n">indx</span><span class="p">]</span>
+            <span class="n">pos_y</span> <span class="o">=</span> <span class="n">y_data</span><span class="p">[</span><span class="n">indx</span><span class="p">]</span>
+            <span class="k">if</span> <span class="n">xmin</span> <span class="o">==</span> <span class="n">ly1x</span><span class="p">:</span>
+                <span class="n">vl_ind</span> <span class="o">=</span> <span class="mi">1</span>
+            <span class="k">elif</span> <span class="n">xmax</span> <span class="o">==</span> <span class="n">ly0x</span><span class="p">:</span>
+                <span class="n">vl_ind</span> <span class="o">=</span> <span class="mi">0</span>
+            <span class="k">else</span><span class="p">:</span>
+                <span class="n">ly</span><span class="p">[</span><span class="n">vl_ind</span><span class="p">]</span><span class="o">.</span><span class="n">set_xdata</span><span class="p">(</span><span class="n">pos_x</span><span class="p">)</span>
+                <span class="n">ly</span><span class="p">[</span><span class="n">vl_ind</span><span class="p">]</span><span class="o">.</span><span class="n">set_zorder</span><span class="p">(</span><span class="n">nop</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">_check_line_positions</span><span class="p">(</span><span class="n">pos_x</span><span class="p">,</span> <span class="n">nop</span><span class="p">)</span>
+            <span class="n">ly</span><span class="p">[</span><span class="n">vl_ind</span><span class="p">]</span><span class="o">.</span><span class="n">set_xdata</span><span class="p">(</span><span class="n">pos_x</span><span class="p">)</span>
+            <span class="n">ly</span><span class="p">[</span><span class="n">vl_ind</span><span class="p">]</span><span class="o">.</span><span class="n">set_alpha</span><span class="p">(</span><span class="mf">1.0</span><span class="p">)</span>
+            <span class="n">ly</span><span class="p">[</span><span class="n">vl_ind</span><span class="p">]</span><span class="o">.</span><span class="n">set_zorder</span><span class="p">(</span><span class="n">nop</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">draw</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">q_ctrl</span><span class="p">[</span><span class="n">vl_ind</span><span class="p">]</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">pos_x</span><span class="p">))</span>
+        <span class="k">except</span><span class="p">:</span>
+            <span class="k">pass</span>
+               
+    <span class="k">def</span> <span class="nf">set_resizing</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">resizing</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span></div>
+<div class="viewcode-block" id="ModelPanel1D.set_resizing"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter1D.ModelPanel1D.set_resizing">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Set the resizing (True/False)</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">resizing</span> <span class="o">=</span> <span class="n">resizing</span>
+        <span class="c">#self.canvas.set_resizing(resizing)</span>
+    
+    <span class="k">def</span> <span class="nf">schedule_full_draw</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">func</span><span class="o">=</span><span class="s">&#39;append&#39;</span><span class="p">):</span>    </div>
+<div class="viewcode-block" id="ModelPanel1D.schedule_full_draw"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter1D.ModelPanel1D.schedule_full_draw">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Put self in schedule to full redraw list</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># append/del this panel in the schedule list</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">set_schedule_full_draw</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">func</span><span class="p">)</span>
+        
+
+    <span class="k">def</span> <span class="nf">remove_data_by_id</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">):</span></div>
+<div class="viewcode-block" id="ModelPanel1D.remove_data_by_id"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter1D.ModelPanel1D.remove_data_by_id">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">            Remove data from plot</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">if</span> <span class="nb">id</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
+            <span class="n">data</span> <span class="o">=</span>  <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">[</span><span class="nb">id</span><span class="p">]</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">delete</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
+            <span class="n">data_manager</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_manager</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">get_data_manager</span><span class="p">()</span>
+            <span class="n">data_list</span><span class="p">,</span> <span class="n">theory_list</span> <span class="o">=</span> <span class="n">data_manager</span><span class="o">.</span><span class="n">get_by_id</span><span class="p">(</span><span class="n">id_list</span><span class="o">=</span><span class="p">[</span><span class="nb">id</span><span class="p">])</span>
+            
+            <span class="k">if</span> <span class="nb">id</span> <span class="ow">in</span> <span class="n">data_list</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
+                <span class="n">data</span> <span class="o">=</span> <span class="n">data_list</span><span class="p">[</span><span class="nb">id</span><span class="p">]</span>
+            <span class="k">if</span> <span class="nb">id</span> <span class="ow">in</span> <span class="n">theory_list</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
+                <span class="n">data</span> <span class="o">=</span> <span class="n">theory_list</span><span class="p">[</span><span class="nb">id</span><span class="p">]</span>
+                
+            <span class="k">del</span> <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">[</span><span class="nb">id</span><span class="p">]</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">render</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">figure</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">draw_idle</span><span class="p">()</span>    
+            <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">plottables</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
+                <span class="c">#onRemove: graph is empty must be the panel must be destroyed</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">delete_panel</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">uid</span><span class="p">)</span>
+        
+    <span class="k">def</span> <span class="nf">plot_data</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">):</span></div>
+<div class="viewcode-block" id="ModelPanel1D.plot_data"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter1D.ModelPanel1D.plot_data">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Data is ready to be displayed</span>
+<span class="sd">        </span>
+<span class="sd">        :param event: data event</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">if</span> <span class="n">data</span><span class="o">.</span><span class="n">__class__</span><span class="o">.</span><span class="n">__name__</span> <span class="o">==</span> <span class="s">&#39;Data2D&#39;</span><span class="p">:</span>
+            <span class="k">return</span>
+        <span class="n">plot_keys</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span>
+        <span class="k">if</span> <span class="n">data</span><span class="o">.</span><span class="n">id</span> <span class="ow">in</span> <span class="n">plot_keys</span><span class="p">:</span>
+            <span class="c">#Recover panel prop.s</span>
+            <span class="n">xlo</span><span class="p">,</span> <span class="n">xhi</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">get_xlim</span><span class="p">()</span>
+            <span class="n">ylo</span><span class="p">,</span> <span class="n">yhi</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">get_ylim</span><span class="p">()</span>
+            <span class="n">old_data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">[</span><span class="n">data</span><span class="o">.</span><span class="n">id</span><span class="p">]</span>
+            <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_is_changed_legend_label</span><span class="p">:</span>
+                <span class="n">data</span><span class="o">.</span><span class="n">label</span> <span class="o">=</span> <span class="n">old_data</span><span class="o">.</span><span class="n">label</span>
+            <span class="k">if</span> <span class="n">old_data</span><span class="o">.</span><span class="n">__class__</span><span class="o">.</span><span class="n">__name__</span> <span class="o">==</span> <span class="s">&#39;Data1D&#39;</span><span class="p">:</span>
+                <span class="n">data</span><span class="o">.</span><span class="n">custom_color</span> <span class="o">=</span> <span class="n">old_data</span><span class="o">.</span><span class="n">custom_color</span>
+                <span class="n">data</span><span class="o">.</span><span class="n">symbol</span> <span class="o">=</span> <span class="n">old_data</span><span class="o">.</span><span class="n">symbol</span>
+                <span class="n">data</span><span class="o">.</span><span class="n">markersize</span> <span class="o">=</span> <span class="n">old_data</span><span class="o">.</span><span class="n">markersize</span>
+                <span class="n">data</span><span class="o">.</span><span class="n">zorder</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">plot_keys</span><span class="p">)</span>
+            <span class="c"># Replace data</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">[</span><span class="n">data</span><span class="o">.</span><span class="n">id</span><span class="p">]</span> <span class="o">=</span> <span class="n">data</span>
+            <span class="c">## Set the view scale for all plots</span>
+            <span class="k">try</span><span class="p">:</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">_onEVT_FUNC_PROPERTY</span><span class="p">()</span>
+            <span class="k">except</span> <span class="ne">Exception</span><span class="p">,</span> <span class="n">exc</span><span class="p">:</span>
+                <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> <span class="n">StatusEvent</span><span class="p">(</span><span class="n">status</span><span class="o">=</span>\
+                    <span class="s">&quot;Plotting Error: </span><span class="si">%s</span><span class="s">&quot;</span><span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">exc</span><span class="p">),</span> <span class="n">info</span><span class="o">=</span><span class="s">&quot;error&quot;</span><span class="p">))</span>
+            <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_zoomed</span><span class="p">:</span>
+                <span class="c"># Recover the x,y limits</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">set_xlim</span><span class="p">((</span><span class="n">xlo</span><span class="p">,</span> <span class="n">xhi</span><span class="p">))</span>     
+                <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">set_ylim</span><span class="p">((</span><span class="n">ylo</span><span class="p">,</span> <span class="n">yhi</span><span class="p">))</span>  
+        <span class="k">else</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">[</span><span class="n">data</span><span class="o">.</span><span class="n">id</span><span class="p">]</span> <span class="o">=</span> <span class="n">data</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">[</span><span class="n">data</span><span class="o">.</span><span class="n">id</span><span class="p">])</span> 
+            <span class="n">data</span><span class="o">.</span><span class="n">zorder</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">plot_keys</span><span class="p">)</span>
+            <span class="c">## Set the view scale for all plots</span>
+            <span class="k">try</span><span class="p">:</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">_onEVT_FUNC_PROPERTY</span><span class="p">()</span>
+                <span class="k">if</span> <span class="n">IS_MAC</span><span class="p">:</span>
+                    <span class="c"># MAC: forcing to plot 2D avg</span>
+                    <span class="bp">self</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">_onDrawIdle</span><span class="p">()</span>
+            <span class="k">except</span> <span class="ne">Exception</span><span class="p">,</span><span class="n">exc</span><span class="p">:</span>
+                <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> <span class="n">StatusEvent</span><span class="p">(</span><span class="n">status</span><span class="o">=</span>\
+                    <span class="s">&quot;Plotting Error: </span><span class="si">%s</span><span class="s">&quot;</span><span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">exc</span><span class="p">),</span> <span class="n">info</span><span class="o">=</span><span class="s">&quot;error&quot;</span><span class="p">))</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">toolbar</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">is_zoomed</span> <span class="o">=</span> <span class="bp">False</span>
+            
+    <span class="k">def</span> <span class="nf">draw_plot</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></div>
+<div class="viewcode-block" id="ModelPanel1D.draw_plot"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter1D.ModelPanel1D.draw_plot">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Draw plot</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">draw</span><span class="p">()</span>  
+
+    <span class="k">def</span> <span class="nf">onLeftDown</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="n">event</span><span class="p">):</span> </div>
+<div class="viewcode-block" id="ModelPanel1D.onLeftDown"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter1D.ModelPanel1D.onLeftDown">[docs]</a>        <span class="sd">&quot;&quot;&quot; </span>
+<span class="sd">        left button down and ready to drag</span>
+<span class="sd">        Display the position of the mouse on the statusbar</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c">#self.parent.set_plot_unfocus() </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_get_cusor_lines</span><span class="p">(</span><span class="n">event</span><span class="p">)</span>
+        <span class="n">ax</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">inaxes</span>
+        <span class="n">PlotPanel</span><span class="o">.</span><span class="n">onLeftDown</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">)</span>
+        <span class="k">if</span> <span class="n">ax</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="k">try</span><span class="p">:</span>
+                <span class="n">pos_x</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">event</span><span class="o">.</span><span class="n">xdata</span><span class="p">)</span><span class="c"># / size_x</span>
+                <span class="n">pos_y</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">event</span><span class="o">.</span><span class="n">ydata</span><span class="p">)</span><span class="c"># / size_y</span>
+                <span class="n">pos_x</span> <span class="o">=</span> <span class="s">&quot;</span><span class="si">%8.3g</span><span class="s">&quot;</span><span class="o">%</span> <span class="n">pos_x</span>
+                <span class="n">pos_y</span> <span class="o">=</span> <span class="s">&quot;</span><span class="si">%8.3g</span><span class="s">&quot;</span><span class="o">%</span> <span class="n">pos_y</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">position</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">pos_x</span><span class="p">),</span> <span class="nb">str</span><span class="p">(</span><span class="n">pos_y</span><span class="p">)</span>
+                <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> <span class="n">StatusEvent</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">position</span><span class="p">))</span>
+            <span class="k">except</span><span class="p">:</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">position</span> <span class="o">=</span> <span class="bp">None</span>  
+        <span class="c"># unfocus all</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">set_plot_unfocus</span><span class="p">()</span>  
+        <span class="c">#post nd event to notify guiframe that this panel is on focus</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> <span class="n">PanelOnFocusEvent</span><span class="p">(</span><span class="n">panel</span><span class="o">=</span><span class="bp">self</span><span class="p">))</span>
+
+        
+    <span class="k">def</span> <span class="nf">_ontoggle_hide_error</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span></div>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Toggle error display to hide or show</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">menu</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">GetEventObject</span><span class="p">()</span>
+        <span class="nb">id</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">GetId</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">set_selected_from_menu</span><span class="p">(</span><span class="n">menu</span><span class="p">,</span> <span class="nb">id</span><span class="p">)</span>
+        <span class="c"># Check zoom</span>
+        <span class="n">xlo</span><span class="p">,</span> <span class="n">xhi</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">get_xlim</span><span class="p">()</span>
+        <span class="n">ylo</span><span class="p">,</span> <span class="n">yhi</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">get_ylim</span><span class="p">()</span>
+
+        <span class="n">selected_plot</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">selected_plottable</span><span class="p">]</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">hide_menu</span><span class="o">.</span><span class="n">GetText</span><span class="p">()</span> <span class="o">==</span> <span class="s">&quot;Hide Error Bar&quot;</span><span class="p">:</span>
+            <span class="n">selected_plot</span><span class="o">.</span><span class="n">hide_error</span> <span class="o">=</span> <span class="bp">True</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="n">selected_plot</span><span class="o">.</span><span class="n">hide_error</span> <span class="o">=</span> <span class="bp">False</span>
+        <span class="c">## increment graph color</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">render</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">figure</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">draw_idle</span><span class="p">()</span>  
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_zoomed</span><span class="p">:</span>
+            <span class="c"># Recover the x,y limits</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">set_xlim</span><span class="p">((</span><span class="n">xlo</span><span class="p">,</span> <span class="n">xhi</span><span class="p">))</span>     
+            <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">set_ylim</span><span class="p">((</span><span class="n">ylo</span><span class="p">,</span> <span class="n">yhi</span><span class="p">))</span> 
+
+          
+    <span class="k">def</span> <span class="nf">_onRemove</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Remove a plottable from the graph and render the graph </span>
+<span class="sd">        </span>
+<span class="sd">        :param event: Menu event</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">menu</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">GetEventObject</span><span class="p">()</span>
+        <span class="nb">id</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">GetId</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">set_selected_from_menu</span><span class="p">(</span><span class="n">menu</span><span class="p">,</span> <span class="nb">id</span><span class="p">)</span>
+        <span class="c">## Check if there is a selected graph to remove</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">selected_plottable</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
+            <span class="n">selected_plot</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">selected_plottable</span><span class="p">]</span>
+            <span class="nb">id</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">selected_plottable</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">remove_data_by_id</span><span class="p">(</span><span class="nb">id</span><span class="p">)</span>
+            
+    <span class="k">def</span> <span class="nf">onContextMenu</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+<div class="viewcode-block" id="ModelPanel1D.onContextMenu"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter1D.ModelPanel1D.onContextMenu">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        1D plot context menu</span>
+<span class="sd">        </span>
+<span class="sd">        :param event: wx context event</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_slicerpop</span> <span class="o">=</span> <span class="n">PanelMenu</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_slicerpop</span><span class="o">.</span><span class="n">set_plots</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_slicerpop</span><span class="o">.</span><span class="n">set_graph</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="p">)</span>   
+        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">selected_plottable</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">:</span>  
+            <span class="c"># Various plot options</span>
+            <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">_slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Save Image&#39;</span><span class="p">,</span> <span class="s">&#39;Save image as PNG&#39;</span><span class="p">)</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onSaveImage</span><span class="p">)</span>
+            <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">_slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Print Image&#39;</span><span class="p">,</span> <span class="s">&#39;Print image &#39;</span><span class="p">)</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onPrint</span><span class="p">)</span>
+            <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">_slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Print Preview&#39;</span><span class="p">,</span> <span class="s">&#39;Print preview&#39;</span><span class="p">)</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onPrinterPreview</span><span class="p">)</span>
+            
+            <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">_slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Copy to Clipboard&#39;</span><span class="p">,</span> 
+                                   <span class="s">&#39;Copy to the clipboard&#39;</span><span class="p">)</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">OnCopyFigureMenu</span><span class="p">)</span>
+                    
+            <span class="bp">self</span><span class="o">.</span><span class="n">_slicerpop</span><span class="o">.</span><span class="n">AppendSeparator</span><span class="p">()</span>
+
+        <span class="k">for</span> <span class="n">plot</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="o">.</span><span class="n">values</span><span class="p">():</span>
+            <span class="c">#title = plot.title</span>
+            <span class="n">name</span> <span class="o">=</span> <span class="n">plot</span><span class="o">.</span><span class="n">name</span>
+            <span class="n">plot_menu</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Menu</span><span class="p">()</span>
+            <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">selected_plottable</span><span class="p">:</span>
+                <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">selected_plottable</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
+                    <span class="k">continue</span>
+                <span class="k">if</span> <span class="n">plot</span> <span class="o">!=</span> <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">selected_plottable</span><span class="p">]:</span>
+                    <span class="k">continue</span>
+                
+            <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+            <span class="n">plot_menu</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&quot;&amp;DataInfo&quot;</span><span class="p">,</span> <span class="n">name</span><span class="p">)</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span> <span class="n">_onDataShow</span><span class="p">)</span>
+            <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+            <span class="n">plot_menu</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&quot;&amp;Save Points as a File&quot;</span><span class="p">,</span> <span class="n">name</span><span class="p">)</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_onSave</span><span class="p">)</span>
+            <span class="n">plot_menu</span><span class="o">.</span><span class="n">AppendSeparator</span><span class="p">()</span>
+            
+            <span class="c">#add menu of other plugins</span>
+            <span class="n">item_list</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">get_current_context_menu</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
+              
+            <span class="k">if</span> <span class="p">(</span><span class="ow">not</span> <span class="n">item_list</span> <span class="o">==</span> <span class="bp">None</span><span class="p">)</span> <span class="ow">and</span> <span class="p">(</span><span class="ow">not</span> <span class="nb">len</span><span class="p">(</span><span class="n">item_list</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">):</span>
+                <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">item_list</span><span class="p">:</span>
+
+                    <span class="k">try</span><span class="p">:</span>
+                        <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+                        <span class="n">plot_menu</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="n">item</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">name</span><span class="p">)</span>
+                        <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">item</span><span class="p">[</span><span class="mi">2</span><span class="p">])</span>
+                    <span class="k">except</span><span class="p">:</span>
+                        <span class="n">msg</span> <span class="o">=</span> <span class="s">&quot;ModelPanel1D.onContextMenu: &quot;</span>
+                        <span class="n">msg</span> <span class="o">+=</span> <span class="s">&quot;bad menu item  </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">sys</span><span class="o">.</span><span class="n">exc_value</span>
+                        <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> <span class="n">StatusEvent</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="n">msg</span><span class="p">))</span>
+                        <span class="k">pass</span>
+                <span class="n">plot_menu</span><span class="o">.</span><span class="n">AppendSeparator</span><span class="p">()</span>
+            
+            <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">ClassName</span><span class="o">.</span><span class="n">count</span><span class="p">(</span><span class="s">&#39;wxDialog&#39;</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span> 
+                <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+                <span class="n">plot_menu</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Linear Fit&#39;</span><span class="p">,</span> <span class="n">name</span><span class="p">)</span>
+                <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onFitting</span><span class="p">)</span>
+                <span class="n">plot_menu</span><span class="o">.</span><span class="n">AppendSeparator</span><span class="p">()</span>
+    
+                <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+                <span class="n">plot_menu</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&quot;Remove&quot;</span><span class="p">,</span> <span class="n">name</span><span class="p">)</span>
+                <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_onRemove</span><span class="p">)</span>
+                <span class="k">if</span> <span class="ow">not</span> <span class="n">plot</span><span class="o">.</span><span class="n">is_data</span><span class="p">:</span>
+                    <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+                    <span class="n">plot_menu</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Freeze&#39;</span><span class="p">,</span> <span class="n">name</span><span class="p">)</span>
+                    <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onFreeze</span><span class="p">)</span>
+                <span class="n">plot_menu</span><span class="o">.</span><span class="n">AppendSeparator</span><span class="p">()</span>    
+                <span class="n">symbol_menu</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Menu</span><span class="p">()</span>
+                
+                <span class="k">if</span> <span class="n">plot</span><span class="o">.</span><span class="n">is_data</span><span class="p">:</span>
+                    <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+                    <span class="bp">self</span><span class="o">.</span><span class="n">hide_menu</span> <span class="o">=</span> <span class="n">plot_menu</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> 
+                                                    <span class="s">&quot;Hide Error Bar&quot;</span><span class="p">,</span> <span class="n">name</span><span class="p">)</span>
+        
+                    <span class="k">if</span> <span class="n">plot</span><span class="o">.</span><span class="n">dy</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span> <span class="ow">and</span> <span class="n">plot</span><span class="o">.</span><span class="n">dy</span> <span class="o">!=</span> <span class="p">[]:</span>
+                        <span class="k">if</span> <span class="n">plot</span><span class="o">.</span><span class="n">hide_error</span> <span class="p">:</span>
+                            <span class="bp">self</span><span class="o">.</span><span class="n">hide_menu</span><span class="o">.</span><span class="n">SetText</span><span class="p">(</span><span class="s">&#39;Show Error Bar&#39;</span><span class="p">)</span>
+                        <span class="k">else</span><span class="p">:</span>
+                            <span class="bp">self</span><span class="o">.</span><span class="n">hide_menu</span><span class="o">.</span><span class="n">SetText</span><span class="p">(</span><span class="s">&#39;Hide Error Bar&#39;</span><span class="p">)</span>
+                    <span class="k">else</span><span class="p">:</span>
+                        <span class="bp">self</span><span class="o">.</span><span class="n">hide_menu</span><span class="o">.</span><span class="n">Enable</span><span class="p">(</span><span class="bp">False</span><span class="p">)</span>
+                    <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_ontoggle_hide_error</span><span class="p">)</span>
+                
+                    <span class="n">plot_menu</span><span class="o">.</span><span class="n">AppendSeparator</span><span class="p">()</span>
+
+                <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+                <span class="n">plot_menu</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Modify Plot Property&#39;</span><span class="p">,</span> <span class="n">name</span><span class="p">)</span>
+                <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">createAppDialog</span><span class="p">)</span>
+
+
+
+            <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+            <span class="c">#plot_menu.SetTitle(name)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">_slicerpop</span><span class="o">.</span><span class="n">AppendMenu</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;</span><span class="si">%s</span><span class="s">&#39;</span><span class="o">%</span> <span class="n">name</span><span class="p">,</span> <span class="n">plot_menu</span><span class="p">)</span>
+            <span class="c"># Option to hide</span>
+            <span class="c">#TODO: implement functionality to hide a plottable (legend click)</span>
+        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">selected_plottable</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">:</span>  
+            <span class="bp">self</span><span class="o">.</span><span class="n">_slicerpop</span><span class="o">.</span><span class="n">AppendSeparator</span><span class="p">()</span>
+            <span class="n">loc_menu</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Menu</span><span class="p">()</span>
+            <span class="k">for</span> <span class="n">label</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_loc_labels</span><span class="p">:</span>
+                <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+                <span class="n">loc_menu</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="nb">str</span><span class="p">(</span><span class="n">label</span><span class="p">),</span> <span class="nb">str</span><span class="p">(</span><span class="n">label</span><span class="p">))</span>
+                <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onChangeLegendLoc</span><span class="p">)</span>
+            
+            <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">_slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Modify Graph Appearance&#39;</span><span class="p">,</span>
+                                   <span class="s">&#39;Modify graph appearance&#39;</span><span class="p">)</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">modifyGraphAppearance</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">_slicerpop</span><span class="o">.</span><span class="n">AppendSeparator</span><span class="p">()</span>
+
+            
+            <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">position</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+                <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">_slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Add Text&#39;</span><span class="p">)</span>
+                <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_on_addtext</span><span class="p">)</span>
+                <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">_slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Remove Text&#39;</span><span class="p">)</span>
+                <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_on_removetext</span><span class="p">)</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">_slicerpop</span><span class="o">.</span><span class="n">AppendSeparator</span><span class="p">()</span>
+            <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">_slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Change Scale&#39;</span><span class="p">)</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_onProperties</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">_slicerpop</span><span class="o">.</span><span class="n">AppendSeparator</span><span class="p">()</span>
+            <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">_slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Reset Graph Range&#39;</span><span class="p">)</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onResetGraph</span><span class="p">)</span>  
+            
+            <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">ClassName</span><span class="o">.</span><span class="n">count</span><span class="p">(</span><span class="s">&#39;wxDialog&#39;</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>    
+                <span class="bp">self</span><span class="o">.</span><span class="n">_slicerpop</span><span class="o">.</span><span class="n">AppendSeparator</span><span class="p">()</span>
+                <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">_slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Window Title&#39;</span><span class="p">)</span>
+                <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onChangeCaption</span><span class="p">)</span>
+        <span class="k">try</span><span class="p">:</span>
+            <span class="n">pos_evt</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">GetPosition</span><span class="p">()</span>
+            <span class="n">pos</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">ScreenToClient</span><span class="p">(</span><span class="n">pos_evt</span><span class="p">)</span>
+        <span class="k">except</span><span class="p">:</span>
+            <span class="n">pos_x</span><span class="p">,</span> <span class="n">pos_y</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">toolbar</span><span class="o">.</span><span class="n">GetPositionTuple</span><span class="p">()</span>
+            <span class="n">pos</span> <span class="o">=</span> <span class="p">(</span><span class="n">pos_x</span><span class="p">,</span> <span class="n">pos_y</span> <span class="o">+</span> <span class="mi">5</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">PopupMenu</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_slicerpop</span><span class="p">,</span> <span class="n">pos</span><span class="p">)</span>
+            
+    <span class="k">def</span> <span class="nf">onFreeze</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span></div>
+<div class="viewcode-block" id="ModelPanel1D.onFreeze"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter1D.ModelPanel1D.onFreeze">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        on Freeze data</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">menu</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">GetEventObject</span><span class="p">()</span>
+        <span class="nb">id</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">GetId</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">set_selected_from_menu</span><span class="p">(</span><span class="n">menu</span><span class="p">,</span> <span class="nb">id</span><span class="p">)</span>
+        <span class="n">plot</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">selected_plottable</span><span class="p">]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">onfreeze</span><span class="p">([</span><span class="n">plot</span><span class="o">.</span><span class="n">id</span><span class="p">])</span>
+        
+                       
+    <span class="k">def</span> <span class="nf">_onSave</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">evt</span><span class="p">):</span></div>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Save a data set to a text file</span>
+<span class="sd">        </span>
+<span class="sd">        :param evt: Menu event</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">menu</span> <span class="o">=</span> <span class="n">evt</span><span class="o">.</span><span class="n">GetEventObject</span><span class="p">()</span>
+        <span class="nb">id</span> <span class="o">=</span> <span class="n">evt</span><span class="o">.</span><span class="n">GetId</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">set_selected_from_menu</span><span class="p">(</span><span class="n">menu</span><span class="p">,</span> <span class="nb">id</span><span class="p">)</span>
+        <span class="n">data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">selected_plottable</span><span class="p">]</span>
+        <span class="n">default_name</span> <span class="o">=</span> <span class="n">data</span><span class="o">.</span><span class="n">label</span>
+        <span class="k">if</span> <span class="n">default_name</span><span class="o">.</span><span class="n">count</span><span class="p">(</span><span class="s">&#39;.&#39;</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
+            <span class="n">default_name</span> <span class="o">=</span> <span class="n">default_name</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">&#39;.&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+        <span class="n">default_name</span> <span class="o">+=</span> <span class="s">&quot;_out&quot;</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">save_data1d</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">default_name</span><span class="p">)</span>
+
+                       
+    <span class="k">def</span> <span class="nf">_onDataShow</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">evt</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Show the data set in text</span>
+<span class="sd">        </span>
+<span class="sd">        :param evt: Menu event</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">menu</span> <span class="o">=</span> <span class="n">evt</span><span class="o">.</span><span class="n">GetEventObject</span><span class="p">()</span>
+        <span class="nb">id</span> <span class="o">=</span> <span class="n">evt</span><span class="o">.</span><span class="n">GetId</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">set_selected_from_menu</span><span class="p">(</span><span class="n">menu</span><span class="p">,</span> <span class="nb">id</span><span class="p">)</span>
+        <span class="n">data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">selected_plottable</span><span class="p">]</span>
+        <span class="n">default_name</span> <span class="o">=</span> <span class="n">data</span><span class="o">.</span><span class="n">label</span>
+        <span class="k">if</span> <span class="n">default_name</span><span class="o">.</span><span class="n">count</span><span class="p">(</span><span class="s">&#39;.&#39;</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
+            <span class="n">default_name</span> <span class="o">=</span> <span class="n">default_name</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">&#39;.&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+        <span class="c">#default_name += &quot;_out&quot;</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">show_data1d</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">default_name</span><span class="p">)</span>
+            
+    <span class="k">def</span> <span class="nf">_add_more_tool</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Add refresh, add/hide button in the tool bar</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">return</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">__class__</span><span class="o">.</span><span class="n">__name__</span> <span class="o">!=</span> <span class="s">&#39;ViewerFrame&#39;</span><span class="p">:</span>
+            <span class="k">return</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">toolbar</span><span class="o">.</span><span class="n">AddSeparator</span><span class="p">()</span>
+        <span class="n">id_hide</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+        <span class="n">hide</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Bitmap</span><span class="p">(</span><span class="n">GUIFRAME_ICON</span><span class="o">.</span><span class="n">HIDE_ID_PATH</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">BITMAP_TYPE_PNG</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">toolbar</span><span class="o">.</span><span class="n">AddSimpleTool</span><span class="p">(</span><span class="n">id_hide</span><span class="p">,</span> <span class="n">hide</span><span class="p">,</span> <span class="s">&#39;Hide&#39;</span><span class="p">,</span> <span class="s">&#39;Hide&#39;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">toolbar</span><span class="o">.</span><span class="n">Realize</span><span class="p">()</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">EVT_TOOL</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">id_hide</span><span class="p">,</span>  <span class="bp">self</span><span class="o">.</span><span class="n">_on_hide</span><span class="p">)</span>
+        
+    <span class="k">def</span> <span class="nf">_on_hide</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Hides the plot when button is pressed</span>
+<span class="sd">        &quot;&quot;&quot;</span>     
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">hide_panel</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">uid</span><span class="p">)</span>
+
+    <span class="k">def</span> <span class="nf">on_close</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+<div class="viewcode-block" id="ModelPanel1D.on_close"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter1D.ModelPanel1D.on_close">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        On Close Event</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">ID</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">uid</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">delete_panel</span><span class="p">(</span><span class="n">ID</span><span class="p">)</span>
+    
+    <span class="k">def</span> <span class="nf">createAppDialog</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span></div>
+<div class="viewcode-block" id="ModelPanel1D.createAppDialog"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter1D.ModelPanel1D.createAppDialog">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Create the custom dialog for fit appearance modification</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">menu</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">GetEventObject</span><span class="p">()</span>
+        <span class="nb">id</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">GetId</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">set_selected_from_menu</span><span class="p">(</span><span class="n">menu</span><span class="p">,</span> <span class="nb">id</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">appearance_selected_plot</span> <span class="o">=</span> \
+                        <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">selected_plottable</span><span class="p">]</span>
+        <span class="c"># find current properties</span>
+        <span class="n">curr_color</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">appearance_selected_plot</span><span class="o">.</span><span class="n">custom_color</span>
+        <span class="n">curr_symbol</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">appearance_selected_plot</span><span class="o">.</span><span class="n">symbol</span>
+        <span class="n">curr_size</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">appearance_selected_plot</span><span class="o">.</span><span class="n">markersize</span>
+        <span class="n">curr_label</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">appearance_selected_plot</span><span class="o">.</span><span class="n">label</span>
+
+        <span class="k">if</span> <span class="n">curr_color</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="n">curr_color</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_color_labels</span><span class="p">[</span><span class="s">&#39;Blue&#39;</span><span class="p">]</span>
+            <span class="n">curr_symbol</span> <span class="o">=</span> <span class="mi">13</span>
+
+        <span class="bp">self</span><span class="o">.</span><span class="n">appD</span> <span class="o">=</span> <span class="n">appearanceDialog</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s">&#39;Modify Plot Property&#39;</span><span class="p">)</span>
+        <span class="n">icon</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">GetIcon</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">appD</span><span class="o">.</span><span class="n">SetIcon</span><span class="p">(</span><span class="n">icon</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">appD</span><span class="o">.</span><span class="n">set_defaults</span><span class="p">(</span><span class="nb">float</span><span class="p">(</span><span class="n">curr_size</span><span class="p">),</span> <span class="nb">int</span><span class="p">(</span><span class="n">curr_color</span><span class="p">),</span> 
+                    <span class="nb">str</span><span class="p">(</span><span class="n">appearanceDialog</span><span class="o">.</span><span class="n">find_key</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">get_symbol_label</span><span class="p">(),</span> 
+                    <span class="nb">int</span><span class="p">(</span><span class="n">curr_symbol</span><span class="p">))),</span> <span class="n">curr_label</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">appD</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_CLOSE</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">on_AppDialog_close</span><span class="p">)</span>    
+
+    <span class="k">def</span> <span class="nf">on_AppDialog_close</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span></div>
+<div class="viewcode-block" id="ModelPanel1D.on_AppDialog_close"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter1D.ModelPanel1D.on_AppDialog_close">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        on_Modify Plot Property_close</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">if</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">appD</span><span class="o">.</span><span class="n">okay_clicked</span> <span class="o">==</span> <span class="bp">True</span><span class="p">):</span>
+            <span class="c"># returns (size,color,symbol,datalabel)</span>
+            <span class="n">info</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">appD</span><span class="o">.</span><span class="n">get_current_values</span><span class="p">()</span> 
+            <span class="bp">self</span><span class="o">.</span><span class="n">appearance_selected_plot</span><span class="o">.</span><span class="n">custom_color</span> <span class="o">=</span> \
+                        <span class="bp">self</span><span class="o">.</span><span class="n">_color_labels</span><span class="p">[</span><span class="n">info</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="s">&#39;ascii&#39;</span><span class="p">,</span> <span class="s">&#39;ignore&#39;</span><span class="p">)]</span>
+
+            <span class="bp">self</span><span class="o">.</span><span class="n">appearance_selected_plot</span><span class="o">.</span><span class="n">markersize</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">info</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">appearance_selected_plot</span><span class="o">.</span><span class="n">symbol</span> <span class="o">=</span> \
+                        <span class="bp">self</span><span class="o">.</span><span class="n">get_symbol_label</span><span class="p">()[</span><span class="n">info</span><span class="p">[</span><span class="mi">2</span><span class="p">]]</span> 
+            <span class="bp">self</span><span class="o">.</span><span class="n">appearance_selected_plot</span><span class="o">.</span><span class="n">label</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">info</span><span class="p">[</span><span class="mi">3</span><span class="p">])</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">appD</span><span class="o">.</span><span class="n">Destroy</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_check_zoom_plot</span><span class="p">()</span>
+
+    <span class="k">def</span> <span class="nf">modifyGraphAppearance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span></div>
+<div class="viewcode-block" id="ModelPanel1D.modifyGraphAppearance"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter1D.ModelPanel1D.modifyGraphAppearance">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        On Modify Graph Appearance </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">graphApp</span> <span class="o">=</span> <span class="n">graphAppearance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s">&#39;Modify Graph Appearance&#39;</span><span class="p">)</span>
+        <span class="n">icon</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">GetIcon</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">graphApp</span><span class="o">.</span><span class="n">SetIcon</span><span class="p">(</span><span class="n">icon</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">graphApp</span><span class="o">.</span><span class="n">setDefaults</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_on</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">legend_on</span><span class="p">,</span> 
+                                  <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_label</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_label</span><span class="p">,</span> 
+                                  <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_unit</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_unit</span><span class="p">,</span> 
+                                  <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_font</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_font</span><span class="p">,</span> 
+                                  <span class="n">find_key</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">get_loc_label</span><span class="p">(),</span> 
+                                  <span class="bp">self</span><span class="o">.</span><span class="n">legendLoc</span><span class="p">),</span> 
+                                  <span class="bp">self</span><span class="o">.</span><span class="n">xcolor</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">ycolor</span><span class="p">,</span> 
+                                  <span class="bp">self</span><span class="o">.</span><span class="n">is_xtick</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_ytick</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">graphApp</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_CLOSE</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">on_graphApp_close</span><span class="p">)</span>
+
+    <span class="k">def</span> <span class="nf">on_graphApp_close</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span></div>
+<div class="viewcode-block" id="ModelPanel1D.on_graphApp_close"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter1D.ModelPanel1D.on_graphApp_close">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Gets values from graph appearance dialog and sends them off</span>
+<span class="sd">        to modify the plot</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">graph_app</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">graphApp</span>
+        <span class="n">toggle_grid</span> <span class="o">=</span> <span class="n">graph_app</span><span class="o">.</span><span class="n">get_togglegrid</span><span class="p">()</span>
+        <span class="n">legend_loc</span> <span class="o">=</span> <span class="n">graph_app</span><span class="o">.</span><span class="n">get_legend_loc</span><span class="p">()</span>
+        <span class="n">toggle_legend</span> <span class="o">=</span> <span class="n">graph_app</span><span class="o">.</span><span class="n">get_togglelegend</span><span class="p">()</span>
+        
+        <span class="bp">self</span><span class="o">.</span><span class="n">onGridOnOff</span><span class="p">(</span><span class="n">toggle_grid</span> <span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">ChangeLegendLoc</span><span class="p">(</span><span class="n">legend_loc</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">onLegend</span><span class="p">(</span><span class="n">toggle_legend</span><span class="p">)</span>
+
+        <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_label</span> <span class="o">=</span> <span class="n">graph_app</span><span class="o">.</span><span class="n">get_xlab</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_label</span> <span class="o">=</span> <span class="n">graph_app</span><span class="o">.</span><span class="n">get_ylab</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_unit</span> <span class="o">=</span> <span class="n">graph_app</span><span class="o">.</span><span class="n">get_xunit</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_unit</span> <span class="o">=</span> <span class="n">graph_app</span><span class="o">.</span><span class="n">get_yunit</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_font</span> <span class="o">=</span> <span class="n">graph_app</span><span class="o">.</span><span class="n">get_xfont</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_font</span> <span class="o">=</span> <span class="n">graph_app</span><span class="o">.</span><span class="n">get_yfont</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">is_xtick</span> <span class="o">=</span>  <span class="n">graph_app</span><span class="o">.</span><span class="n">get_xtick_check</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">is_ytick</span> <span class="o">=</span>  <span class="n">graph_app</span><span class="o">.</span><span class="n">get_ytick_check</span><span class="p">()</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_xtick</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_tick</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_font</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_ytick</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_tick</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_font</span>
+
+        <span class="bp">self</span><span class="o">.</span><span class="n">xaxis</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">xaxis_label</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_unit</span><span class="p">,</span> 
+                   <span class="n">graph_app</span><span class="o">.</span><span class="n">get_xfont</span><span class="p">(),</span> <span class="n">graph_app</span><span class="o">.</span><span class="n">get_xcolor</span><span class="p">(),</span> 
+                   <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_tick</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">yaxis</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">yaxis_label</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_unit</span><span class="p">,</span> 
+                   <span class="n">graph_app</span><span class="o">.</span><span class="n">get_yfont</span><span class="p">(),</span> <span class="n">graph_app</span><span class="o">.</span><span class="n">get_ycolor</span><span class="p">(),</span>
+                   <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_tick</span><span class="p">)</span>
+
+        <span class="n">graph_app</span><span class="o">.</span><span class="n">Destroy</span><span class="p">()</span>
+</pre></div></div></div>
+
+          </div>
+        </div>
+      </div>
+      <div class="sphinxsidebar">
+        <div class="sphinxsidebarwrapper">
+<div id="searchbox" style="display: none">
+  <h3>Quick search</h3>
+    <form class="search" action="../../../../../search.html" method="get">
+      <input type="text" name="q" />
+      <input type="submit" value="Go" />
+      <input type="hidden" name="check_keywords" value="yes" />
+      <input type="hidden" name="area" value="default" />
+    </form>
+    <p class="searchtip" style="font-size: 90%">
+    Enter search terms or a module, class or function name.
+    </p>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+        </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" >sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>
+    <div class="footer">
+        &copy; Copyright 2013, The SasView Project.
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
+    </div>
+  </body>
+</html>
Index: _modules/sas/guiframe/local_perspectives/plotting/Plotter2D.html
===================================================================
--- _modules/sas/guiframe/local_perspectives/plotting/Plotter2D.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
+++ _modules/sas/guiframe/local_perspectives/plotting/Plotter2D.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
@@ -0,0 +1,919 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>sas.guiframe.local_perspectives.plotting.Plotter2D &mdash; SasView 3.0.0 documentation</title>
+    
+    <link rel="stylesheet" href="../../../../../_static/default.css" type="text/css" />
+    <link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '../../../../../',
+        VERSION:     '3.0.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="../../../../../_static/jquery.js"></script>
+    <script type="text/javascript" src="../../../../../_static/underscore.js"></script>
+    <script type="text/javascript" src="../../../../../_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <link rel="top" title="SasView 3.0.0 documentation" href="../../../../../index.html" />
+    <link rel="up" title="sas.guiframe" href="../../../guiframe.html" /> 
+  </head>
+  <body>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" accesskey="U">sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>  
+
+    <div class="document">
+      <div class="documentwrapper">
+        <div class="bodywrapper">
+          <div class="body">
+            
+  <h1>Source code for sas.guiframe.local_perspectives.plotting.Plotter2D</h1><div class="highlight"><pre>
+<span class="c">################################################################################</span>
+<span class="c">#This software was developed by the University of Tennessee as part of the</span>
+<span class="c">#Distributed Data Analysis of Neutron Scattering Experiments (DANSE)</span>
+<span class="c">#project funded by the US National Science Foundation. </span>
+<span class="c">#</span>
+<span class="c">#See the license text in license.txt</span>
+<span class="c">#</span>
+<span class="c">#copyright 2008, University of Tennessee</span>
+<span class="c">################################################################################</span>
+
+
+<span class="kn">import</span> <span class="nn">wx</span>
+<span class="kn">import</span> <span class="nn">sys</span>
+<span class="kn">import</span> <span class="nn">math</span>
+<span class="kn">import</span> <span class="nn">numpy</span>
+<span class="kn">from</span> <span class="nn">sas.plottools.PlotPanel</span> <span class="kn">import</span> <span class="n">PlotPanel</span>
+<span class="kn">from</span> <span class="nn">sas.plottools.plottables</span> <span class="kn">import</span> <span class="n">Graph</span>
+<span class="kn">from</span> <span class="nn">sas.plottools.TextDialog</span> <span class="kn">import</span> <span class="n">TextDialog</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">StatusEvent</span> 
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">NewPlotEvent</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">PanelOnFocusEvent</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">SlicerEvent</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.utils</span> <span class="kn">import</span> <span class="n">PanelMenu</span>
+<span class="kn">from</span>  <span class="nn">sas.guiframe.local_perspectives.plotting.binder</span> <span class="kn">import</span> <span class="n">BindArtist</span>
+<span class="kn">from</span> <span class="nn">Plotter1D</span> <span class="kn">import</span> <span class="n">ModelPanel1D</span>
+<span class="kn">from</span> <span class="nn">sas.plottools.toolbar</span> <span class="kn">import</span> <span class="n">NavigationToolBar</span> 
+<span class="kn">from</span> <span class="nn">matplotlib.font_manager</span> <span class="kn">import</span> <span class="n">FontProperties</span>
+<span class="kn">from</span> <span class="nn">graphAppearance</span> <span class="kn">import</span> <span class="n">graphAppearance</span>
+<span class="p">(</span><span class="n">InternalEvent</span><span class="p">,</span> <span class="n">EVT_INTERNAL</span><span class="p">)</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">lib</span><span class="o">.</span><span class="n">newevent</span><span class="o">.</span><span class="n">NewEvent</span><span class="p">()</span>
+
+<span class="n">DEFAULT_QMAX</span> <span class="o">=</span> <span class="mf">0.05</span>
+<span class="n">DEFAULT_QSTEP</span> <span class="o">=</span> <span class="mf">0.001</span>
+<span class="n">DEFAULT_BEAM</span> <span class="o">=</span> <span class="mf">0.005</span>
+<span class="n">BIN_WIDTH</span> <span class="o">=</span> <span class="mf">1.0</span>
+
+
+<span class="k">def</span> <span class="nf">find_key</span><span class="p">(</span><span class="n">dic</span><span class="p">,</span> <span class="n">val</span><span class="p">):</span>
+<div class="viewcode-block" id="find_key"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter2D.find_key">[docs]</a>    <span class="sd">&quot;&quot;&quot;return the key of dictionary dic given the value&quot;&quot;&quot;</span>
+    <span class="k">return</span> <span class="p">[</span><span class="n">k</span> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">dic</span><span class="o">.</span><span class="n">iteritems</span><span class="p">()</span> <span class="k">if</span> <span class="n">v</span> <span class="o">==</span> <span class="n">val</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span>
+
+
+<span class="k">class</span> <span class="nc">NavigationToolBar2D</span><span class="p">(</span><span class="n">NavigationToolBar</span><span class="p">):</span></div>
+<div class="viewcode-block" id="NavigationToolBar2D"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter2D.NavigationToolBar2D">[docs]</a>    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">canvas</span><span class="p">,</span> <span class="n">parent</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+        <span class="n">NavigationToolBar</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">canvas</span><span class="o">=</span><span class="n">canvas</span><span class="p">,</span> <span class="n">parent</span><span class="o">=</span><span class="n">parent</span><span class="p">)</span>
+        
+    <span class="k">def</span> <span class="nf">delete_option</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+<div class="viewcode-block" id="NavigationToolBar2D.delete_option"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter2D.NavigationToolBar2D.delete_option">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        remove default toolbar item</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c">#delete reset button</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">DeleteToolByPos</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> 
+        <span class="c">#delete dragging</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">DeleteToolByPos</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> 
+        <span class="c">#delete unwanted button that configures subplot parameters</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">DeleteToolByPos</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span>
+        
+    <span class="k">def</span> <span class="nf">add_option</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></div>
+<div class="viewcode-block" id="NavigationToolBar2D.add_option"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter2D.NavigationToolBar2D.add_option">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        add item to the toolbar</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c">#add button</span>
+        <span class="n">id_context</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+        <span class="n">context_tip</span> <span class="o">=</span> <span class="s">&#39;Graph Menu&#39;</span>
+        <span class="n">context</span> <span class="o">=</span>  <span class="n">wx</span><span class="o">.</span><span class="n">ArtProvider</span><span class="o">.</span><span class="n">GetBitmap</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">ART_LIST_VIEW</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">ART_TOOLBAR</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">InsertSimpleTool</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">id_context</span><span class="p">,</span> <span class="n">context</span><span class="p">,</span> 
+                                   <span class="n">context_tip</span><span class="p">,</span> <span class="n">context_tip</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">EVT_TOOL</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">id_context</span><span class="p">,</span>  <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">onToolContextMenu</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">InsertSeparator</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
+        <span class="c">#add print button</span>
+        <span class="n">id_print</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+        <span class="n">print_bmp</span> <span class="o">=</span>  <span class="n">wx</span><span class="o">.</span><span class="n">ArtProvider</span><span class="o">.</span><span class="n">GetBitmap</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">ART_PRINT</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">ART_TOOLBAR</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">AddSimpleTool</span><span class="p">(</span><span class="n">id_print</span><span class="p">,</span> <span class="n">print_bmp</span><span class="p">,</span>
+                           <span class="s">&#39;Print&#39;</span><span class="p">,</span> <span class="s">&#39;Activate printing&#39;</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">EVT_TOOL</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">id_print</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">on_print</span><span class="p">)</span>
+        
+        
+<span class="k">class</span> <span class="nc">ModelPanel2D</span><span class="p">(</span><span class="n">ModelPanel1D</span><span class="p">):</span></div></div>
+<div class="viewcode-block" id="ModelPanel2D"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter2D.ModelPanel2D">[docs]</a>    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Plot panel for use with the GUI manager</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    
+    <span class="c">## Internal name for the AUI manager</span>
+    <span class="n">window_name</span> <span class="o">=</span> <span class="s">&quot;plotpanel&quot;</span>
+    <span class="c">## Title to appear on top of the window</span>
+    <span class="n">window_caption</span> <span class="o">=</span> <span class="s">&quot;Plot Panel&quot;</span>
+    <span class="c">## Flag to tell the GUI manager that this panel is not</span>
+    <span class="c">#  tied to any perspective</span>
+    <span class="n">ALWAYS_ON</span> <span class="o">=</span> <span class="bp">True</span>
+    <span class="c">## Group ID</span>
+    <span class="n">group_id</span> <span class="o">=</span> <span class="bp">None</span>
+    
+    
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="nb">id</span><span class="o">=-</span><span class="mi">1</span><span class="p">,</span> <span class="n">data2d</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">color</span> <span class="o">=</span> <span class="bp">None</span><span class="p">,</span>
+                 <span class="n">dpi</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">NO_FULL_REPAINT_ON_RESIZE</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Initialize the panel</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">ModelPanel1D</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="nb">id</span><span class="o">=</span><span class="nb">id</span><span class="p">,</span> <span class="n">style</span><span class="o">=</span><span class="n">style</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="n">parent</span>
+        <span class="c">## Reference to the parent window</span>
+        <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">parent</span><span class="p">,</span> <span class="s">&quot;parent&quot;</span><span class="p">):</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">parent</span>
+        <span class="c">## Dictionary containing Plottables</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plots</span> <span class="o">=</span> <span class="p">{}</span>
+        <span class="c">## Save reference of the current plotted </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">data2D</span> <span class="o">=</span> <span class="n">data2d</span>
+        <span class="c">## Unique ID (from gui_manager)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">uid</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="c">## Action IDs for internal call-backs</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">action_ids</span> <span class="o">=</span> <span class="p">{}</span>
+        <span class="c">## Create Artist and bind it</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">connect</span> <span class="o">=</span> <span class="n">BindArtist</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">figure</span><span class="p">)</span>
+        <span class="c">## Beam stop</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">beamstop_radius</span> <span class="o">=</span> <span class="n">DEFAULT_BEAM</span>
+        <span class="c">## to set the order of lines drawn first.</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">slicer_z</span> <span class="o">=</span> <span class="mi">5</span>
+        <span class="c">## Reference to the current slicer</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="c">## event to send slicer info </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">EVT_INTERNAL</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_onEVT_INTERNAL</span><span class="p">)</span>
+        
+        <span class="bp">self</span><span class="o">.</span><span class="n">axes_frozen</span> <span class="o">=</span> <span class="bp">False</span>
+        <span class="c">## panel that contains result from slicer motion (ex: Boxsum info)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">panel_slicer</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">title_label</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">title_font</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">title_color</span> <span class="o">=</span> <span class="s">&#39;black&#39;</span>
+        <span class="c">## Graph        </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">graph</span> <span class="o">=</span> <span class="n">Graph</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">xaxis</span><span class="p">(</span><span class="s">&quot;</span><span class="se">\\</span><span class="s">rm{Q}&quot;</span><span class="p">,</span> <span class="s">&#39;A^{-1}&#39;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">yaxis</span><span class="p">(</span><span class="s">&quot;</span><span class="se">\\</span><span class="s">rm{Intensity} &quot;</span><span class="p">,</span> <span class="s">&quot;cm^{-1}&quot;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">render</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
+        <span class="c">## store default value of zmin and zmax </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">default_zmin_ctl</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">zmin_2D</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">default_zmax_ctl</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">zmax_2D</span>
+
+    <span class="k">def</span> <span class="nf">on_plot_qrange</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+<div class="viewcode-block" id="ModelPanel2D.on_plot_qrange"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter2D.ModelPanel2D.on_plot_qrange">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        On Qmin Qmax vertical line event</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># Not implemented</span>
+        <span class="k">if</span> <span class="n">event</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="k">return</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">Skip</span><span class="p">()</span> 
+                       
+    <span class="k">def</span> <span class="nf">onLeftDown</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span> </div>
+<div class="viewcode-block" id="ModelPanel2D.onLeftDown"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter2D.ModelPanel2D.onLeftDown">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        left button down and ready to drag</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># Check that the LEFT button was pressed</span>
+        <span class="n">PlotPanel</span><span class="o">.</span><span class="n">onLeftDown</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">)</span>    
+        <span class="n">ax</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">inaxes</span>
+        <span class="k">if</span> <span class="n">ax</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="c"># data coordinate position</span>
+            <span class="n">pos_x</span> <span class="o">=</span> <span class="s">&quot;</span><span class="si">%8.3g</span><span class="s">&quot;</span><span class="o">%</span> <span class="n">event</span><span class="o">.</span><span class="n">xdata</span>
+            <span class="n">pos_y</span> <span class="o">=</span> <span class="s">&quot;</span><span class="si">%8.3g</span><span class="s">&quot;</span><span class="o">%</span> <span class="n">event</span><span class="o">.</span><span class="n">ydata</span>
+            <span class="n">position</span> <span class="o">=</span> <span class="s">&quot;x: </span><span class="si">%s</span><span class="s">    y: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">pos_x</span><span class="p">,</span> <span class="n">pos_y</span><span class="p">)</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> <span class="n">StatusEvent</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="n">position</span><span class="p">))</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plottable_selected</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">id</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_manager</span><span class="o">.</span><span class="n">set_panel_on_focus</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> <span class="n">PanelOnFocusEvent</span><span class="p">(</span><span class="n">panel</span><span class="o">=</span><span class="bp">self</span><span class="p">))</span>
+        
+    <span class="k">def</span> <span class="nf">add_toolbar</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></div>
+<div class="viewcode-block" id="ModelPanel2D.add_toolbar"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter2D.ModelPanel2D.add_toolbar">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        add toolbar</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">enable_toolbar</span> <span class="o">=</span> <span class="bp">True</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">toolbar</span> <span class="o">=</span> <span class="n">NavigationToolBar2D</span><span class="p">(</span><span class="n">parent</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> <span class="n">canvas</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">canvas</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">toolbar</span><span class="o">.</span><span class="n">Realize</span><span class="p">()</span>
+        <span class="c"># On Windows platform, default window size is incorrect, so set</span>
+        <span class="c"># toolbar width to figure width.</span>
+        <span class="n">tw</span><span class="p">,</span> <span class="n">th</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">toolbar</span><span class="o">.</span><span class="n">GetSizeTuple</span><span class="p">()</span>
+        <span class="n">fw</span><span class="p">,</span> <span class="n">fh</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">GetSizeTuple</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">toolbar</span><span class="o">.</span><span class="n">SetSize</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">Size</span><span class="p">(</span><span class="n">fw</span><span class="p">,</span> <span class="n">th</span><span class="p">))</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">sizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">toolbar</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">LEFT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="p">)</span>
+        <span class="c"># update the axes menu on the toolbar</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">toolbar</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+         
+    <span class="k">def</span> <span class="nf">plot_data</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">):</span></div>
+<div class="viewcode-block" id="ModelPanel2D.plot_data"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter2D.ModelPanel2D.plot_data">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Data is ready to be displayed</span>
+<span class="sd">        </span>
+<span class="sd">        :TODO: this name should be changed to something more appropriate</span>
+<span class="sd">             Don&#39;t forget that changing this name will mean changing code</span>
+<span class="sd">             in plotting.py</span>
+<span class="sd">         </span>
+<span class="sd">        :param event: data event</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">xlo</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="n">xhi</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="n">ylo</span> <span class="o">=</span> <span class="bp">None</span> 
+        <span class="n">yhi</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="k">if</span> <span class="n">data</span><span class="o">.</span><span class="n">__class__</span><span class="o">.</span><span class="n">__name__</span> <span class="o">==</span> <span class="s">&#39;Data1D&#39;</span><span class="p">:</span>
+            <span class="k">return</span>
+        <span class="c">## Update self.data2d with the current plot</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">data2D</span> <span class="o">=</span> <span class="n">data</span>
+        <span class="k">if</span> <span class="n">data</span><span class="o">.</span><span class="n">id</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
+            <span class="c">#replace</span>
+            <span class="n">xlo</span><span class="p">,</span> <span class="n">xhi</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">get_xlim</span><span class="p">()</span>
+            <span class="n">ylo</span><span class="p">,</span> <span class="n">yhi</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">get_ylim</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">[</span><span class="n">data</span><span class="o">.</span><span class="n">id</span><span class="p">]</span> <span class="o">=</span> <span class="n">data</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">[</span><span class="n">data</span><span class="o">.</span><span class="n">id</span><span class="p">]</span> <span class="o">=</span> <span class="n">data</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">[</span><span class="n">data</span><span class="o">.</span><span class="n">id</span><span class="p">])</span> 
+            <span class="c"># update qmax with the new xmax of data plotted</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">qmax</span> <span class="o">=</span> <span class="n">data</span><span class="o">.</span><span class="n">xmax</span>  
+        <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="c"># Check axis labels</span>
+        <span class="c">#TODO: Should re-factor this</span>
+        <span class="c">## render the graph with its new content   </span>
+        <span class="c">#data2D: put &#39;Pixel (Number)&#39; for axis title and unit in case of having no detector info and none in _units</span>
+        <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">detector</span><span class="p">)</span> <span class="o">&lt;</span> <span class="mi">1</span><span class="p">:</span> 
+            <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">_xunit</span><span class="p">)</span> <span class="o">&lt;</span> <span class="mi">1</span> <span class="ow">and</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">_yunit</span><span class="p">)</span> <span class="o">&lt;</span> <span class="mi">1</span><span class="p">:</span>
+                <span class="n">data</span><span class="o">.</span><span class="n">_xaxis</span> <span class="o">=</span> <span class="s">&#39;</span><span class="se">\\</span><span class="s">rm{x}&#39;</span>
+                <span class="n">data</span><span class="o">.</span><span class="n">_yaxis</span> <span class="o">=</span> <span class="s">&#39;</span><span class="se">\\</span><span class="s">rm{y}&#39;</span>
+                <span class="n">data</span><span class="o">.</span><span class="n">_xunit</span> <span class="o">=</span> <span class="s">&#39;pixel&#39;</span>
+                <span class="n">data</span><span class="o">.</span><span class="n">_yunit</span> <span class="o">=</span> <span class="s">&#39;pixel&#39;</span>
+        <span class="c"># graph properties</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">xaxis</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">_xaxis</span><span class="p">,</span> <span class="n">data</span><span class="o">.</span><span class="n">_xunit</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">yaxis</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">_yaxis</span><span class="p">,</span> <span class="n">data</span><span class="o">.</span><span class="n">_yunit</span><span class="p">)</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_is_changed_legend_label</span><span class="p">:</span>   
+                <span class="n">data</span><span class="o">.</span><span class="n">label</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">title_label</span>
+        <span class="k">if</span> <span class="n">data</span><span class="o">.</span><span class="n">label</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="n">data</span><span class="o">.</span><span class="n">label</span> <span class="o">=</span> <span class="n">data</span><span class="o">.</span><span class="n">name</span>   
+        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">title_font</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">title</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">label</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">render</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
+            <span class="c"># Set the axis labels on subplot</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">_set_axis_labels</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">draw_plot</span><span class="p">()</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">render</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">draw_plot</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">set_title</span><span class="p">(</span><span class="n">label</span><span class="o">=</span><span class="n">data</span><span class="o">.</span><span class="n">label</span><span class="p">,</span>
+                                   <span class="n">fontproperties</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">title_font</span><span class="p">,</span>
+                                   <span class="n">color</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">title_color</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">figure</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">draw_idle</span><span class="p">()</span>    
+        <span class="c">## store default value of zmin and zmax </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">default_zmin_ctl</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">zmin_2D</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">default_zmax_ctl</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">zmax_2D</span>
+        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_zoomed</span><span class="p">:</span>
+            <span class="k">return</span>
+        <span class="c"># Recover the x,y limits</span>
+        <span class="k">if</span> <span class="p">(</span><span class="n">xlo</span> <span class="ow">and</span> <span class="n">xhi</span> <span class="ow">and</span> <span class="n">ylo</span> <span class="ow">and</span> <span class="n">yhi</span><span class="p">)</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="k">if</span> <span class="p">(</span><span class="n">xlo</span> <span class="o">&gt;</span> <span class="n">data</span><span class="o">.</span><span class="n">xmin</span> <span class="ow">and</span> <span class="n">xhi</span> <span class="o">&lt;</span> <span class="n">data</span><span class="o">.</span><span class="n">xmax</span> <span class="ow">and</span>\
+                        <span class="n">ylo</span> <span class="o">&gt;</span> <span class="n">data</span><span class="o">.</span><span class="n">ymin</span> <span class="ow">and</span> <span class="n">yhi</span> <span class="o">&lt;</span> <span class="n">data</span><span class="o">.</span><span class="n">ymax</span><span class="p">):</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">set_xlim</span><span class="p">((</span><span class="n">xlo</span><span class="p">,</span> <span class="n">xhi</span><span class="p">))</span>     
+                <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">set_ylim</span><span class="p">((</span><span class="n">ylo</span><span class="p">,</span> <span class="n">yhi</span><span class="p">))</span> 
+            <span class="k">else</span><span class="p">:</span> 
+                <span class="bp">self</span><span class="o">.</span><span class="n">toolbar</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">is_zoomed</span> <span class="o">=</span> <span class="bp">False</span>
+
+    <span class="k">def</span> <span class="nf">_set_axis_labels</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></div>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Set axis labels</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data2D</span>
+        <span class="c"># control axis labels from the panel itself</span>
+        <span class="n">yname</span><span class="p">,</span> <span class="n">yunits</span> <span class="o">=</span> <span class="n">data</span><span class="o">.</span><span class="n">get_yaxis</span><span class="p">()</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_label</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="n">yname</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_label</span>
+            <span class="n">yunits</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_unit</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_label</span> <span class="o">=</span> <span class="n">yname</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_unit</span> <span class="o">=</span> <span class="n">yunits</span>
+        <span class="n">xname</span><span class="p">,</span> <span class="n">xunits</span> <span class="o">=</span> <span class="n">data</span><span class="o">.</span><span class="n">get_xaxis</span><span class="p">()</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_label</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="n">xname</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_label</span>
+            <span class="n">xunits</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_unit</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_label</span> <span class="o">=</span> <span class="n">xname</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_unit</span> <span class="o">=</span> <span class="n">xunits</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">xaxis</span><span class="p">(</span><span class="n">xname</span><span class="p">,</span> <span class="n">xunits</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_font</span><span class="p">,</span> 
+                   <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_color</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_tick</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">yaxis</span><span class="p">(</span><span class="n">yname</span><span class="p">,</span> <span class="n">yunits</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_font</span><span class="p">,</span> 
+                   <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_color</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_tick</span><span class="p">)</span>
+        
+    <span class="k">def</span> <span class="nf">onContextMenu</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+<div class="viewcode-block" id="ModelPanel2D.onContextMenu"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter2D.ModelPanel2D.onContextMenu">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        2D plot context menu</span>
+<span class="sd">        </span>
+<span class="sd">        :param event: wx context event</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">slicerpop</span> <span class="o">=</span> <span class="n">PanelMenu</span><span class="p">()</span>
+        <span class="n">slicerpop</span><span class="o">.</span><span class="n">set_plots</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">)</span>
+        <span class="n">slicerpop</span><span class="o">.</span><span class="n">set_graph</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="p">)</span>
+             
+        <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+        <span class="n">slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Save Image&#39;</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onSaveImage</span><span class="p">)</span>
+        
+        <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+        <span class="n">slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span><span class="s">&#39;&amp;Print Image&#39;</span><span class="p">,</span> <span class="s">&#39;Print image&#39;</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onPrint</span><span class="p">)</span>
+        
+        <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+        <span class="n">slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span><span class="s">&#39;&amp;Print Preview&#39;</span><span class="p">,</span> <span class="s">&#39;Print preview&#39;</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onPrinterPreview</span><span class="p">)</span>
+
+        <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+        <span class="n">slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Copy to Clipboard&#39;</span><span class="p">,</span> <span class="s">&#39;Copy to the clipboard&#39;</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">OnCopyFigureMenu</span><span class="p">)</span>
+        <span class="n">slicerpop</span><span class="o">.</span><span class="n">AppendSeparator</span><span class="p">()</span>
+        <span class="c"># saving data</span>
+        <span class="n">plot</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data2D</span>
+        <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+        <span class="n">name</span> <span class="o">=</span> <span class="n">plot</span><span class="o">.</span><span class="n">name</span>
+        <span class="n">slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&quot;&amp;Data Info&quot;</span> <span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_onDataShow</span><span class="p">)</span>
+
+        <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+        <span class="n">name</span> <span class="o">=</span> <span class="n">plot</span><span class="o">.</span><span class="n">name</span>
+        <span class="n">slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&quot;&amp;Save as a File (DAT)&quot;</span> <span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">action_ids</span><span class="p">[</span><span class="nb">str</span><span class="p">(</span><span class="nb">id</span><span class="p">)]</span> <span class="o">=</span> <span class="n">plot</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_onSave</span><span class="p">)</span>
+
+        <span class="n">slicerpop</span><span class="o">.</span><span class="n">AppendSeparator</span><span class="p">()</span>
+        <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">detector</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>        
+            
+            <span class="n">item_list</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">get_current_context_menu</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
+            <span class="k">if</span> <span class="p">(</span><span class="ow">not</span> <span class="n">item_list</span> <span class="o">==</span> <span class="bp">None</span><span class="p">)</span> <span class="ow">and</span> <span class="p">(</span><span class="ow">not</span> <span class="nb">len</span><span class="p">(</span><span class="n">item_list</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span> <span class="ow">and</span>\
+                <span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">name</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">&quot; &quot;</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span> <span class="o">!=</span> <span class="s">&#39;Residuals&#39;</span><span class="p">:</span>  
+                <span class="c"># The line above; Not for trunk</span>
+                <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">item_list</span><span class="p">:</span>
+                    <span class="k">try</span><span class="p">:</span>
+                        <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+                        <span class="n">slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="n">item</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">item</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span>
+                        <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">item</span><span class="p">[</span><span class="mi">2</span><span class="p">])</span>
+                    <span class="k">except</span><span class="p">:</span>
+                        <span class="n">msg</span> <span class="o">=</span> <span class="s">&quot;ModelPanel1D.onContextMenu: &quot;</span>
+                        <span class="n">msg</span> <span class="o">+=</span> <span class="s">&quot;bad menu item  </span><span class="si">%s</span><span class="s">&quot;</span><span class="o">%</span><span class="n">sys</span><span class="o">.</span><span class="n">exc_value</span>
+                        <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> <span class="n">StatusEvent</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="n">msg</span><span class="p">))</span>
+                        <span class="k">pass</span>
+                <span class="n">slicerpop</span><span class="o">.</span><span class="n">AppendSeparator</span><span class="p">()</span>
+            
+            <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+            <span class="n">slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Perform Circular Average&#39;</span><span class="p">)</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onCircular</span><span class="p">)</span> \
+            <span class="c"># For Masked Data</span>
+            <span class="k">if</span> <span class="ow">not</span> <span class="n">plot</span><span class="o">.</span><span class="n">mask</span><span class="o">.</span><span class="n">all</span><span class="p">():</span>
+                <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+                <span class="n">slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Masked Circular Average&#39;</span><span class="p">)</span>
+                <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onMaskedCircular</span><span class="p">)</span> 
+            <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+            <span class="n">slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Sector [Q View]&#39;</span><span class="p">)</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onSectorQ</span><span class="p">)</span> 
+            <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+            <span class="n">slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Annulus [Phi View ]&#39;</span><span class="p">)</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onSectorPhi</span><span class="p">)</span> 
+            <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+            <span class="n">slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Box Sum&#39;</span><span class="p">)</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onBoxSum</span><span class="p">)</span> 
+            <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+            <span class="n">slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Box Averaging in Qx&#39;</span><span class="p">)</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onBoxavgX</span><span class="p">)</span> 
+            <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+            <span class="n">slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Box Averaging in Qy&#39;</span><span class="p">)</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onBoxavgY</span><span class="p">)</span> 
+            <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+                <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+                <span class="n">slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Clear Slicer&#39;</span><span class="p">)</span>
+                <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span>  <span class="bp">self</span><span class="o">.</span><span class="n">onClearSlicer</span><span class="p">)</span> 
+                <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span><span class="o">.</span><span class="n">__class__</span><span class="o">.</span><span class="n">__name__</span>  <span class="o">!=</span> <span class="s">&quot;BoxSum&quot;</span><span class="p">:</span>
+                    <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+                    <span class="n">slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Edit Slicer Parameters&#39;</span><span class="p">)</span>
+                    <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_onEditSlicer</span><span class="p">)</span> 
+            <span class="n">slicerpop</span><span class="o">.</span><span class="n">AppendSeparator</span><span class="p">()</span> 
+            
+        <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+        <span class="n">slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Edit Graph Label&#39;</span><span class="p">,</span> <span class="s">&#39;Edit Graph Label&#39;</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onEditLabels</span><span class="p">)</span>
+        <span class="n">slicerpop</span><span class="o">.</span><span class="n">AppendSeparator</span><span class="p">()</span>
+        
+        <span class="c"># ILL mod here</span>
+
+        <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+        <span class="n">slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Modify graph appearance&#39;</span><span class="p">,</span><span class="s">&#39;Modify graph appearance&#39;</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">modifyGraphAppearance</span><span class="p">)</span>
+        <span class="n">slicerpop</span><span class="o">.</span><span class="n">AppendSeparator</span><span class="p">()</span>
+
+
+        
+        <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+        <span class="n">slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;2D Color Map&#39;</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_onEditDetector</span><span class="p">)</span>
+        <span class="n">slicerpop</span><span class="o">.</span><span class="n">AppendSeparator</span><span class="p">()</span>
+        
+        <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+        <span class="n">slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Toggle Linear/Log Scale&#39;</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_onToggleScale</span><span class="p">)</span> 
+        
+        
+        <span class="n">slicerpop</span><span class="o">.</span><span class="n">AppendSeparator</span><span class="p">()</span>
+        <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+        <span class="n">slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Window Title&#39;</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onChangeCaption</span><span class="p">)</span>
+        
+        <span class="k">try</span><span class="p">:</span>
+            <span class="n">pos_evt</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">GetPosition</span><span class="p">()</span>
+            <span class="n">pos</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">ScreenToClient</span><span class="p">(</span><span class="n">pos_evt</span><span class="p">)</span>
+        <span class="k">except</span><span class="p">:</span>
+            <span class="n">pos_x</span><span class="p">,</span> <span class="n">pos_y</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">toolbar</span><span class="o">.</span><span class="n">GetPositionTuple</span><span class="p">()</span>
+            <span class="n">pos</span> <span class="o">=</span> <span class="p">(</span><span class="n">pos_x</span><span class="p">,</span> <span class="n">pos_y</span> <span class="o">+</span> <span class="mi">5</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">PopupMenu</span><span class="p">(</span><span class="n">slicerpop</span><span class="p">,</span> <span class="n">pos</span><span class="p">)</span>
+        
+            
+    <span class="k">def</span> <span class="nf">onEditLabels</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span></div>
+<div class="viewcode-block" id="ModelPanel2D.onEditLabels"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter2D.ModelPanel2D.onEditLabels">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Edit legend label</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">try</span><span class="p">:</span>
+            <span class="n">selected_plot</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">selected_plottable</span><span class="p">]</span>
+        <span class="k">except</span><span class="p">:</span>
+            <span class="n">selected_plot</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">id</span><span class="p">]</span>
+        <span class="n">label</span> <span class="o">=</span> <span class="n">selected_plot</span><span class="o">.</span><span class="n">label</span>
+        <span class="n">dial</span> <span class="o">=</span> <span class="n">TextDialog</span><span class="p">(</span><span class="bp">None</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s">&#39;Change Label&#39;</span><span class="p">,</span> <span class="n">label</span><span class="p">)</span>
+        <span class="k">if</span> <span class="n">dial</span><span class="o">.</span><span class="n">ShowModal</span><span class="p">()</span> <span class="o">==</span> <span class="n">wx</span><span class="o">.</span><span class="n">ID_OK</span><span class="p">:</span>
+            <span class="k">try</span><span class="p">:</span>
+                <span class="n">FONT</span> <span class="o">=</span> <span class="n">FontProperties</span><span class="p">()</span>
+                <span class="n">newlabel</span> <span class="o">=</span> <span class="n">dial</span><span class="o">.</span><span class="n">getText</span><span class="p">()</span>
+                <span class="n">font</span> <span class="o">=</span> <span class="n">FONT</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span>
+                <span class="n">font</span><span class="o">.</span><span class="n">set_size</span><span class="p">(</span><span class="n">dial</span><span class="o">.</span><span class="n">getSize</span><span class="p">())</span>
+                <span class="n">font</span><span class="o">.</span><span class="n">set_family</span><span class="p">(</span><span class="n">dial</span><span class="o">.</span><span class="n">getFamily</span><span class="p">())</span>
+                <span class="n">font</span><span class="o">.</span><span class="n">set_style</span><span class="p">(</span><span class="n">dial</span><span class="o">.</span><span class="n">getStyle</span><span class="p">())</span>
+                <span class="n">font</span><span class="o">.</span><span class="n">set_weight</span><span class="p">(</span><span class="n">dial</span><span class="o">.</span><span class="n">getWeight</span><span class="p">())</span>
+                <span class="n">colour</span> <span class="o">=</span> <span class="n">dial</span><span class="o">.</span><span class="n">getColor</span><span class="p">()</span>
+                <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">newlabel</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
+                    <span class="c"># update Label</span>
+                    <span class="n">selected_plot</span><span class="o">.</span><span class="n">label</span> <span class="o">=</span> <span class="n">newlabel</span>
+                    <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">title</span><span class="p">(</span><span class="n">newlabel</span><span class="p">)</span>
+                    <span class="bp">self</span><span class="o">.</span><span class="n">title_label</span> <span class="o">=</span> <span class="n">selected_plot</span><span class="o">.</span><span class="n">label</span>
+                    <span class="bp">self</span><span class="o">.</span><span class="n">title_font</span> <span class="o">=</span> <span class="n">font</span>
+                    <span class="bp">self</span><span class="o">.</span><span class="n">title_color</span> <span class="o">=</span> <span class="n">colour</span>
+                    <span class="c">## render the graph</span>
+                    <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">set_title</span><span class="p">(</span><span class="n">label</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">title_label</span><span class="p">,</span>
+                                           <span class="n">fontproperties</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">title_font</span><span class="p">,</span>
+                                           <span class="n">color</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">title_color</span><span class="p">)</span>
+                    <span class="bp">self</span><span class="o">.</span><span class="n">_is_changed_legend_label</span> <span class="o">=</span> <span class="bp">True</span>
+                    <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">figure</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">draw_idle</span><span class="p">()</span>  
+            <span class="k">except</span><span class="p">:</span>
+                <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+                    <span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">StatusEvent</span> 
+                    <span class="n">msg</span><span class="o">=</span> <span class="s">&quot;Add Text: Error. Check your property values...&quot;</span>
+                    <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> <span class="n">StatusEvent</span><span class="p">(</span><span class="n">status</span> <span class="o">=</span> <span class="n">msg</span> <span class="p">))</span>
+                <span class="k">else</span><span class="p">:</span>
+                    <span class="k">raise</span>
+        <span class="n">dial</span><span class="o">.</span><span class="n">Destroy</span><span class="p">()</span>
+        
+    <span class="k">def</span> <span class="nf">_onEditDetector</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span></div>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Allow to view and edits  detector parameters</span>
+<span class="sd">        </span>
+<span class="sd">        :param event: wx.menu event</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="kn">import</span> <span class="nn">detector_dialog</span>
+        <span class="n">dialog</span> <span class="o">=</span> <span class="n">detector_dialog</span><span class="o">.</span><span class="n">DetectorDialog</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span><span class="n">base</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span>
+                       <span class="n">reset_zmin_ctl</span> <span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">default_zmin_ctl</span><span class="p">,</span>
+                       <span class="n">reset_zmax_ctl</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">default_zmax_ctl</span><span class="p">,</span><span class="n">cmap</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">cmap</span><span class="p">)</span>
+        <span class="c">## info of current detector and data2D</span>
+        <span class="n">xnpts</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">x_bins</span><span class="p">)</span>
+        <span class="n">ynpts</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">y_bins</span><span class="p">)</span>
+        <span class="n">xmax</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmin</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmax</span><span class="p">)</span>
+        <span class="n">ymax</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">ymin</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">ymax</span><span class="p">)</span>
+        <span class="n">qmax</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">pow</span><span class="p">(</span><span class="n">xmax</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span> <span class="o">+</span> <span class="n">math</span><span class="o">.</span><span class="n">pow</span><span class="p">(</span><span class="n">ymax</span><span class="p">,</span> <span class="mi">2</span><span class="p">))</span>
+        <span class="n">beam</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmin</span>
+        <span class="c">## set dialog window content</span>
+        <span class="n">dialog</span><span class="o">.</span><span class="n">setContent</span><span class="p">(</span><span class="n">xnpts</span><span class="o">=</span><span class="n">xnpts</span><span class="p">,</span><span class="n">ynpts</span><span class="o">=</span><span class="n">ynpts</span><span class="p">,</span><span class="n">qmax</span><span class="o">=</span><span class="n">qmax</span><span class="p">,</span>
+                           <span class="n">beam</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmin</span><span class="p">,</span>
+                           <span class="n">zmin</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">zmin_2D</span><span class="p">,</span>
+                          <span class="n">zmax</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">zmax_2D</span><span class="p">)</span>
+        <span class="k">if</span> <span class="n">dialog</span><span class="o">.</span><span class="n">ShowModal</span><span class="p">()</span> <span class="o">==</span> <span class="n">wx</span><span class="o">.</span><span class="n">ID_OK</span><span class="p">:</span>
+            <span class="n">evt</span> <span class="o">=</span> <span class="n">dialog</span><span class="o">.</span><span class="n">getContent</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">zmin_2D</span> <span class="o">=</span> <span class="n">evt</span><span class="o">.</span><span class="n">zmin</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">zmax_2D</span> <span class="o">=</span> <span class="n">evt</span><span class="o">.</span><span class="n">zmax</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">cmap</span> <span class="o">=</span> <span class="n">evt</span><span class="o">.</span><span class="n">cmap</span>
+        <span class="n">dialog</span><span class="o">.</span><span class="n">Destroy</span><span class="p">()</span>
+        <span class="c">## Redraw the current image</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">image</span><span class="p">(</span><span class="n">data</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">data</span><span class="p">,</span>
+                   <span class="n">qx_data</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">qx_data</span><span class="p">,</span>
+                   <span class="n">qy_data</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">qy_data</span><span class="p">,</span>
+                   <span class="n">xmin</span><span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmin</span><span class="p">,</span>
+                   <span class="n">xmax</span><span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmax</span><span class="p">,</span>
+                   <span class="n">ymin</span><span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">ymin</span><span class="p">,</span>
+                   <span class="n">ymax</span><span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">ymax</span><span class="p">,</span>
+                   <span class="n">zmin</span><span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">zmin_2D</span><span class="p">,</span>
+                   <span class="n">zmax</span><span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">zmax_2D</span><span class="p">,</span>
+                   <span class="n">cmap</span><span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">cmap</span><span class="p">,</span>
+                   <span class="n">color</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">symbol</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">figure</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">draw_idle</span><span class="p">()</span>
+        
+    <span class="k">def</span> <span class="nf">freeze_axes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+<div class="viewcode-block" id="ModelPanel2D.freeze_axes"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter2D.ModelPanel2D.freeze_axes">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">axes_frozen</span> <span class="o">=</span> <span class="bp">True</span>
+        
+    <span class="k">def</span> <span class="nf">thaw_axes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></div>
+<div class="viewcode-block" id="ModelPanel2D.thaw_axes"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter2D.ModelPanel2D.thaw_axes">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">axes_frozen</span> <span class="o">=</span> <span class="bp">False</span>
+        
+    <span class="k">def</span> <span class="nf">onMouseMotion</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="n">event</span><span class="p">):</span></div>
+<div class="viewcode-block" id="ModelPanel2D.onMouseMotion"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter2D.ModelPanel2D.onMouseMotion">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">pass</span>
+    
+    <span class="k">def</span> <span class="nf">onWheel</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span></div>
+<div class="viewcode-block" id="ModelPanel2D.onWheel"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter2D.ModelPanel2D.onWheel">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">pass</span>  
+      
+    <span class="k">def</span> <span class="nf">update</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">draw</span><span class="o">=</span><span class="bp">True</span><span class="p">):</span></div>
+<div class="viewcode-block" id="ModelPanel2D.update"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter2D.ModelPanel2D.update">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Respond to changes in the model by recalculating the </span>
+<span class="sd">        profiles and resetting the widgets.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">draw_plot</span><span class="p">()</span>
+        
+    <span class="k">def</span> <span class="nf">_getEmptySlicerEvent</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></div>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        create an empty slicervent </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">return</span> <span class="n">SlicerEvent</span><span class="p">(</span><span class="nb">type</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">params</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">obj_class</span><span class="o">=</span><span class="bp">None</span><span class="p">)</span>
+        
+    <span class="k">def</span> <span class="nf">_onEVT_INTERNAL</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Draw the slicer</span>
+<span class="sd">        </span>
+<span class="sd">        :param event: wx.lib.newevent (SlicerEvent) containing slicer</span>
+<span class="sd">            parameter</span>
+<span class="sd">            </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_setSlicer</span><span class="p">(</span><span class="n">event</span><span class="o">.</span><span class="n">slicer</span><span class="p">)</span>
+            
+    <span class="k">def</span> <span class="nf">_setSlicer</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">slicer</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Clear the previous slicer and create a new one.Post an internal</span>
+<span class="sd">        event.</span>
+<span class="sd">        </span>
+<span class="sd">        :param slicer: slicer class to create</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c">## Clear current slicer</span>
+        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>  
+            <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>            
+        <span class="c">## Create a new slicer    </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">slicer_z</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span> <span class="o">=</span> <span class="n">slicer</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="p">,</span> <span class="n">zorder</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">slicer_z</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">set_ylim</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">ymin</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">ymax</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">set_xlim</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmin</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmax</span><span class="p">)</span>
+        <span class="c">## Draw slicer</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        <span class="n">msg</span> <span class="o">=</span> <span class="s">&quot;Plotter2D._setSlicer  </span><span class="si">%s</span><span class="s">&quot;</span><span class="o">%</span><span class="bp">self</span><span class="o">.</span><span class="n">slicer</span><span class="o">.</span><span class="n">__class__</span><span class="o">.</span><span class="n">__name__</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> <span class="n">StatusEvent</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="n">msg</span><span class="p">))</span>
+        <span class="c"># Post slicer event</span>
+        <span class="n">event</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_getEmptySlicerEvent</span><span class="p">()</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">type</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span><span class="o">.</span><span class="n">__class__</span><span class="o">.</span><span class="n">__name__</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">obj_class</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span><span class="o">.</span><span class="n">__class__</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">params</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span><span class="o">.</span><span class="n">get_params</span><span class="p">()</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">)</span>
+        
+    <span class="k">def</span> <span class="nf">onMaskedCircular</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+<div class="viewcode-block" id="ModelPanel2D.onMaskedCircular"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter2D.ModelPanel2D.onMaskedCircular">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        perform circular averaging on Data2D with mask if it exists</span>
+<span class="sd">        </span>
+<span class="sd">        :param event: wx.menu event</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">onCircular</span><span class="p">(</span><span class="n">event</span><span class="p">,</span> <span class="bp">True</span><span class="p">)</span>
+        
+    <span class="k">def</span> <span class="nf">onCircular</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">,</span> <span class="n">ismask</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span></div>
+<div class="viewcode-block" id="ModelPanel2D.onCircular"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter2D.ModelPanel2D.onCircular">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        perform circular averaging on Data2D</span>
+<span class="sd">        </span>
+<span class="sd">        :param event: wx.menu event</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># Find the best number of bins</span>
+        <span class="n">npt</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">data</span><span class="p">[</span><span class="n">numpy</span><span class="o">.</span><span class="n">isfinite</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">data</span><span class="p">)]))</span>
+        <span class="n">npt</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">floor</span><span class="p">(</span><span class="n">npt</span><span class="p">)</span>
+        <span class="kn">from</span> <span class="nn">sas.dataloader.manipulations</span> <span class="kn">import</span> <span class="n">CircularAverage</span>
+        <span class="c">## compute the maximum radius of data2D</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">qmax</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmax</span><span class="p">),</span> 
+                        <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmin</span><span class="p">))</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">ymax</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">ymax</span><span class="p">),</span>
+                        <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">ymin</span><span class="p">))</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">radius</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">pow</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">qmax</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span><span class="o">+</span> <span class="n">math</span><span class="o">.</span><span class="n">pow</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">ymax</span><span class="p">,</span> <span class="mi">2</span><span class="p">))</span> 
+        <span class="c">##Compute beam width</span>
+        <span class="n">bin_width</span> <span class="o">=</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">qmax</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">qmax</span><span class="p">)</span><span class="o">/</span><span class="n">npt</span>
+        <span class="c">## Create data1D circular average of data2D</span>
+        <span class="n">Circle</span> <span class="o">=</span> <span class="n">CircularAverage</span><span class="p">(</span><span class="n">r_min</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">r_max</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">radius</span><span class="p">,</span> 
+                                 <span class="n">bin_width</span><span class="o">=</span><span class="n">bin_width</span><span class="p">)</span>
+        <span class="n">circ</span> <span class="o">=</span> <span class="n">Circle</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="p">,</span> <span class="n">ismask</span><span class="o">=</span><span class="n">ismask</span><span class="p">)</span>
+        <span class="kn">from</span> <span class="nn">sas.guiframe.dataFitting</span> <span class="kn">import</span> <span class="n">Data1D</span>
+        <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">circ</span><span class="p">,</span> <span class="s">&quot;dxl&quot;</span><span class="p">):</span>
+            <span class="n">dxl</span> <span class="o">=</span> <span class="n">circ</span><span class="o">.</span><span class="n">dxl</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="n">dxl</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">circ</span><span class="p">,</span> <span class="s">&quot;dxw&quot;</span><span class="p">):</span>
+            <span class="n">dxw</span> <span class="o">=</span> <span class="n">circ</span><span class="o">.</span><span class="n">dxw</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="n">dxw</span> <span class="o">=</span> <span class="bp">None</span>
+
+        <span class="n">new_plot</span> <span class="o">=</span> <span class="n">Data1D</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="n">circ</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="n">circ</span><span class="o">.</span><span class="n">y</span><span class="p">,</span> <span class="n">dy</span><span class="o">=</span><span class="n">circ</span><span class="o">.</span><span class="n">dy</span><span class="p">,</span> <span class="n">dx</span><span class="o">=</span><span class="n">circ</span><span class="o">.</span><span class="n">dx</span><span class="p">)</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">dxl</span> <span class="o">=</span> <span class="n">dxl</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">dxw</span> <span class="o">=</span> <span class="n">dxw</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="s">&quot;Circ avg &quot;</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">name</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">source</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">source</span>
+        <span class="c">#new_plot.info = self.data2D.info</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">interactive</span> <span class="o">=</span> <span class="bp">True</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">detector</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">detector</span>
+        
+        <span class="c">## If the data file does not tell us what the axes are, just assume...</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">xaxis</span><span class="p">(</span><span class="s">&quot;</span><span class="se">\\</span><span class="s">rm{Q}&quot;</span><span class="p">,</span> <span class="s">&quot;A^{-1}&quot;</span><span class="p">)</span>
+        <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="p">,</span> <span class="s">&quot;scale&quot;</span><span class="p">)</span> <span class="ow">and</span> \
+                    <span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">scale</span> <span class="o">==</span> <span class="s">&#39;linear&#39;</span><span class="p">:</span>
+            <span class="n">new_plot</span><span class="o">.</span><span class="n">ytransform</span> <span class="o">=</span> <span class="s">&#39;y&#39;</span>
+            <span class="n">new_plot</span><span class="o">.</span><span class="n">yaxis</span><span class="p">(</span><span class="s">&quot;</span><span class="se">\\</span><span class="s">rm{Residuals} &quot;</span><span class="p">,</span> <span class="s">&quot;normalized&quot;</span><span class="p">)</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="n">new_plot</span><span class="o">.</span><span class="n">yaxis</span><span class="p">(</span><span class="s">&quot;</span><span class="se">\\</span><span class="s">rm{Intensity} &quot;</span><span class="p">,</span> <span class="s">&quot;cm^{-1}&quot;</span><span class="p">)</span>
+
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">group_id</span> <span class="o">=</span> <span class="s">&quot;2daverage&quot;</span>  <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">name</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">id</span> <span class="o">=</span> <span class="s">&quot;Circ avg &quot;</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">name</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">is_data</span> <span class="o">=</span> <span class="bp">True</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">update_theory</span><span class="p">(</span><span class="n">data_id</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> \
+                                       <span class="n">theory</span><span class="o">=</span><span class="n">new_plot</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> 
+                     <span class="n">NewPlotEvent</span><span class="p">(</span><span class="n">plot</span><span class="o">=</span><span class="n">new_plot</span><span class="p">,</span> <span class="n">title</span><span class="o">=</span><span class="n">new_plot</span><span class="o">.</span><span class="n">name</span><span class="p">))</span>
+       
+    <span class="k">def</span> <span class="nf">_onEditSlicer</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span></div>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Is available only when a slicer is drawn.Create a dialog </span>
+<span class="sd">        window where the user can enter value to reset slicer</span>
+<span class="sd">        parameters.</span>
+<span class="sd">        </span>
+<span class="sd">        :param event: wx.menu event</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="kn">from</span> <span class="nn">SlicerParameters</span> <span class="kn">import</span> <span class="n">SlicerParameterPanel</span>
+            <span class="n">dialog</span> <span class="o">=</span> <span class="n">SlicerParameterPanel</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s">&quot;Slicer Parameters&quot;</span><span class="p">)</span>
+            <span class="n">dialog</span><span class="o">.</span><span class="n">set_slicer</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">slicer</span><span class="o">.</span><span class="n">__class__</span><span class="o">.</span><span class="n">__name__</span><span class="p">,</span>
+                            <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span><span class="o">.</span><span class="n">get_params</span><span class="p">())</span>
+            <span class="k">if</span> <span class="n">dialog</span><span class="o">.</span><span class="n">ShowModal</span><span class="p">()</span> <span class="o">==</span> <span class="n">wx</span><span class="o">.</span><span class="n">ID_OK</span><span class="p">:</span>
+                <span class="n">dialog</span><span class="o">.</span><span class="n">Destroy</span><span class="p">()</span> 
+        
+    <span class="k">def</span> <span class="nf">onSectorQ</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+<div class="viewcode-block" id="ModelPanel2D.onSectorQ"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter2D.ModelPanel2D.onSectorQ">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Perform sector averaging on Q and draw sector slicer</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="kn">from</span> <span class="nn">SectorSlicer</span> <span class="kn">import</span> <span class="n">SectorInteractor</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">onClearSlicer</span><span class="p">(</span><span class="n">event</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">InternalEvent</span><span class="p">(</span><span class="n">slicer</span><span class="o">=</span><span class="n">SectorInteractor</span><span class="p">))</span>
+        
+    <span class="k">def</span> <span class="nf">onSectorPhi</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span></div>
+<div class="viewcode-block" id="ModelPanel2D.onSectorPhi"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter2D.ModelPanel2D.onSectorPhi">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Perform sector averaging on Phi and draw annulus slicer</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="kn">from</span> <span class="nn">AnnulusSlicer</span> <span class="kn">import</span> <span class="n">AnnulusInteractor</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">onClearSlicer</span><span class="p">(</span><span class="n">event</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">InternalEvent</span><span class="p">(</span><span class="n">slicer</span><span class="o">=</span><span class="n">AnnulusInteractor</span><span class="p">))</span>
+        
+    <span class="k">def</span> <span class="nf">onBoxSum</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span></div>
+<div class="viewcode-block" id="ModelPanel2D.onBoxSum"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter2D.ModelPanel2D.onBoxSum">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="kn">from</span> <span class="nn">sas.guiframe.gui_manager</span> <span class="kn">import</span> <span class="n">MDIFrame</span>
+        <span class="kn">from</span> <span class="nn">boxSum</span> <span class="kn">import</span> <span class="n">BoxSum</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">onClearSlicer</span><span class="p">(</span><span class="n">event</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">slicer_z</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span> <span class="o">=</span>  <span class="n">BoxSum</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="p">,</span> <span class="n">zorder</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">slicer_z</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">set_ylim</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">ymin</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">ymax</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">set_xlim</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmin</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmax</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        <span class="c">## Value used to initially set the slicer panel</span>
+        <span class="nb">type</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span><span class="o">.</span><span class="n">__class__</span><span class="o">.</span><span class="n">__name__</span>
+        <span class="n">params</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span><span class="o">.</span><span class="n">get_params</span><span class="p">()</span>
+        <span class="c">## Create a new panel to display results of summation of Data2D</span>
+        <span class="kn">from</span> <span class="nn">slicerpanel</span> <span class="kn">import</span> <span class="n">SlicerPanel</span>
+        <span class="n">win</span> <span class="o">=</span> <span class="n">MDIFrame</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> <span class="bp">None</span><span class="p">,</span> <span class="s">&#39;None&#39;</span><span class="p">,</span> <span class="p">(</span><span class="mi">100</span><span class="p">,</span> <span class="mi">200</span><span class="p">))</span>
+        <span class="n">new_panel</span> <span class="o">=</span> <span class="n">SlicerPanel</span><span class="p">(</span><span class="n">parent</span><span class="o">=</span><span class="n">win</span><span class="p">,</span> <span class="nb">id</span><span class="o">=-</span><span class="mi">1</span><span class="p">,</span>
+                                    <span class="n">base</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="nb">type</span><span class="p">,</span>
+                                    <span class="n">params</span><span class="o">=</span><span class="n">params</span><span class="p">,</span> <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">RAISED_BORDER</span><span class="p">)</span>
+        
+        <span class="n">new_panel</span><span class="o">.</span><span class="n">window_caption</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span><span class="o">.</span><span class="n">__class__</span><span class="o">.</span><span class="n">__name__</span> <span class="o">+</span> <span class="s">&quot; &quot;</span> <span class="o">+</span> \
+                                    <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
+        <span class="n">new_panel</span><span class="o">.</span><span class="n">window_name</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span><span class="o">.</span><span class="n">__class__</span><span class="o">.</span><span class="n">__name__</span><span class="o">+</span> <span class="s">&quot; &quot;</span> <span class="o">+</span> \
+                                    <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
+        <span class="c">## Store a reference of the new created panel</span>
+        
+        <span class="c">## save the window_caption of the new panel in the current slicer</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span><span class="o">.</span><span class="n">set_panel_name</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="n">new_panel</span><span class="o">.</span><span class="n">window_caption</span><span class="p">)</span>
+        <span class="c">## post slicer panel to guiframe to display it </span>
+        <span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">SlicerPanelEvent</span>
+        
+        <span class="n">win</span><span class="o">.</span><span class="n">set_panel</span><span class="p">(</span><span class="n">new_panel</span><span class="p">)</span>
+        <span class="n">new_panel</span><span class="o">.</span><span class="n">frame</span> <span class="o">=</span> <span class="n">win</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> <span class="n">SlicerPanelEvent</span><span class="p">(</span><span class="n">panel</span><span class="o">=</span><span class="n">new_panel</span><span class="p">,</span>
+                                                    <span class="n">main_panel</span><span class="o">=</span><span class="bp">self</span><span class="p">))</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">CallAfter</span><span class="p">(</span><span class="n">new_panel</span><span class="o">.</span><span class="n">frame</span><span class="o">.</span><span class="n">Show</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">panel_slicer</span> <span class="o">=</span> <span class="n">new_panel</span>
+        
+    <span class="k">def</span> <span class="nf">onBoxavgX</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="n">event</span><span class="p">):</span></div>
+<div class="viewcode-block" id="ModelPanel2D.onBoxavgX"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter2D.ModelPanel2D.onBoxavgX">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Perform 2D data averaging on Qx</span>
+<span class="sd">        Create a new slicer .</span>
+<span class="sd">        </span>
+<span class="sd">        :param event: wx.menu event</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="kn">from</span> <span class="nn">boxSlicer</span> <span class="kn">import</span> <span class="n">BoxInteractorX</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">onClearSlicer</span><span class="p">(</span><span class="n">event</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">InternalEvent</span><span class="p">(</span><span class="n">slicer</span><span class="o">=</span><span class="n">BoxInteractorX</span><span class="p">))</span>
+       
+    <span class="k">def</span> <span class="nf">onBoxavgY</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="n">event</span><span class="p">):</span></div>
+<div class="viewcode-block" id="ModelPanel2D.onBoxavgY"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter2D.ModelPanel2D.onBoxavgY">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Perform 2D data averaging on Qy</span>
+<span class="sd">        Create a new slicer .</span>
+<span class="sd">        </span>
+<span class="sd">        :param event: wx.menu event</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="kn">from</span> <span class="nn">boxSlicer</span> <span class="kn">import</span> <span class="n">BoxInteractorY</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">onClearSlicer</span><span class="p">(</span><span class="n">event</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">InternalEvent</span><span class="p">(</span><span class="n">slicer</span><span class="o">=</span><span class="n">BoxInteractorY</span><span class="p">))</span>
+        
+    <span class="k">def</span> <span class="nf">onClearSlicer</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span></div>
+<div class="viewcode-block" id="ModelPanel2D.onClearSlicer"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter2D.ModelPanel2D.onClearSlicer">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Clear the slicer on the plot</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">figure</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">draw</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span> <span class="o">=</span> <span class="bp">None</span>
+            <span class="c"># Post slicer None event</span>
+            <span class="n">event</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_getEmptySlicerEvent</span><span class="p">()</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">)</span>
+            
+    <span class="k">def</span> <span class="nf">_onSave</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">evt</span><span class="p">):</span></div>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Save a data set to a dat(text) file</span>
+<span class="sd">        </span>
+<span class="sd">        :param evt: Menu event</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="nb">id</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">evt</span><span class="o">.</span><span class="n">GetId</span><span class="p">())</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">_default_save_location</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">_default_save_location</span>
+        <span class="n">default_name</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">selected_plottable</span><span class="p">]</span><span class="o">.</span><span class="n">label</span>
+        <span class="k">if</span> <span class="n">default_name</span><span class="o">.</span><span class="n">count</span><span class="p">(</span><span class="s">&#39;.&#39;</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
+            <span class="n">default_name</span> <span class="o">=</span> <span class="n">default_name</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">&#39;.&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+        <span class="n">default_name</span> <span class="o">+=</span> <span class="s">&quot;_out&quot;</span>
+        <span class="k">if</span> <span class="nb">id</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">action_ids</span><span class="p">:</span>         
+            <span class="n">path</span> <span class="o">=</span> <span class="bp">None</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">save_data2d</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="p">,</span> <span class="n">default_name</span><span class="p">)</span>
+            
+    <span class="k">def</span> <span class="nf">_onDataShow</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">evt</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Show the data set in text</span>
+<span class="sd">        </span>
+<span class="sd">        :param evt: Menu event</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">menu</span> <span class="o">=</span> <span class="n">evt</span><span class="o">.</span><span class="n">GetEventObject</span><span class="p">()</span>
+        <span class="nb">id</span> <span class="o">=</span> <span class="n">evt</span><span class="o">.</span><span class="n">GetId</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">set_selected_from_menu</span><span class="p">(</span><span class="n">menu</span><span class="p">,</span> <span class="nb">id</span><span class="p">)</span>
+        <span class="n">data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">selected_plottable</span><span class="p">]</span>
+        <span class="n">default_name</span> <span class="o">=</span> <span class="n">data</span><span class="o">.</span><span class="n">label</span>
+        <span class="k">if</span> <span class="n">default_name</span><span class="o">.</span><span class="n">count</span><span class="p">(</span><span class="s">&#39;.&#39;</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
+            <span class="n">default_name</span> <span class="o">=</span> <span class="n">default_name</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">&#39;.&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+        <span class="c">#default_name += &quot;_out&quot;</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">show_data2d</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">default_name</span><span class="p">)</span>
+        
+
+    <span class="k">def</span> <span class="nf">modifyGraphAppearance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="n">e</span><span class="p">):</span>
+<div class="viewcode-block" id="ModelPanel2D.modifyGraphAppearance"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter2D.ModelPanel2D.modifyGraphAppearance">[docs]</a>        <span class="bp">self</span><span class="o">.</span><span class="n">graphApp</span> <span class="o">=</span> <span class="n">graphAppearance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="s">&#39;Modify graph appearance&#39;</span><span class="p">,</span>
+                                        <span class="n">legend</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>
+
+        
+
+        <span class="bp">self</span><span class="o">.</span><span class="n">graphApp</span><span class="o">.</span><span class="n">setDefaults</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">grid_on</span><span class="p">,</span><span class="bp">self</span><span class="o">.</span><span class="n">legend_on</span><span class="p">,</span>
+                                  <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_label</span><span class="p">,</span><span class="bp">self</span><span class="o">.</span><span class="n">yaxis_label</span><span class="p">,</span>
+                                  <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_unit</span><span class="p">,</span><span class="bp">self</span><span class="o">.</span><span class="n">yaxis_unit</span><span class="p">,</span>
+                                  <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_font</span><span class="p">,</span><span class="bp">self</span><span class="o">.</span><span class="n">yaxis_font</span><span class="p">,</span>
+                                  <span class="n">find_key</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">get_loc_label</span><span class="p">(),</span><span class="bp">self</span><span class="o">.</span><span class="n">legendLoc</span><span class="p">),</span>
+                                  <span class="bp">self</span><span class="o">.</span><span class="n">xcolor</span><span class="p">,</span><span class="bp">self</span><span class="o">.</span><span class="n">ycolor</span><span class="p">,</span>
+                                   <span class="bp">self</span><span class="o">.</span><span class="n">is_xtick</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_ytick</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">graphApp</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_CLOSE</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">on_graphApp_close</span><span class="p">)</span>
+    
+
+    <span class="k">def</span> <span class="nf">on_graphApp_close</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="n">e</span><span class="p">):</span></div>
+<div class="viewcode-block" id="ModelPanel2D.on_graphApp_close"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.Plotter2D.ModelPanel2D.on_graphApp_close">[docs]</a>        <span class="c"># gets values from graph appearance dialog and sends them off</span>
+        <span class="c"># to modify the plot</span>
+
+        <span class="bp">self</span><span class="o">.</span><span class="n">onGridOnOff</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">graphApp</span><span class="o">.</span><span class="n">get_togglegrid</span><span class="p">())</span>
+
+        
+        <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_label</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">graphApp</span><span class="o">.</span><span class="n">get_xlab</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_label</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">graphApp</span><span class="o">.</span><span class="n">get_ylab</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_unit</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">graphApp</span><span class="o">.</span><span class="n">get_xunit</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_unit</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">graphApp</span><span class="o">.</span><span class="n">get_yunit</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_font</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">graphApp</span><span class="o">.</span><span class="n">get_xfont</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_font</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">graphApp</span><span class="o">.</span><span class="n">get_yfont</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">is_xtick</span> <span class="o">=</span>  <span class="bp">self</span><span class="o">.</span><span class="n">graphApp</span><span class="o">.</span><span class="n">get_xtick_check</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">is_ytick</span> <span class="o">=</span>  <span class="bp">self</span><span class="o">.</span><span class="n">graphApp</span><span class="o">.</span><span class="n">get_ytick_check</span><span class="p">()</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_xtick</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_tick</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_font</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_ytick</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_tick</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_font</span>
+
+        <span class="bp">self</span><span class="o">.</span><span class="n">xaxis</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">xaxis_label</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_unit</span><span class="p">,</span> 
+                   <span class="bp">self</span><span class="o">.</span><span class="n">graphApp</span><span class="o">.</span><span class="n">get_xfont</span><span class="p">(),</span> <span class="bp">self</span><span class="o">.</span><span class="n">graphApp</span><span class="o">.</span><span class="n">get_xcolor</span><span class="p">(),</span> 
+                   <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_tick</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">yaxis</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">yaxis_label</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_unit</span><span class="p">,</span> 
+                   <span class="bp">self</span><span class="o">.</span><span class="n">graphApp</span><span class="o">.</span><span class="n">get_yfont</span><span class="p">(),</span> <span class="bp">self</span><span class="o">.</span><span class="n">graphApp</span><span class="o">.</span><span class="n">get_ycolor</span><span class="p">(),</span>
+                   <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_tick</span><span class="p">)</span>
+
+        <span class="bp">self</span><span class="o">.</span><span class="n">graphApp</span><span class="o">.</span><span class="n">Destroy</span><span class="p">()</span>
+</pre></div></div></div>
+
+          </div>
+        </div>
+      </div>
+      <div class="sphinxsidebar">
+        <div class="sphinxsidebarwrapper">
+<div id="searchbox" style="display: none">
+  <h3>Quick search</h3>
+    <form class="search" action="../../../../../search.html" method="get">
+      <input type="text" name="q" />
+      <input type="submit" value="Go" />
+      <input type="hidden" name="check_keywords" value="yes" />
+      <input type="hidden" name="area" value="default" />
+    </form>
+    <p class="searchtip" style="font-size: 90%">
+    Enter search terms or a module, class or function name.
+    </p>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+        </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" >sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>
+    <div class="footer">
+        &copy; Copyright 2013, The SasView Project.
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
+    </div>
+  </body>
+</html>
Index: _modules/sas/guiframe/local_perspectives/plotting/SectorSlicer.html
===================================================================
--- _modules/sas/guiframe/local_perspectives/plotting/SectorSlicer.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
+++ _modules/sas/guiframe/local_perspectives/plotting/SectorSlicer.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
@@ -0,0 +1,721 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>sas.guiframe.local_perspectives.plotting.SectorSlicer &mdash; SasView 3.0.0 documentation</title>
+    
+    <link rel="stylesheet" href="../../../../../_static/default.css" type="text/css" />
+    <link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '../../../../../',
+        VERSION:     '3.0.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="../../../../../_static/jquery.js"></script>
+    <script type="text/javascript" src="../../../../../_static/underscore.js"></script>
+    <script type="text/javascript" src="../../../../../_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <link rel="top" title="SasView 3.0.0 documentation" href="../../../../../index.html" />
+    <link rel="up" title="sas.guiframe" href="../../../guiframe.html" /> 
+  </head>
+  <body>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" accesskey="U">sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>  
+
+    <div class="document">
+      <div class="documentwrapper">
+        <div class="bodywrapper">
+          <div class="body">
+            
+  <h1>Source code for sas.guiframe.local_perspectives.plotting.SectorSlicer</h1><div class="highlight"><pre>
+<span class="kn">import</span> <span class="nn">math</span>
+<span class="kn">import</span> <span class="nn">wx</span>
+<span class="c">#from copy import deepcopy</span>
+<span class="kn">from</span> <span class="nn">BaseInteractor</span> <span class="kn">import</span> <span class="n">_BaseInteractor</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">NewPlotEvent</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">StatusEvent</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">SlicerParameterEvent</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">EVT_SLICER_PARS</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.dataFitting</span> <span class="kn">import</span> <span class="n">Data1D</span>
+
+
+<span class="k">class</span> <span class="nc">SectorInteractor</span><span class="p">(</span><span class="n">_BaseInteractor</span><span class="p">):</span>
+<div class="viewcode-block" id="SectorInteractor"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.SectorInteractor">[docs]</a>    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Draw a sector slicer.Allow to performQ averaging on data 2D</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s">&#39;black&#39;</span><span class="p">,</span> <span class="n">zorder</span><span class="o">=</span><span class="mi">3</span><span class="p">):</span>
+        
+        <span class="n">_BaseInteractor</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="n">color</span><span class="p">)</span>
+        <span class="c">## Class initialization</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">markers</span> <span class="o">=</span> <span class="p">[]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">axes</span> <span class="o">=</span> <span class="n">axes</span>   
+        <span class="c">## connect the plot to event </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">connect</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">connect</span>
+        
+        <span class="c">## compute qmax limit to reset the graph     </span>
+        <span class="n">x</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">pow</span><span class="p">(</span><span class="nb">max</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmax</span><span class="p">,</span> 
+                         <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmin</span><span class="p">)),</span> <span class="mi">2</span><span class="p">)</span>
+        <span class="n">y</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">pow</span><span class="p">(</span><span class="nb">max</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">ymax</span><span class="p">,</span> 
+                         <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">ymin</span><span class="p">)),</span> <span class="mi">2</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">qmax</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="n">x</span> <span class="o">+</span> <span class="n">y</span><span class="p">)</span>
+        <span class="c">## Number of points on the plot</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">nbins</span> <span class="o">=</span> <span class="mi">20</span>
+        <span class="c">## Angle of the middle line</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">theta2</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="o">/</span><span class="mi">3</span>
+        <span class="c">## Absolute value of the Angle between the middle line and any side line</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">phi</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="o">/</span><span class="mi">12</span>
+        <span class="c">## Middle line</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">main_line</span> <span class="o">=</span> <span class="n">LineInteractor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">subplot</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s">&#39;blue&#39;</span><span class="p">,</span> 
+                                        <span class="n">zorder</span><span class="o">=</span><span class="n">zorder</span><span class="p">,</span> <span class="n">r</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">qmax</span><span class="p">,</span>
+                                           <span class="n">theta</span><span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta2</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="o">.</span><span class="n">qmax</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">qmax</span>
+        <span class="c">## Right Side line</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">right_line</span> <span class="o">=</span> <span class="n">SideInteractor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">subplot</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s">&#39;black&#39;</span><span class="p">,</span>
+                                          <span class="n">zorder</span><span class="o">=</span><span class="n">zorder</span><span class="p">,</span> <span class="n">r</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">qmax</span><span class="p">,</span>
+                                          <span class="n">phi</span><span class="o">=-</span><span class="mi">1</span><span class="o">*</span><span class="bp">self</span><span class="o">.</span><span class="n">phi</span><span class="p">,</span> <span class="n">theta2</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">theta2</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">right_line</span><span class="o">.</span><span class="n">qmax</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">qmax</span>
+        <span class="c">## Left Side line </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">left_line</span> <span class="o">=</span> <span class="n">SideInteractor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">subplot</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s">&#39;black&#39;</span><span class="p">,</span>
+                                        <span class="n">zorder</span><span class="o">=</span><span class="n">zorder</span><span class="p">,</span> <span class="n">r</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">qmax</span><span class="p">,</span>
+                                           <span class="n">phi</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">phi</span><span class="p">,</span> <span class="n">theta2</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">theta2</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">qmax</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">qmax</span>
+        <span class="c">## draw the sector               </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_post_data</span><span class="p">()</span>
+        <span class="c">## Bind to slice parameter events</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">EVT_SLICER_PARS</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_onEVT_SLICER_PARS</span><span class="p">)</span>
+
+    <span class="k">def</span> <span class="nf">_onEVT_SLICER_PARS</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        receive an event containing parameters values to reset the slicer</span>
+<span class="sd">        </span>
+<span class="sd">        :param event: event of type SlicerParameterEvent with params as </span>
+<span class="sd">        attribute</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span>
+                     <span class="n">StatusEvent</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="s">&quot;SectorSlicer._onEVT_SLICER_PARS&quot;</span><span class="p">))</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">Skip</span><span class="p">()</span>
+        <span class="k">if</span> <span class="n">event</span><span class="o">.</span><span class="n">type</span> <span class="o">==</span> <span class="bp">self</span><span class="o">.</span><span class="n">__class__</span><span class="o">.</span><span class="n">__name__</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">set_params</span><span class="p">(</span><span class="n">event</span><span class="o">.</span><span class="n">params</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+            
+    <span class="k">def</span> <span class="nf">set_layer</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">n</span><span class="p">):</span>
+<div class="viewcode-block" id="SectorInteractor.set_layer"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.SectorInteractor.set_layer">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">         Allow adding plot to the same panel</span>
+<span class="sd">         </span>
+<span class="sd">        :param n: the number of layer</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">layernum</span> <span class="o">=</span> <span class="n">n</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        
+    <span class="k">def</span> <span class="nf">clear</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></div>
+<div class="viewcode-block" id="SectorInteractor.clear"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.SectorInteractor.clear">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Clear the slicer and all connected events related to this slicer</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">clear_markers</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">right_line</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">connect</span><span class="o">.</span><span class="n">clearall</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">Unbind</span><span class="p">(</span><span class="n">EVT_SLICER_PARS</span><span class="p">)</span>
+        
+    <span class="k">def</span> <span class="nf">update</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></div>
+<div class="viewcode-block" id="SectorInteractor.update"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.SectorInteractor.update">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Respond to changes in the model by recalculating the profiles and</span>
+<span class="sd">        resetting the widgets.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># Update locations  </span>
+        <span class="c">## Check if the middle line was dragged and </span>
+        <span class="c">#update the picture accordingly     </span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="o">.</span><span class="n">has_move</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">right_line</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">delta</span><span class="o">=-</span><span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">phi</span><span class="o">/</span><span class="mi">2</span><span class="p">,</span>
+                                    <span class="n">mline</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="o">.</span><span class="n">theta</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">delta</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">phi</span><span class="o">/</span><span class="mi">2</span><span class="p">,</span>
+                                   <span class="n">mline</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="o">.</span><span class="n">theta</span><span class="p">)</span>
+        <span class="c">## Check if the left side has moved and update the slicer accordingly  </span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">has_move</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">phi</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">delta</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">mline</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="p">,</span>
+                                  <span class="n">side</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="n">left</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">right_line</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">phi</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">phi</span><span class="p">,</span> <span class="n">delta</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
+                                     <span class="n">mline</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="p">,</span> <span class="n">side</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span>
+                                     <span class="n">left</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">right</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
+        <span class="c">## Check if the right side line has moved and </span>
+        <span class="c">#update the slicer accordingly</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">right_line</span><span class="o">.</span><span class="n">has_move</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">right_line</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">phi</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">delta</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">mline</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="p">,</span>
+                                   <span class="n">side</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="n">left</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">right</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">phi</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">right_line</span><span class="o">.</span><span class="n">phi</span><span class="p">,</span> <span class="n">delta</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
+                                    <span class="n">mline</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="p">,</span> <span class="n">side</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="n">left</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>
+            
+    <span class="k">def</span> <span class="nf">save</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span></div>
+<div class="viewcode-block" id="SectorInteractor.save"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.SectorInteractor.save">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Remember the roughness for this layer and the next so that we</span>
+<span class="sd">        can restore on Esc.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">freeze_axes</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="o">.</span><span class="n">save</span><span class="p">(</span><span class="n">ev</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">right_line</span><span class="o">.</span><span class="n">save</span><span class="p">(</span><span class="n">ev</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">save</span><span class="p">(</span><span class="n">ev</span><span class="p">)</span>
+
+    <span class="k">def</span> <span class="nf">_post_data</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">nbins</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span></div>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        compute sector averaging of data2D into data1D</span>
+<span class="sd">        </span>
+<span class="sd">        :param nbins: the number of point to plot for the average 1D data</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c">## get the data2D to average</span>
+        <span class="n">data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span>
+        <span class="c"># If we have no data, just return</span>
+        <span class="k">if</span> <span class="n">data</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="k">return</span>
+        <span class="c">## Averaging</span>
+        <span class="kn">from</span> <span class="nn">sas.dataloader.manipulations</span> <span class="kn">import</span> <span class="n">SectorQ</span>
+        <span class="n">radius</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">qmax</span> 
+        <span class="n">phimin</span> <span class="o">=</span>  <span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">phi</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="o">.</span><span class="n">theta</span>
+        <span class="n">phimax</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">phi</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="o">.</span><span class="n">theta</span>
+        <span class="k">if</span> <span class="n">nbins</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="n">nbins</span> <span class="o">=</span> <span class="mi">20</span>
+        <span class="n">sect</span> <span class="o">=</span> <span class="n">SectorQ</span><span class="p">(</span><span class="n">r_min</span><span class="o">=</span><span class="mf">0.0</span><span class="p">,</span> <span class="n">r_max</span><span class="o">=</span><span class="n">radius</span><span class="p">,</span>
+                        <span class="n">phi_min</span><span class="o">=</span><span class="n">phimin</span> <span class="o">+</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="p">,</span>
+                        <span class="n">phi_max</span><span class="o">=</span><span class="n">phimax</span> <span class="o">+</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="p">,</span> <span class="n">nbins</span><span class="o">=</span><span class="n">nbins</span><span class="p">)</span>
+     
+        <span class="n">sector</span> <span class="o">=</span> <span class="n">sect</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="p">)</span>
+        <span class="c">##Create 1D data resulting from average</span>
+       
+        <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">sector</span><span class="p">,</span> <span class="s">&quot;dxl&quot;</span><span class="p">):</span>
+            <span class="n">dxl</span> <span class="o">=</span> <span class="n">sector</span><span class="o">.</span><span class="n">dxl</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="n">dxl</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">sector</span><span class="p">,</span> <span class="s">&quot;dxw&quot;</span><span class="p">):</span>
+            <span class="n">dxw</span> <span class="o">=</span> <span class="n">sector</span><span class="o">.</span><span class="n">dxw</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="n">dxw</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="n">new_plot</span> <span class="o">=</span> <span class="n">Data1D</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="n">sector</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="n">sector</span><span class="o">.</span><span class="n">y</span><span class="p">,</span> <span class="n">dy</span><span class="o">=</span><span class="n">sector</span><span class="o">.</span><span class="n">dy</span><span class="p">,</span> <span class="n">dx</span><span class="o">=</span><span class="n">sector</span><span class="o">.</span><span class="n">dx</span><span class="p">)</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">dxl</span> <span class="o">=</span> <span class="n">dxl</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">dxw</span> <span class="o">=</span> <span class="n">dxw</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="s">&quot;SectorQ&quot;</span> <span class="o">+</span> <span class="s">&quot;(&quot;</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">name</span> <span class="o">+</span> <span class="s">&quot;)&quot;</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">source</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">source</span>
+        <span class="c">#new_plot.info=self.base.data2D.info</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">interactive</span> <span class="o">=</span> <span class="bp">True</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">detector</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">detector</span>
+        <span class="c">## If the data file does not tell us what the axes are, just assume...</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">xaxis</span><span class="p">(</span><span class="s">&quot;</span><span class="se">\\</span><span class="s">rm{Q}&quot;</span><span class="p">,</span> <span class="s">&quot;A^{-1}&quot;</span><span class="p">)</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">yaxis</span><span class="p">(</span><span class="s">&quot;</span><span class="se">\\</span><span class="s">rm{Intensity}&quot;</span><span class="p">,</span> <span class="s">&quot;cm^{-1}&quot;</span><span class="p">)</span>
+        <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="s">&quot;scale&quot;</span><span class="p">)</span> <span class="ow">and</span> <span class="n">data</span><span class="o">.</span><span class="n">scale</span> <span class="o">==</span> <span class="s">&#39;linear&#39;</span> <span class="ow">and</span> \
+                <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">name</span><span class="o">.</span><span class="n">count</span><span class="p">(</span><span class="s">&quot;Residuals&quot;</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
+            <span class="n">new_plot</span><span class="o">.</span><span class="n">ytransform</span> <span class="o">=</span> <span class="s">&#39;y&#39;</span>
+            <span class="n">new_plot</span><span class="o">.</span><span class="n">yaxis</span><span class="p">(</span><span class="s">&quot;</span><span class="se">\\</span><span class="s">rm{Residuals} &quot;</span><span class="p">,</span> <span class="s">&quot;/&quot;</span><span class="p">)</span>
+
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">group_id</span> <span class="o">=</span> <span class="s">&quot;2daverage&quot;</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">name</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">id</span> <span class="o">=</span> <span class="s">&quot;SectorQ&quot;</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">name</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">is_data</span> <span class="o">=</span> <span class="bp">True</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">update_theory</span><span class="p">(</span><span class="n">data_id</span><span class="o">=</span><span class="n">data</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> \
+                                       <span class="n">theory</span><span class="o">=</span><span class="n">new_plot</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> <span class="n">NewPlotEvent</span><span class="p">(</span><span class="n">plot</span><span class="o">=</span><span class="n">new_plot</span><span class="p">,</span>
+                                    <span class="n">title</span><span class="o">=</span><span class="s">&quot;SectorQ&quot;</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">name</span><span class="p">))</span>
+        
+    <span class="k">def</span> <span class="nf">moveend</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+<div class="viewcode-block" id="SectorInteractor.moveend"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.SectorInteractor.moveend">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Called a dragging motion ends.Get slicer event </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">thaw_axes</span><span class="p">()</span>
+        <span class="c">## Post parameters</span>
+        <span class="n">event</span> <span class="o">=</span> <span class="n">SlicerParameterEvent</span><span class="p">()</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">type</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">__class__</span><span class="o">.</span><span class="n">__name__</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">params</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_params</span><span class="p">()</span>
+        <span class="c">## Send slicer paramers to plotter2D</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="p">,</span> <span class="n">event</span><span class="p">)</span>
+        
+    <span class="k">def</span> <span class="nf">restore</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></div>
+<div class="viewcode-block" id="SectorInteractor.restore"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.SectorInteractor.restore">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Restore the roughness for this layer.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="o">.</span><span class="n">restore</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">restore</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">right_line</span><span class="o">.</span><span class="n">restore</span><span class="p">()</span>
+
+    <span class="k">def</span> <span class="nf">move</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span></div>
+<div class="viewcode-block" id="SectorInteractor.move"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.SectorInteractor.move">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Process move to a new position, making sure that the move is allowed.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">pass</span>
+        
+    <span class="k">def</span> <span class="nf">set_cursor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">):</span></div>
+<div class="viewcode-block" id="SectorInteractor.set_cursor"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.SectorInteractor.set_cursor">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">pass</span>
+        
+    <span class="k">def</span> <span class="nf">get_params</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></div>
+<div class="viewcode-block" id="SectorInteractor.get_params"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.SectorInteractor.get_params">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Store a copy of values of parameters of the slicer into a dictionary.</span>
+<span class="sd">        </span>
+<span class="sd">        :return params: the dictionary created</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">params</span> <span class="o">=</span> <span class="p">{}</span>
+        <span class="c">## Always make sure that the left and the right line are at phi </span>
+        <span class="c">## angle of the middle line</span>
+        <span class="k">if</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">phi</span><span class="p">)</span> <span class="o">!=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">right_line</span><span class="o">.</span><span class="n">phi</span><span class="p">):</span>
+            <span class="n">msg</span> <span class="o">=</span> <span class="s">&quot;Phi left and phi right are different&quot;</span>
+            <span class="n">msg</span> <span class="o">+=</span> <span class="s">&quot; </span><span class="si">%f</span><span class="s">, </span><span class="si">%f</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">phi</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">right_line</span><span class="o">.</span><span class="n">phi</span><span class="p">)</span>
+            <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">,</span> <span class="n">msg</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;Phi [deg]&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="o">.</span><span class="n">theta</span> <span class="o">*</span> <span class="mi">180</span><span class="o">/</span><span class="n">math</span><span class="o">.</span><span class="n">pi</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;Delta_Phi [deg]&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">phi</span> <span class="o">*</span> <span class="mi">180</span><span class="o">/</span><span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="p">)</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;nbins&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">nbins</span>
+        <span class="k">return</span> <span class="n">params</span>
+    
+    <span class="k">def</span> <span class="nf">set_params</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">params</span><span class="p">):</span></div>
+<div class="viewcode-block" id="SectorInteractor.set_params"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.SectorInteractor.set_params">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Receive a dictionary and reset the slicer with values contained </span>
+<span class="sd">        in the values of the dictionary.</span>
+<span class="sd">        </span>
+<span class="sd">        :param params: a dictionary containing name of slicer parameters and </span>
+<span class="sd">            values the user assigned to the slicer.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">main</span> <span class="o">=</span> <span class="n">params</span><span class="p">[</span><span class="s">&quot;Phi [deg]&quot;</span><span class="p">]</span>  <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="o">/</span><span class="mi">180</span>
+        <span class="n">phi</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="n">params</span><span class="p">[</span><span class="s">&quot;Delta_Phi [deg]&quot;</span><span class="p">]</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="o">/</span><span class="mi">180</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">nbins</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">params</span><span class="p">[</span><span class="s">&quot;nbins&quot;</span><span class="p">])</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="o">.</span><span class="n">theta</span> <span class="o">=</span> <span class="n">main</span>
+        <span class="c">## Reset the slicer parameters</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">right_line</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">phi</span><span class="o">=</span><span class="n">phi</span><span class="p">,</span> <span class="n">delta</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">mline</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="p">,</span>
+                               <span class="n">side</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="n">right</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">phi</span><span class="o">=</span><span class="n">phi</span><span class="p">,</span> <span class="n">delta</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> 
+                              <span class="n">mline</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="p">,</span> <span class="n">side</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
+        <span class="c">## post the new corresponding data</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_post_data</span><span class="p">(</span><span class="n">nbins</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">nbins</span><span class="p">)</span>
+        
+    <span class="k">def</span> <span class="nf">freeze_axes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></div>
+<div class="viewcode-block" id="SectorInteractor.freeze_axes"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.SectorInteractor.freeze_axes">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">freeze_axes</span><span class="p">()</span>
+    
+    <span class="k">def</span> <span class="nf">thaw_axes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></div>
+<div class="viewcode-block" id="SectorInteractor.thaw_axes"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.SectorInteractor.thaw_axes">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">thaw_axes</span><span class="p">()</span>
+
+    <span class="k">def</span> <span class="nf">draw</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></div>
+<div class="viewcode-block" id="SectorInteractor.draw"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.SectorInteractor.draw">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">draw</span><span class="p">()</span>
+
+        
+<span class="k">class</span> <span class="nc">SideInteractor</span><span class="p">(</span><span class="n">_BaseInteractor</span><span class="p">):</span></div></div>
+<div class="viewcode-block" id="SideInteractor"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.SideInteractor">[docs]</a>    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Draw an oblique line</span>
+<span class="sd">    </span>
+<span class="sd">    :param phi: the phase between the middle line and one side line</span>
+<span class="sd">    :param theta2: the angle between the middle line and x- axis</span>
+<span class="sd">    </span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s">&#39;black&#39;</span><span class="p">,</span> <span class="n">zorder</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">r</span><span class="o">=</span><span class="mf">1.0</span><span class="p">,</span>
+                 <span class="n">phi</span><span class="o">=</span><span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="o">/</span><span class="mi">4</span><span class="p">,</span> <span class="n">theta2</span><span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="o">/</span><span class="mi">3</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">_BaseInteractor</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="n">color</span><span class="p">)</span>
+        <span class="c">## Initialize the class</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">markers</span> <span class="o">=</span> <span class="p">[]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">axes</span> <span class="o">=</span> <span class="n">axes</span>
+        <span class="c">## compute the value of the angle between the current line and</span>
+        <span class="c">## the x-axis  </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_theta</span> <span class="o">=</span> <span class="n">theta2</span> <span class="o">+</span> <span class="n">phi</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">theta</span> <span class="o">=</span> <span class="n">theta2</span> <span class="o">+</span> <span class="n">phi</span>
+        <span class="c">## the value of the middle line angle with respect to the x-axis</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">theta2</span> <span class="o">=</span> <span class="n">theta2</span>
+        <span class="c">## Radius to find polar coordinates this line&#39;s endpoints</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">radius</span> <span class="o">=</span> <span class="n">r</span>
+        <span class="c">## phi is the phase between the current line and the middle line</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">phi</span> <span class="o">=</span> <span class="n">phi</span>
+        <span class="c">## End points polar coordinates</span>
+        <span class="n">x1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">radius</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">cos</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">theta</span><span class="p">)</span>
+        <span class="n">y1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">radius</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">sin</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">theta</span><span class="p">)</span>
+        <span class="n">x2</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">radius</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">cos</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">theta</span><span class="p">)</span>
+        <span class="n">y2</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">radius</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">sin</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">theta</span><span class="p">)</span>
+        <span class="c">## defining a new marker </span>
+        <span class="k">try</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">inner_marker</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">plot</span><span class="p">([</span><span class="n">x1</span><span class="o">/</span><span class="mf">2.5</span><span class="p">],</span> <span class="p">[</span><span class="n">y1</span><span class="o">/</span><span class="mf">2.5</span><span class="p">],</span> <span class="n">linestyle</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">,</span>
+                                          <span class="n">marker</span><span class="o">=</span><span class="s">&#39;s&#39;</span><span class="p">,</span> <span class="n">markersize</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span>
+                                          <span class="n">color</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">color</span><span class="p">,</span> <span class="n">alpha</span><span class="o">=</span><span class="mf">0.6</span><span class="p">,</span>
+                                          <span class="n">pickradius</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s">&quot;pick&quot;</span><span class="p">,</span> 
+                                          <span class="c"># Prefer this to other lines</span>
+                                          <span class="n">zorder</span><span class="o">=</span><span class="n">zorder</span><span class="p">,</span> <span class="n">visible</span><span class="o">=</span><span class="bp">True</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+        <span class="k">except</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">inner_marker</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">plot</span><span class="p">([</span><span class="n">x1</span><span class="o">/</span><span class="mf">2.5</span><span class="p">],[</span><span class="n">y1</span><span class="o">/</span><span class="mf">2.5</span><span class="p">],</span> <span class="n">linestyle</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">,</span>
+                                          <span class="n">marker</span><span class="o">=</span><span class="s">&#39;s&#39;</span><span class="p">,</span> <span class="n">markersize</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span>
+                                          <span class="n">color</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">color</span><span class="p">,</span> <span class="n">alpha</span><span class="o">=</span><span class="mf">0.6</span><span class="p">,</span>
+                                          <span class="n">label</span><span class="o">=</span><span class="s">&quot;pick&quot;</span><span class="p">,</span> <span class="n">visible</span><span class="o">=</span><span class="bp">True</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+            <span class="n">message</span>  <span class="o">=</span> <span class="s">&quot;</span><span class="se">\n</span><span class="s">THIS PROTOTYPE NEEDS THE LATEST&quot;</span>
+            <span class="n">message</span> <span class="o">+=</span> <span class="s">&quot; VERSION OF MATPLOTLIB</span><span class="se">\n</span><span class="s"> Get the SVN version that&quot;</span>
+            <span class="n">message</span> <span class="o">+=</span> <span class="s">&quot; is at least as recent as June 1, 2007&quot;</span>
+            <span class="n">owner</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">parent</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="n">owner</span><span class="p">,</span> 
+                         <span class="n">StatusEvent</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="s">&quot;sectorSlicer: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">message</span><span class="p">))</span>
+        
+        <span class="c">## Defining the current line</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">line</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">plot</span><span class="p">([</span><span class="n">x1</span><span class="p">,</span> <span class="n">x2</span><span class="p">],</span> <span class="p">[</span><span class="n">y1</span><span class="p">,</span> <span class="n">y2</span><span class="p">],</span>
+                                      <span class="n">linestyle</span><span class="o">=</span><span class="s">&#39;-&#39;</span><span class="p">,</span> <span class="n">marker</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">,</span>
+                                      <span class="n">color</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">color</span><span class="p">,</span> <span class="n">visible</span><span class="o">=</span><span class="bp">True</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+        <span class="c">## Flag to differentiate the left line from the right line motion</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">left_moving</span> <span class="o">=</span> <span class="bp">False</span>
+        <span class="c">## Flag to define a motion</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">has_move</span> <span class="o">=</span> <span class="bp">False</span>
+        <span class="c">## connecting markers and draw the picture</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">connect_markers</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">inner_marker</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">line</span><span class="p">])</span>
+       
+    <span class="k">def</span> <span class="nf">set_layer</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">n</span><span class="p">):</span>
+<div class="viewcode-block" id="SideInteractor.set_layer"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.SideInteractor.set_layer">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Allow adding plot to the same panel</span>
+<span class="sd">         </span>
+<span class="sd">        :param n: the number of layer</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">layernum</span> <span class="o">=</span> <span class="n">n</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        
+    <span class="k">def</span> <span class="nf">clear</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></div>
+<div class="viewcode-block" id="SideInteractor.clear"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.SideInteractor.clear">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Clear the slicer and all connected events related to this slicer</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">clear_markers</span><span class="p">()</span>
+        <span class="k">try</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">line</span><span class="o">.</span><span class="n">remove</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">inner_marker</span><span class="o">.</span><span class="n">remove</span><span class="p">()</span>
+        <span class="k">except</span><span class="p">:</span>
+            <span class="c"># Old version of matplotlib</span>
+            <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">lines</span><span class="p">)):</span>
+                <span class="k">del</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">lines</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
+    
+    <span class="k">def</span> <span class="nf">update</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">phi</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">delta</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">mline</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span></div>
+<div class="viewcode-block" id="SideInteractor.update"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.SideInteractor.update">[docs]</a>               <span class="n">side</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">left</span><span class="o">=</span> <span class="bp">False</span><span class="p">,</span> <span class="n">right</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Draw oblique line</span>
+<span class="sd">        </span>
+<span class="sd">        :param phi: the phase between the middle line and the current line</span>
+<span class="sd">        :param delta: phi/2 applied only when the mline was moved</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c">#print &quot;update left or right &quot;, self.has_move</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">left_moving</span> <span class="o">=</span> <span class="n">left</span>
+        <span class="n">theta3</span> <span class="o">=</span> <span class="mi">0</span>
+        <span class="k">if</span> <span class="n">phi</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">phi</span> <span class="o">=</span> <span class="n">phi</span>
+        <span class="k">if</span> <span class="n">delta</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="n">delta</span> <span class="o">=</span> <span class="mi">0</span>
+        <span class="k">if</span>  <span class="n">right</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">phi</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">phi</span><span class="p">)</span>
+            <span class="c">#delta=-delta</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">phi</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">phi</span><span class="p">)</span>
+        <span class="k">if</span> <span class="n">side</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">theta</span> <span class="o">=</span> <span class="n">mline</span><span class="o">.</span><span class="n">theta</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">phi</span>
+                    
+        <span class="k">if</span> <span class="n">mline</span> <span class="o">!=</span> <span class="bp">None</span> <span class="p">:</span>
+            <span class="k">if</span> <span class="n">delta</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">:</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">theta2</span> <span class="o">=</span> <span class="n">mline</span> <span class="o">+</span> <span class="n">delta</span>
+            <span class="k">else</span><span class="p">:</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">theta2</span> <span class="o">=</span> <span class="n">mline</span><span class="o">.</span><span class="n">theta</span>
+        <span class="k">if</span> <span class="n">delta</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
+            <span class="n">theta3</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta</span> <span class="o">+</span> <span class="n">delta</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="n">theta3</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta2</span> <span class="o">+</span> <span class="n">delta</span>
+        <span class="n">x1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">radius</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">cos</span><span class="p">(</span><span class="n">theta3</span><span class="p">)</span>
+        <span class="n">y1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">radius</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">sin</span><span class="p">(</span><span class="n">theta3</span><span class="p">)</span>
+        <span class="n">x2</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">radius</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">cos</span><span class="p">(</span><span class="n">theta3</span><span class="p">)</span>
+        <span class="n">y2</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">radius</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">sin</span><span class="p">(</span><span class="n">theta3</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">inner_marker</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">xdata</span><span class="o">=</span><span class="p">[</span><span class="n">x1</span><span class="o">/</span><span class="mf">2.5</span><span class="p">],</span> <span class="n">ydata</span><span class="o">=</span><span class="p">[</span><span class="n">y1</span><span class="o">/</span><span class="mf">2.5</span><span class="p">])</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">line</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">xdata</span><span class="o">=</span><span class="p">[</span><span class="n">x1</span><span class="p">,</span> <span class="n">x2</span><span class="p">],</span> <span class="n">ydata</span><span class="o">=</span><span class="p">[</span><span class="n">y1</span><span class="p">,</span> <span class="n">y2</span><span class="p">])</span>  
+        
+    <span class="k">def</span> <span class="nf">save</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span></div>
+<div class="viewcode-block" id="SideInteractor.save"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.SideInteractor.save">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Remember the roughness for this layer and the next so that we</span>
+<span class="sd">        can restore on Esc.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_theta</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">freeze_axes</span><span class="p">()</span>
+
+    <span class="k">def</span> <span class="nf">moveend</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span></div>
+<div class="viewcode-block" id="SideInteractor.moveend"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.SideInteractor.moveend">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">has_move</span> <span class="o">=</span> <span class="bp">False</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">moveend</span><span class="p">(</span><span class="n">ev</span><span class="p">)</span>
+            
+    <span class="k">def</span> <span class="nf">restore</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></div>
+<div class="viewcode-block" id="SideInteractor.restore"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.SideInteractor.restore">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Restore the roughness for this layer.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">theta</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">save_theta</span>
+
+    <span class="k">def</span> <span class="nf">move</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span></div>
+<div class="viewcode-block" id="SideInteractor.move"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.SideInteractor.move">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Process move to a new position, making sure that the move is allowed.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">theta</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">atan2</span><span class="p">(</span><span class="n">y</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">has_move</span> <span class="o">=</span> <span class="bp">True</span>
+        <span class="c">#ToDo: Simplify below</span>
+        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">left_moving</span><span class="p">:</span>
+            <span class="k">if</span>  <span class="bp">self</span><span class="o">.</span><span class="n">theta2</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta</span> <span class="o">&lt;=</span> <span class="mi">0</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta2</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">restore</span><span class="p">()</span>
+                <span class="k">return</span> 
+            <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta2</span> <span class="o">&lt;</span> <span class="mi">0</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta</span> <span class="o">&lt;</span> <span class="mi">0</span> <span class="ow">and</span> \
+                <span class="bp">self</span><span class="o">.</span><span class="n">theta</span><span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">theta2</span> <span class="o">&gt;=</span> <span class="mi">0</span><span class="p">:</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">restore</span><span class="p">()</span>
+                <span class="k">return</span>                             
+            <span class="k">elif</span>  <span class="bp">self</span><span class="o">.</span><span class="n">theta2</span> <span class="o">&lt;</span> <span class="mi">0</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta</span> <span class="o">&gt;</span> <span class="mi">0</span> <span class="ow">and</span> \
+                <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">theta2</span> <span class="o">+</span> <span class="mi">2</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta</span><span class="p">)</span> <span class="o">&gt;=</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="o">/</span><span class="mi">2</span><span class="p">:</span>
+                <span class="c">#print &quot;my theta&quot;, self.theta</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">restore</span><span class="p">()</span>
+                <span class="k">return</span> 
+            <span class="k">elif</span>  <span class="bp">self</span><span class="o">.</span><span class="n">theta2</span> <span class="o">&lt;</span> <span class="mi">0</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta</span> <span class="o">&lt;</span> <span class="mi">0</span> <span class="ow">and</span> \
+                <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">theta2</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta</span><span class="p">)</span> <span class="o">&gt;=</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="o">/</span><span class="mi">2</span><span class="p">:</span>
+                <span class="c">#print &quot;my theta&quot;, self.theta</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">restore</span><span class="p">()</span>
+                <span class="k">return</span> 
+            <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta2</span> <span class="o">&gt;</span> <span class="mi">0</span> <span class="ow">and</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">theta2</span><span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">theta</span> <span class="o">&gt;=</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="o">/</span><span class="mi">2</span> <span class="ow">or</span> \
+                <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">theta2</span><span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">theta</span> <span class="o">&gt;=</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="o">/</span><span class="mi">2</span><span class="p">)):</span>
+                <span class="c">#print &quot;self theta encore&quot;</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">restore</span><span class="p">()</span>
+                <span class="k">return</span> 
+        <span class="k">else</span><span class="p">:</span>
+            <span class="c">#print &quot;left move&quot;</span>
+            <span class="k">if</span>  <span class="bp">self</span><span class="o">.</span><span class="n">theta</span> <span class="o">&lt;</span> <span class="mi">0</span> <span class="ow">and</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">theta</span> <span class="o">+</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="o">*</span><span class="mi">2</span><span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">theta2</span><span class="p">)</span> <span class="o">&lt;=</span> <span class="mi">0</span><span class="p">:</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">restore</span><span class="p">()</span>
+                <span class="k">return</span> 
+            <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta2</span> <span class="o">&lt;</span> <span class="mi">0</span> <span class="ow">and</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">theta</span><span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">theta2</span><span class="p">)</span> <span class="o">&lt;=</span> <span class="mi">0</span><span class="p">:</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">restore</span><span class="p">()</span>
+                <span class="k">return</span>                             
+            <span class="k">elif</span>  <span class="bp">self</span><span class="o">.</span><span class="n">theta</span> <span class="o">&gt;</span> <span class="mi">0</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta</span><span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">theta2</span> <span class="o">&lt;=</span> <span class="mi">0</span><span class="p">:</span>
+                <span class="c">#print &quot;my theta&quot;, self.theta</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">restore</span><span class="p">()</span>
+                <span class="k">return</span> 
+            <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta</span><span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">theta2</span> <span class="o">&gt;=</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="o">/</span><span class="mi">2</span> <span class="ow">or</span>  \
+                <span class="p">((</span><span class="bp">self</span><span class="o">.</span><span class="n">theta</span> <span class="o">+</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span> <span class="o">*</span> <span class="mi">2</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta2</span><span class="p">)</span> <span class="o">&gt;=</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="o">/</span><span class="mi">2</span> <span class="ow">and</span> \
+                 <span class="bp">self</span><span class="o">.</span><span class="n">theta</span> <span class="o">&lt;</span> <span class="mi">0</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta2</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">):</span>
+                <span class="c">#print &quot;self theta encore&quot;</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">restore</span><span class="p">()</span>
+                <span class="k">return</span> 
+            
+        <span class="bp">self</span><span class="o">.</span><span class="n">phi</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">theta2</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta</span><span class="p">)</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">phi</span> <span class="o">&gt;</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">phi</span> <span class="o">=</span> <span class="mi">2</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span> <span class="o">-</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">theta2</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        
+    <span class="k">def</span> <span class="nf">set_cursor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">):</span></div>
+<div class="viewcode-block" id="SideInteractor.set_cursor"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.SideInteractor.set_cursor">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">move</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="bp">None</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+    
+    <span class="k">def</span> <span class="nf">get_params</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></div>
+<div class="viewcode-block" id="SideInteractor.get_params"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.SideInteractor.get_params">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">params</span> <span class="o">=</span> <span class="p">{}</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;radius&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">radius</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;theta&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta</span>
+        <span class="k">return</span> <span class="n">params</span>
+    
+    <span class="k">def</span> <span class="nf">set_params</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">params</span><span class="p">):</span></div>
+<div class="viewcode-block" id="SideInteractor.set_params"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.SideInteractor.set_params">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">x</span> <span class="o">=</span> <span class="n">params</span><span class="p">[</span><span class="s">&quot;radius&quot;</span><span class="p">]</span> 
+        <span class="bp">self</span><span class="o">.</span><span class="n">set_cursor</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="bp">None</span><span class="p">)</span>
+        
+
+<span class="k">class</span> <span class="nc">LineInteractor</span><span class="p">(</span><span class="n">_BaseInteractor</span><span class="p">):</span></div></div>
+<div class="viewcode-block" id="LineInteractor"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.LineInteractor">[docs]</a>    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Select an annulus through a 2D plot</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s">&#39;black&#39;</span><span class="p">,</span>
+                 <span class="n">zorder</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">r</span><span class="o">=</span><span class="mf">1.0</span><span class="p">,</span> <span class="n">theta</span><span class="o">=</span><span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="o">/</span><span class="mi">4</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">_BaseInteractor</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="n">color</span><span class="p">)</span>
+        
+        <span class="bp">self</span><span class="o">.</span><span class="n">markers</span> <span class="o">=</span> <span class="p">[]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">axes</span> <span class="o">=</span> <span class="n">axes</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_theta</span> <span class="o">=</span> <span class="n">theta</span> 
+        <span class="bp">self</span><span class="o">.</span><span class="n">theta</span><span class="o">=</span> <span class="n">theta</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">radius</span> <span class="o">=</span> <span class="n">r</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">scale</span> <span class="o">=</span> <span class="mf">10.0</span>
+        <span class="c"># Inner circle</span>
+        <span class="n">x1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">radius</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">cos</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">theta</span><span class="p">)</span>
+        <span class="n">y1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">radius</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">sin</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">theta</span><span class="p">)</span>
+        <span class="n">x2</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span><span class="o">*</span><span class="bp">self</span><span class="o">.</span><span class="n">radius</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">cos</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">theta</span><span class="p">)</span>
+        <span class="n">y2</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span><span class="o">*</span><span class="bp">self</span><span class="o">.</span><span class="n">radius</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">sin</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">theta</span><span class="p">)</span>
+        <span class="k">try</span><span class="p">:</span>
+            <span class="c"># Inner circle marker</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">inner_marker</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">plot</span><span class="p">([</span><span class="n">x1</span><span class="o">/</span><span class="mf">2.5</span><span class="p">],</span> <span class="p">[</span><span class="n">y1</span><span class="o">/</span><span class="mf">2.5</span><span class="p">],</span> <span class="n">linestyle</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">,</span>
+                                          <span class="n">marker</span><span class="o">=</span><span class="s">&#39;s&#39;</span><span class="p">,</span> <span class="n">markersize</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span>
+                                          <span class="n">color</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">color</span><span class="p">,</span> <span class="n">alpha</span><span class="o">=</span><span class="mf">0.6</span><span class="p">,</span>
+                                          <span class="n">pickradius</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s">&quot;pick&quot;</span><span class="p">,</span> 
+                                          <span class="c"># Prefer this to other lines</span>
+                                          <span class="n">zorder</span><span class="o">=</span><span class="n">zorder</span><span class="p">,</span> 
+                                          <span class="n">visible</span><span class="o">=</span><span class="bp">True</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+        <span class="k">except</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">inner_marker</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">plot</span><span class="p">([</span><span class="n">x1</span><span class="o">/</span><span class="mf">2.5</span><span class="p">],</span> <span class="p">[</span><span class="n">y1</span><span class="o">/</span><span class="mf">2.5</span><span class="p">],</span> <span class="n">linestyle</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">,</span>
+                                          <span class="n">marker</span><span class="o">=</span><span class="s">&#39;s&#39;</span><span class="p">,</span> <span class="n">markersize</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span>
+                                          <span class="n">color</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">color</span><span class="p">,</span> <span class="n">alpha</span><span class="o">=</span><span class="mf">0.6</span><span class="p">,</span>
+                                          <span class="n">label</span><span class="o">=</span><span class="s">&quot;pick&quot;</span><span class="p">,</span> 
+                                          <span class="n">visible</span><span class="o">=</span><span class="bp">True</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+            <span class="n">message</span>  <span class="o">=</span> <span class="s">&quot;</span><span class="se">\n</span><span class="s">THIS PROTOTYPE NEEDS THE LATEST VERSION&quot;</span>
+            <span class="n">message</span> <span class="o">+=</span> <span class="s">&quot; OF MATPLOTLIB</span><span class="se">\n</span><span class="s"> Get the SVN version that is at&quot;</span>
+            <span class="n">message</span> <span class="o">+=</span> <span class="s">&quot; least as recent as June 1, 2007&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">line</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">plot</span><span class="p">([</span><span class="n">x1</span><span class="p">,</span> <span class="n">x2</span><span class="p">],</span> <span class="p">[</span><span class="n">y1</span><span class="p">,</span> <span class="n">y2</span><span class="p">],</span>
+                                      <span class="n">linestyle</span><span class="o">=</span><span class="s">&#39;-&#39;</span><span class="p">,</span> <span class="n">marker</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">,</span>
+                                      <span class="n">color</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">color</span><span class="p">,</span> <span class="n">visible</span><span class="o">=</span><span class="bp">True</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">npts</span> <span class="o">=</span> <span class="mi">20</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">has_move</span> <span class="o">=</span> <span class="bp">False</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">connect_markers</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">inner_marker</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">line</span><span class="p">])</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+
+    <span class="k">def</span> <span class="nf">set_layer</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">n</span><span class="p">):</span>
+<div class="viewcode-block" id="LineInteractor.set_layer"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.LineInteractor.set_layer">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">layernum</span> <span class="o">=</span> <span class="n">n</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        
+    <span class="k">def</span> <span class="nf">clear</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></div>
+<div class="viewcode-block" id="LineInteractor.clear"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.LineInteractor.clear">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">clear_markers</span><span class="p">()</span>
+        <span class="k">try</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">inner_marker</span><span class="o">.</span><span class="n">remove</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">line</span><span class="o">.</span><span class="n">remove</span><span class="p">()</span>
+        <span class="k">except</span><span class="p">:</span>
+            <span class="c"># Old version of matplotlib</span>
+            <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">lines</span><span class="p">)):</span>
+                <span class="k">del</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">lines</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
+  
+    <span class="k">def</span> <span class="nf">update</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">theta</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span></div>
+<div class="viewcode-block" id="LineInteractor.update"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.LineInteractor.update">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Draw the new roughness on the graph.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+       
+        <span class="k">if</span> <span class="n">theta</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">theta</span> <span class="o">=</span> <span class="n">theta</span>
+        <span class="n">x1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">radius</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">cos</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">theta</span><span class="p">)</span>
+        <span class="n">y1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">radius</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">sin</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">theta</span><span class="p">)</span>
+        <span class="n">x2</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">radius</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">cos</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">theta</span><span class="p">)</span>
+        <span class="n">y2</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">radius</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">sin</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">theta</span><span class="p">)</span>
+        
+        <span class="bp">self</span><span class="o">.</span><span class="n">inner_marker</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">xdata</span><span class="o">=</span><span class="p">[</span><span class="n">x1</span><span class="o">/</span><span class="mf">2.5</span><span class="p">],</span> <span class="n">ydata</span><span class="o">=</span><span class="p">[</span><span class="n">y1</span><span class="o">/</span><span class="mf">2.5</span><span class="p">])</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">line</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">xdata</span><span class="o">=</span><span class="p">[</span><span class="n">x1</span><span class="p">,</span> <span class="n">x2</span><span class="p">],</span> <span class="n">ydata</span><span class="o">=</span><span class="p">[</span><span class="n">y1</span><span class="p">,</span> <span class="n">y2</span><span class="p">])</span>  
+    
+    <span class="k">def</span> <span class="nf">save</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span></div>
+<div class="viewcode-block" id="LineInteractor.save"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.LineInteractor.save">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Remember the roughness for this layer and the next so that we</span>
+<span class="sd">        can restore on Esc.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_theta</span><span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">freeze_axes</span><span class="p">()</span>
+
+    <span class="k">def</span> <span class="nf">moveend</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span></div>
+<div class="viewcode-block" id="LineInteractor.moveend"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.LineInteractor.moveend">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">has_move</span> <span class="o">=</span> <span class="bp">False</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">moveend</span><span class="p">(</span><span class="n">ev</span><span class="p">)</span>
+            
+    <span class="k">def</span> <span class="nf">restore</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></div>
+<div class="viewcode-block" id="LineInteractor.restore"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.LineInteractor.restore">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Restore the roughness for this layer.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">theta</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">save_theta</span>
+
+    <span class="k">def</span> <span class="nf">move</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span></div>
+<div class="viewcode-block" id="LineInteractor.move"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.LineInteractor.move">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Process move to a new position, making sure that the move is allowed.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">theta</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">atan2</span><span class="p">(</span><span class="n">y</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">has_move</span> <span class="o">=</span> <span class="bp">True</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        
+    <span class="k">def</span> <span class="nf">set_cursor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">):</span></div>
+<div class="viewcode-block" id="LineInteractor.set_cursor"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.LineInteractor.set_cursor">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">move</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="bp">None</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        
+    <span class="k">def</span> <span class="nf">get_params</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></div>
+<div class="viewcode-block" id="LineInteractor.get_params"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.LineInteractor.get_params">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">params</span> <span class="o">=</span> <span class="p">{}</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;radius&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">radius</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;theta&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">theta</span>
+        <span class="k">return</span> <span class="n">params</span>
+    
+    <span class="k">def</span> <span class="nf">set_params</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">params</span><span class="p">):</span></div>
+<div class="viewcode-block" id="LineInteractor.set_params"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SectorSlicer.LineInteractor.set_params">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">x</span> <span class="o">=</span> <span class="n">params</span><span class="p">[</span><span class="s">&quot;radius&quot;</span><span class="p">]</span> 
+        <span class="bp">self</span><span class="o">.</span><span class="n">set_cursor</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="bp">None</span><span class="p">)</span>
+        
+</pre></div></div></div>
+
+          </div>
+        </div>
+      </div>
+      <div class="sphinxsidebar">
+        <div class="sphinxsidebarwrapper">
+<div id="searchbox" style="display: none">
+  <h3>Quick search</h3>
+    <form class="search" action="../../../../../search.html" method="get">
+      <input type="text" name="q" />
+      <input type="submit" value="Go" />
+      <input type="hidden" name="check_keywords" value="yes" />
+      <input type="hidden" name="area" value="default" />
+    </form>
+    <p class="searchtip" style="font-size: 90%">
+    Enter search terms or a module, class or function name.
+    </p>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+        </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" >sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>
+    <div class="footer">
+        &copy; Copyright 2013, The SasView Project.
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
+    </div>
+  </body>
+</html>
Index: _modules/sas/guiframe/local_perspectives/plotting/SimplePlot.html
===================================================================
--- _modules/sas/guiframe/local_perspectives/plotting/SimplePlot.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
+++ _modules/sas/guiframe/local_perspectives/plotting/SimplePlot.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
@@ -0,0 +1,436 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>sas.guiframe.local_perspectives.plotting.SimplePlot &mdash; SasView 3.0.0 documentation</title>
+    
+    <link rel="stylesheet" href="../../../../../_static/default.css" type="text/css" />
+    <link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '../../../../../',
+        VERSION:     '3.0.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="../../../../../_static/jquery.js"></script>
+    <script type="text/javascript" src="../../../../../_static/underscore.js"></script>
+    <script type="text/javascript" src="../../../../../_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <link rel="top" title="SasView 3.0.0 documentation" href="../../../../../index.html" />
+    <link rel="up" title="sas.guiframe" href="../../../guiframe.html" /> 
+  </head>
+  <body>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" accesskey="U">sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>  
+
+    <div class="document">
+      <div class="documentwrapper">
+        <div class="bodywrapper">
+          <div class="body">
+            
+  <h1>Source code for sas.guiframe.local_perspectives.plotting.SimplePlot</h1><div class="highlight"><pre>
+<span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">Simple Plot Frame : supporting only copy, print, scale</span>
+<span class="sd">&quot;&quot;&quot;</span>
+<span class="kn">import</span> <span class="nn">wx</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.local_perspectives.plotting.Plotter2D</span> <span class="kn">import</span> <span class="n">ModelPanel2D</span> \
+                    <span class="k">as</span> <span class="n">PlotPanel</span>
+<span class="kn">from</span> <span class="nn">sas.plottools.toolbar</span> <span class="kn">import</span> <span class="n">NavigationToolBar</span>
+<span class="kn">from</span> <span class="nn">sas.plottools.plottables</span> <span class="kn">import</span> <span class="n">Graph</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.utils</span> <span class="kn">import</span> <span class="n">PanelMenu</span>
+
+<div class="viewcode-block" id="SimplePlotPanel"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SimplePlot.SimplePlotPanel">[docs]</a><span class="k">class</span> <span class="nc">SimplePlotPanel</span><span class="p">(</span><span class="n">PlotPanel</span><span class="p">):</span>   
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    PlotPanel for 1d and 2d</span>
+<span class="sd">    &quot;&quot;&quot;</span> 
+    <span class="n">_window_caption</span> <span class="o">=</span> <span class="s">&#39;Simple Plot&#39;</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="nb">id</span><span class="o">=-</span><span class="mi">1</span><span class="p">,</span> <span class="n">color</span> <span class="o">=</span> <span class="bp">None</span><span class="p">,</span>
+                 <span class="n">dpi</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">NO_FULL_REPAINT_ON_RESIZE</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Init</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">PlotPanel</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="nb">id</span><span class="o">=</span><span class="nb">id</span><span class="p">,</span> <span class="n">style</span><span class="o">=</span><span class="n">style</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
+
+        <span class="bp">self</span><span class="o">.</span><span class="n">SetColor</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">WHITE</span><span class="p">)</span>
+        
+        <span class="bp">self</span><span class="o">.</span><span class="n">toolbar</span> <span class="o">=</span> <span class="n">NavigationToolBar</span><span class="p">(</span><span class="n">parent</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> <span class="n">canvas</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">canvas</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">toolbar</span><span class="o">.</span><span class="n">Show</span><span class="p">(</span><span class="bp">False</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">scale</span> <span class="o">=</span> <span class="n">parent</span><span class="o">.</span><span class="n">scale</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">window_caption</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_window_caption</span>
+            
+<div class="viewcode-block" id="SimplePlotPanel.draw"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SimplePlot.SimplePlotPanel.draw">[docs]</a>    <span class="k">def</span> <span class="nf">draw</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">resizing</span> <span class="o">=</span> <span class="bp">False</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">set_resizing</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">resizing</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">draw</span><span class="p">()</span>
+        </div>
+<div class="viewcode-block" id="SimplePlotPanel.add_toolbar"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SimplePlot.SimplePlotPanel.add_toolbar">[docs]</a>    <span class="k">def</span> <span class="nf">add_toolbar</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">pass</span>   
+     </div>
+<div class="viewcode-block" id="SimplePlotPanel.onContextMenu"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SimplePlot.SimplePlotPanel.onContextMenu">[docs]</a>    <span class="k">def</span> <span class="nf">onContextMenu</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        2D plot context menu</span>
+<span class="sd">        </span>
+<span class="sd">        :param event: wx context event</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">slicerpop</span> <span class="o">=</span> <span class="n">PanelMenu</span><span class="p">()</span>
+        <span class="n">slicerpop</span><span class="o">.</span><span class="n">set_plots</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">)</span>
+        <span class="n">slicerpop</span><span class="o">.</span><span class="n">set_graph</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="p">)</span>
+             
+        <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+        <span class="n">slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Save Image&#39;</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onSaveImage</span><span class="p">)</span>
+        
+        <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+        <span class="n">slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span><span class="s">&#39;&amp;Print Image&#39;</span><span class="p">,</span> <span class="s">&#39;Print image&#39;</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onPrint</span><span class="p">)</span>
+        
+        <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+        <span class="n">slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span><span class="s">&#39;&amp;Print Preview&#39;</span><span class="p">,</span> <span class="s">&#39;Print preview&#39;</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onPrinterPreview</span><span class="p">)</span>
+
+        <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+        <span class="n">slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Copy to Clipboard&#39;</span><span class="p">,</span> <span class="s">&#39;Copy to the clipboard&#39;</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">OnCopyFigureMenu</span><span class="p">)</span>
+
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">dimension</span> <span class="o">!=</span> <span class="mi">3</span><span class="p">:</span>
+            <span class="n">slicerpop</span><span class="o">.</span><span class="n">AppendSeparator</span><span class="p">()</span>
+            <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+            <span class="n">slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Toggle Grid On/Off&#39;</span><span class="p">,</span> <span class="s">&#39;Toggle Grid On/Off&#39;</span><span class="p">)</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">on_grid_onoff</span><span class="p">)</span>
+
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">__class__</span><span class="o">.</span><span class="n">__name__</span> <span class="o">==</span> <span class="s">&#39;Data1D&#39;</span><span class="p">:</span>
+            <span class="n">slicerpop</span><span class="o">.</span><span class="n">AppendSeparator</span><span class="p">()</span>
+            <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+            <span class="n">slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Change Scale&#39;</span><span class="p">)</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_onProperties</span><span class="p">)</span>        
+        <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">__class__</span><span class="o">.</span><span class="n">__name__</span> <span class="o">==</span> <span class="s">&#39;Data2D&#39;</span><span class="p">:</span>
+            <span class="n">slicerpop</span><span class="o">.</span><span class="n">AppendSeparator</span><span class="p">()</span>
+            <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+            <span class="n">slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Toggle Linear/Log Scale&#39;</span><span class="p">)</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_onToggleScale</span><span class="p">)</span> 
+                
+        <span class="k">try</span><span class="p">:</span>
+            <span class="n">pos_evt</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">GetPosition</span><span class="p">()</span>
+            <span class="n">pos</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">ScreenToClient</span><span class="p">(</span><span class="n">pos_evt</span><span class="p">)</span>
+        <span class="k">except</span><span class="p">:</span>
+            <span class="n">pos_x</span><span class="p">,</span> <span class="n">pos_y</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">toolbar</span><span class="o">.</span><span class="n">GetPositionTuple</span><span class="p">()</span>
+            <span class="n">pos</span> <span class="o">=</span> <span class="p">(</span><span class="n">pos_x</span><span class="p">,</span> <span class="n">pos_y</span> <span class="o">+</span> <span class="mi">5</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">PopupMenu</span><span class="p">(</span><span class="n">slicerpop</span><span class="p">,</span> <span class="n">pos</span><span class="p">)</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">scale</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">scale2d</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">scale</span> 
+    </div>
+<div class="viewcode-block" id="SimplePlotPanel.on_grid_onoff"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SimplePlot.SimplePlotPanel.on_grid_onoff">[docs]</a>    <span class="k">def</span> <span class="nf">on_grid_onoff</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        On grid on/off</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">switch</span> <span class="o">=</span> <span class="p">(</span><span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_on</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">onGridOnOff</span><span class="p">(</span><span class="n">switch</span><span class="p">)</span> 
+                </div>
+<div class="viewcode-block" id="SimplePlotPanel.onLeftDown"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SimplePlot.SimplePlotPanel.onLeftDown">[docs]</a>    <span class="k">def</span> <span class="nf">onLeftDown</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        left button down and ready to drag</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># Check that the LEFT button was pressed</span>
+        <span class="k">if</span> <span class="n">event</span><span class="o">.</span><span class="n">button</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">leftdown</span> <span class="o">=</span> <span class="bp">True</span>
+            <span class="n">ax</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">inaxes</span>
+            <span class="k">if</span> <span class="n">ax</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">xInit</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">yInit</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">xdata</span><span class="p">,</span> <span class="n">event</span><span class="o">.</span><span class="n">ydata</span>
+                <span class="k">try</span><span class="p">:</span>
+                    <span class="n">pos_x</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">event</span><span class="o">.</span><span class="n">xdata</span><span class="p">)</span>  <span class="c"># / size_x</span>
+                    <span class="n">pos_y</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">event</span><span class="o">.</span><span class="n">ydata</span><span class="p">)</span>  <span class="c"># / size_y</span>
+                    <span class="n">pos_x</span> <span class="o">=</span> <span class="s">&quot;</span><span class="si">%8.3g</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">pos_x</span>
+                    <span class="n">pos_y</span> <span class="o">=</span> <span class="s">&quot;</span><span class="si">%8.3g</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">pos_y</span>
+                    <span class="bp">self</span><span class="o">.</span><span class="n">position</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">pos_x</span><span class="p">),</span> <span class="nb">str</span><span class="p">(</span><span class="n">pos_y</span><span class="p">)</span>
+                    <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> <span class="n">StatusEvent</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">position</span><span class="p">))</span>
+                <span class="k">except</span><span class="p">:</span>
+                    <span class="bp">self</span><span class="o">.</span><span class="n">position</span> <span class="o">=</span> <span class="bp">None</span>    
+             </div>
+    <span class="k">def</span> <span class="nf">_OnReSize</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>   
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        On response of the resize of a panel, set axes_visiable False</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">resizing</span> <span class="o">=</span> <span class="bp">False</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">x_size</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">x_size</span> <span class="o">==</span> <span class="bp">self</span><span class="o">.</span><span class="n">GetSize</span><span class="p">():</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">set_resizing</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">resizing</span><span class="p">)</span>
+                <span class="k">return</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">x_size</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">GetSize</span><span class="p">()</span>
+
+        <span class="c"># Ready for another event</span>
+        <span class="c"># Do not remove this Skip. </span>
+        <span class="c"># Otherwise it will get runtime error on wx&gt;=2.9.</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">Skip</span><span class="p">()</span> 
+        <span class="c"># set the resizing flag</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">set_resizing</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">resizing</span><span class="p">)</span>
+        <span class="n">pos_x</span><span class="p">,</span> <span class="n">pos_y</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">GetPositionTuple</span><span class="p">()</span>
+        <span class="k">if</span> <span class="n">pos_x</span> <span class="o">!=</span> <span class="mi">0</span> <span class="ow">and</span> <span class="n">pos_y</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">size</span><span class="p">,</span> <span class="n">_</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">GetClientSizeTuple</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">SetSizer</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">sizer</span><span class="p">)</span>
+        
+<div class="viewcode-block" id="SimplePlotPanel.on_set_focus"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SimplePlot.SimplePlotPanel.on_set_focus">[docs]</a>    <span class="k">def</span> <span class="nf">on_set_focus</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        By pass default boundary blue color drawing</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">pass</span>
+        </div>
+<div class="viewcode-block" id="SimplePlotPanel.on_kill_focus"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SimplePlot.SimplePlotPanel.on_kill_focus">[docs]</a>    <span class="k">def</span> <span class="nf">on_kill_focus</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Reset the panel color</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">pass</span>
+    </div>
+<div class="viewcode-block" id="SimplePlotPanel.show_plot"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SimplePlot.SimplePlotPanel.show_plot">[docs]</a>    <span class="k">def</span> <span class="nf">show_plot</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">plot</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Show the plot</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">_yaxis</span><span class="p">,</span> <span class="n">_yunit</span> <span class="o">=</span> <span class="n">plot</span><span class="o">.</span><span class="n">get_yaxis</span><span class="p">()</span>
+        <span class="n">_xaxis</span><span class="p">,</span> <span class="n">_xunit</span> <span class="o">=</span> <span class="n">plot</span><span class="o">.</span><span class="n">get_xaxis</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">data</span> <span class="o">=</span> <span class="n">plot</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">[</span><span class="n">plot</span><span class="o">.</span><span class="n">name</span><span class="p">]</span> <span class="o">=</span> <span class="n">plot</span>
+        <span class="c"># Axis scales</span>
+        <span class="k">if</span> <span class="n">plot</span><span class="o">.</span><span class="n">xtransform</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">xLabel</span> <span class="o">=</span> <span class="n">plot</span><span class="o">.</span><span class="n">xtransform</span>
+        <span class="k">if</span> <span class="n">plot</span><span class="o">.</span><span class="n">ytransform</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">yLabel</span> <span class="o">=</span> <span class="n">plot</span><span class="o">.</span><span class="n">ytransform</span>
+        <span class="c"># Init graph</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">graph</span> <span class="o">=</span> <span class="n">Graph</span><span class="p">()</span>
+        <span class="c"># Add plot: Handles both 1D and 2D</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">set_resizing</span><span class="p">(</span><span class="bp">False</span><span class="p">)</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">__class__</span><span class="o">.</span><span class="n">__name__</span> <span class="o">==</span> <span class="s">&#39;Data2D&#39;</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">data2D</span> <span class="o">=</span> <span class="n">plot</span>
+        <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">__class__</span><span class="o">.</span><span class="n">__name__</span> <span class="o">==</span> <span class="s">&#39;Data1D&#39;</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">_onEVT_FUNC_PROPERTY</span><span class="p">(</span><span class="n">show</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>
+        <span class="c"># Axes</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">xaxis</span><span class="p">(</span><span class="n">_xaxis</span><span class="p">,</span> <span class="n">_xunit</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">yaxis</span><span class="p">(</span><span class="n">_yaxis</span><span class="p">,</span> <span class="n">_yunit</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">xaxis</span><span class="p">(</span><span class="n">_xaxis</span><span class="p">,</span> <span class="n">_xunit</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">yaxis</span><span class="p">(</span><span class="n">_yaxis</span><span class="p">,</span> <span class="n">_yunit</span><span class="p">)</span> 
+        <span class="bp">self</span><span class="o">.</span><span class="n">set_xscale</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">xscale</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">set_yscale</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">yscale</span><span class="p">)</span>   
+        <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">render</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>    
+                  </div></div>
+<div class="viewcode-block" id="PlotFrame"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SimplePlot.PlotFrame">[docs]</a><span class="k">class</span> <span class="nc">PlotFrame</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">Frame</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Frame for simple plot</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">title</span><span class="p">,</span> <span class="n">scale</span><span class="o">=</span><span class="s">&#39;log_{10}&#39;</span><span class="p">,</span> 
+                 <span class="n">size</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">Size</span><span class="p">(</span><span class="mi">550</span><span class="p">,</span> <span class="mi">470</span><span class="p">)):</span> 
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        comment</span>
+<span class="sd">        :param parent: parent panel/container</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># Initialize the Frame object</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">Frame</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">title</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">DefaultPosition</span><span class="p">,</span> <span class="n">size</span><span class="p">)</span>
+        
+        <span class="c"># Panel for 1D plot</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="n">parent</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_mgr</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">menu_bar</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_default_save_location</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">scale</span> <span class="o">=</span> <span class="n">scale</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span> <span class="o">=</span> <span class="n">SimplePlotPanel</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_build_menubar</span><span class="p">()</span>
+
+    <span class="k">def</span> <span class="nf">_build_menubar</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Build menubar</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">tsize</span> <span class="o">=</span> <span class="p">(</span><span class="mi">13</span><span class="p">,</span> <span class="mi">13</span><span class="p">)</span>
+        <span class="n">save_bmp</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ArtProvider</span><span class="o">.</span><span class="n">GetBitmap</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">ART_FILE_SAVE_AS</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">ART_TOOLBAR</span><span class="p">,</span>
+                                            <span class="n">tsize</span><span class="p">)</span>
+        <span class="n">quit_bmp</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ArtProvider</span><span class="o">.</span><span class="n">GetBitmap</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">ART_QUIT</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">ART_TOOLBAR</span><span class="p">,</span> 
+                                           <span class="n">tsize</span><span class="p">)</span>
+        <span class="n">print_bmp</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ArtProvider</span><span class="o">.</span><span class="n">GetBitmap</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">ART_PRINT</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">ART_TOOLBAR</span><span class="p">,</span> 
+                                           <span class="n">tsize</span><span class="p">)</span>
+        <span class="n">preview_bmp</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ArtProvider</span><span class="o">.</span><span class="n">GetBitmap</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">ART_REPORT_VIEW</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">ART_TOOLBAR</span><span class="p">,</span> 
+                                           <span class="n">tsize</span><span class="p">)</span>
+        <span class="n">copy_bmp</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ArtProvider</span><span class="o">.</span><span class="n">GetBitmap</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">ART_COPY</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">ART_TOOLBAR</span><span class="p">,</span> 
+                                           <span class="n">tsize</span><span class="p">)</span>
+        <span class="n">menu_bar</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">MenuBar</span><span class="p">()</span>
+        
+        <span class="n">menu</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Menu</span><span class="p">()</span>        
+        <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+        <span class="n">item</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">MenuItem</span><span class="p">(</span><span class="n">menu</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="s">&quot;&amp;Save Image&quot;</span><span class="p">)</span>
+        <span class="n">item</span><span class="o">.</span><span class="n">SetBitmap</span><span class="p">(</span><span class="n">save_bmp</span><span class="p">)</span>
+        <span class="n">menu</span><span class="o">.</span><span class="n">AppendItem</span><span class="p">(</span><span class="n">item</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">on_save_file</span><span class="p">)</span>
+
+        <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+        <span class="n">item</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">MenuItem</span><span class="p">(</span><span class="n">menu</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="s">&quot;&amp;Print Image&quot;</span><span class="p">)</span>
+        <span class="n">item</span><span class="o">.</span><span class="n">SetBitmap</span><span class="p">(</span><span class="n">print_bmp</span><span class="p">)</span>
+        <span class="n">menu</span><span class="o">.</span><span class="n">AppendItem</span><span class="p">(</span><span class="n">item</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">on_print_image</span><span class="p">)</span>
+
+        <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+        <span class="n">item</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">MenuItem</span><span class="p">(</span><span class="n">menu</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="s">&quot;&amp;Print Preview&quot;</span><span class="p">)</span>
+        <span class="n">item</span><span class="o">.</span><span class="n">SetBitmap</span><span class="p">(</span><span class="n">preview_bmp</span><span class="p">)</span>
+        <span class="n">menu</span><span class="o">.</span><span class="n">AppendItem</span><span class="p">(</span><span class="n">item</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">on_print_preview</span><span class="p">)</span>
+        
+        <span class="n">menu</span><span class="o">.</span><span class="n">AppendSeparator</span><span class="p">()</span>
+        <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+        <span class="n">item</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">MenuItem</span><span class="p">(</span><span class="n">menu</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="s">&quot;&amp;Quit&quot;</span><span class="p">)</span>
+        <span class="n">item</span><span class="o">.</span><span class="n">SetBitmap</span><span class="p">(</span><span class="n">quit_bmp</span><span class="p">)</span>
+        <span class="n">menu</span><span class="o">.</span><span class="n">AppendItem</span><span class="p">(</span><span class="n">item</span><span class="p">)</span>
+
+        <span class="n">menu_bar</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="n">menu</span><span class="p">,</span> <span class="s">&quot;&amp;File&quot;</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">on_close</span><span class="p">)</span>
+        
+        <span class="n">menu_edit</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Menu</span><span class="p">()</span>
+        <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+        <span class="n">item</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">MenuItem</span><span class="p">(</span><span class="n">menu_edit</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="s">&quot;&amp;Copy&quot;</span><span class="p">)</span>
+        <span class="n">item</span><span class="o">.</span><span class="n">SetBitmap</span><span class="p">(</span><span class="n">copy_bmp</span><span class="p">)</span>
+        <span class="n">menu_edit</span><span class="o">.</span><span class="n">AppendItem</span><span class="p">(</span><span class="n">item</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">on_copy_image</span><span class="p">)</span>
+        
+        <span class="n">menu_bar</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="n">menu_edit</span><span class="p">,</span> <span class="s">&quot;&amp;Edit&quot;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">menu_bar</span> <span class="o">=</span> <span class="n">menu_bar</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">SetMenuBar</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">menu_bar</span><span class="p">)</span>
+
+<div class="viewcode-block" id="PlotFrame.set_plot_unfocus"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SimplePlot.PlotFrame.set_plot_unfocus">[docs]</a>    <span class="k">def</span> <span class="nf">set_plot_unfocus</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        un focusing</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">pass</span>    
+    </div>
+<div class="viewcode-block" id="PlotFrame.add_plot"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SimplePlot.PlotFrame.add_plot">[docs]</a>    <span class="k">def</span> <span class="nf">add_plot</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">plot</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Add Image</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">plotpanel</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span>
+        <span class="n">plotpanel</span><span class="o">.</span><span class="n">scale</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">scale</span>
+        <span class="n">plotpanel</span><span class="o">.</span><span class="n">show_plot</span><span class="p">(</span><span class="n">plot</span><span class="p">)</span>
+        </div>
+<div class="viewcode-block" id="PlotFrame.set_schedule_full_draw"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SimplePlot.PlotFrame.set_schedule_full_draw">[docs]</a>    <span class="k">def</span> <span class="nf">set_schedule_full_draw</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">panel</span><span class="p">,</span> <span class="n">func</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">resizing</span> <span class="o">=</span> <span class="bp">False</span>
+    </div>
+<div class="viewcode-block" id="PlotFrame.im_show"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SimplePlot.PlotFrame.im_show">[docs]</a>    <span class="k">def</span> <span class="nf">im_show</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">img</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Show background image</span>
+<span class="sd">        :Param img: [imread(path) from matplotlib.pyplot]</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">imshow</span><span class="p">(</span><span class="n">img</span><span class="p">)</span>
+        </div>
+<div class="viewcode-block" id="PlotFrame.set_schedule"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SimplePlot.PlotFrame.set_schedule">[docs]</a>    <span class="k">def</span> <span class="nf">set_schedule</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">schedule</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span> 
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c">#Not implemented</span>
+    </div>
+<div class="viewcode-block" id="PlotFrame.disable_app_menu"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SimplePlot.PlotFrame.disable_app_menu">[docs]</a>    <span class="k">def</span> <span class="nf">disable_app_menu</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">panel</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c">#Not implemented </span>
+    </div>
+<div class="viewcode-block" id="PlotFrame.get_current_context_menu"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SimplePlot.PlotFrame.get_current_context_menu">[docs]</a>    <span class="k">def</span> <span class="nf">get_current_context_menu</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">plotpanel</span><span class="p">):</span> 
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c">#Not implemented</span>
+    </div>
+<div class="viewcode-block" id="PlotFrame.on_save_file"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SimplePlot.PlotFrame.on_save_file">[docs]</a>    <span class="k">def</span> <span class="nf">on_save_file</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Save image</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">onSaveImage</span><span class="p">(</span><span class="n">event</span><span class="p">)</span>
+</div>
+<div class="viewcode-block" id="PlotFrame.on_print_image"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SimplePlot.PlotFrame.on_print_image">[docs]</a>    <span class="k">def</span> <span class="nf">on_print_image</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Save image</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">onPrint</span><span class="p">(</span><span class="n">event</span><span class="p">)</span>
+    </div>
+<div class="viewcode-block" id="PlotFrame.on_print_preview"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SimplePlot.PlotFrame.on_print_preview">[docs]</a>    <span class="k">def</span> <span class="nf">on_print_preview</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Save image</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">onPrinterPreview</span><span class="p">(</span><span class="n">event</span><span class="p">)</span>
+</div>
+<div class="viewcode-block" id="PlotFrame.on_copy_image"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SimplePlot.PlotFrame.on_copy_image">[docs]</a>    <span class="k">def</span> <span class="nf">on_copy_image</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Save image</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">OnCopyFigureMenu</span><span class="p">(</span><span class="n">event</span><span class="p">)</span>
+            </div>
+<div class="viewcode-block" id="PlotFrame.on_close"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SimplePlot.PlotFrame.on_close">[docs]</a>    <span class="k">def</span> <span class="nf">on_close</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        On Close </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">try</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">set_scale2d</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">scale</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">on_panel_close</span><span class="p">(</span><span class="n">event</span><span class="p">)</span>
+        <span class="k">except</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">Destroy</span><span class="p">()</span>
+                          </div></div>
+</pre></div>
+
+          </div>
+        </div>
+      </div>
+      <div class="sphinxsidebar">
+        <div class="sphinxsidebarwrapper">
+<div id="searchbox" style="display: none">
+  <h3>Quick search</h3>
+    <form class="search" action="../../../../../search.html" method="get">
+      <input type="text" name="q" />
+      <input type="submit" value="Go" />
+      <input type="hidden" name="check_keywords" value="yes" />
+      <input type="hidden" name="area" value="default" />
+    </form>
+    <p class="searchtip" style="font-size: 90%">
+    Enter search terms or a module, class or function name.
+    </p>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+        </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" >sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>
+    <div class="footer">
+        &copy; Copyright 2013, The SasView Project.
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
+    </div>
+  </body>
+</html>
Index: _modules/sas/guiframe/local_perspectives/plotting/SlicerParameters.html
===================================================================
--- _modules/sas/guiframe/local_perspectives/plotting/SlicerParameters.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
+++ _modules/sas/guiframe/local_perspectives/plotting/SlicerParameters.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
@@ -0,0 +1,241 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>sas.guiframe.local_perspectives.plotting.SlicerParameters &mdash; SasView 3.0.0 documentation</title>
+    
+    <link rel="stylesheet" href="../../../../../_static/default.css" type="text/css" />
+    <link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '../../../../../',
+        VERSION:     '3.0.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="../../../../../_static/jquery.js"></script>
+    <script type="text/javascript" src="../../../../../_static/underscore.js"></script>
+    <script type="text/javascript" src="../../../../../_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <link rel="top" title="SasView 3.0.0 documentation" href="../../../../../index.html" />
+    <link rel="up" title="sas.guiframe" href="../../../guiframe.html" /> 
+  </head>
+  <body>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" accesskey="U">sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>  
+
+    <div class="document">
+      <div class="documentwrapper">
+        <div class="bodywrapper">
+          <div class="body">
+            
+  <h1>Source code for sas.guiframe.local_perspectives.plotting.SlicerParameters</h1><div class="highlight"><pre>
+<span class="kn">import</span> <span class="nn">wx</span>
+<span class="kn">import</span> <span class="nn">wx.lib.newevent</span>
+<span class="c">#from copy import deepcopy</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">EVT_SLICER_PARS</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.utils</span> <span class="kn">import</span> <span class="n">format_number</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">EVT_SLICER</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">SlicerParameterEvent</span>
+
+
+<span class="k">class</span> <span class="nc">SlicerParameterPanel</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">Dialog</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<div class="viewcode-block" id="SlicerParameterPanel"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SlicerParameters.SlicerParameterPanel">[docs]</a><span class="sd">    Panel class to show the slicer parameters </span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="c">#TODO: show units</span>
+    <span class="c">#TODO: order parameters properly</span>
+    
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">Dialog</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Dialog window that allow to edit parameters slicer </span>
+<span class="sd">        by entering new values</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">params</span> <span class="o">=</span> <span class="p">{}</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="n">parent</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">type</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">listeners</span> <span class="o">=</span> <span class="p">[]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">parameters</span> <span class="o">=</span> <span class="p">[]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">bck</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">GridBagSizer</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">SetSizer</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">bck</span><span class="p">)</span>
+        <span class="n">label</span> <span class="o">=</span> <span class="s">&quot;Right-click on 2D plot for slicer options&quot;</span>
+        <span class="n">title</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">label</span><span class="p">,</span> <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_LEFT</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">bck</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">title</span><span class="p">,</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span>
+                     <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">LEFT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">15</span><span class="p">)</span>
+        <span class="c"># Bindings</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">EVT_SLICER</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onEVT_SLICER</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">EVT_SLICER_PARS</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onParamChange</span><span class="p">)</span>
+
+    <span class="k">def</span> <span class="nf">onEVT_SLICER</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<div class="viewcode-block" id="SlicerParameterPanel.onEVT_SLICER"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SlicerParameters.SlicerParameterPanel.onEVT_SLICER">[docs]</a><span class="sd">        Process EVT_SLICER events</span>
+<span class="sd">        When the slicer changes, update the panel</span>
+<span class="sd">        </span>
+<span class="sd">        :param event: EVT_SLICER event</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">Skip</span><span class="p">()</span>
+        <span class="k">if</span> <span class="n">event</span><span class="o">.</span><span class="n">obj_class</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">set_slicer</span><span class="p">(</span><span class="bp">None</span><span class="p">,</span> <span class="bp">None</span><span class="p">)</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">set_slicer</span><span class="p">(</span><span class="n">event</span><span class="o">.</span><span class="n">type</span><span class="p">,</span> <span class="n">event</span><span class="o">.</span><span class="n">params</span><span class="p">)</span>
+        
+    <span class="k">def</span> <span class="nf">set_slicer</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">type</span><span class="p">,</span> <span class="n">params</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="SlicerParameterPanel.set_slicer"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SlicerParameters.SlicerParameterPanel.set_slicer">[docs]</a><span class="sd">        Rebuild the panel</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">bck</span><span class="o">.</span><span class="n">Clear</span><span class="p">(</span><span class="bp">True</span><span class="p">)</span>  
+        <span class="bp">self</span><span class="o">.</span><span class="n">type</span> <span class="o">=</span> <span class="nb">type</span>  
+        <span class="k">if</span> <span class="nb">type</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="n">label</span> <span class="o">=</span> <span class="s">&quot;Right-click on 2D plot for slicer options&quot;</span>
+            <span class="n">title</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">label</span><span class="p">,</span> <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_LEFT</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">bck</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">title</span><span class="p">,</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> 
+                         <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">LEFT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">15</span><span class="p">)</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="n">title</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> 
+                                  <span class="s">&quot;Slicer Parameters&quot;</span><span class="p">,</span> <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_LEFT</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">bck</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">title</span><span class="p">,</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span>
+                         <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">LEFT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">15</span><span class="p">)</span>
+            <span class="n">ix</span> <span class="o">=</span> <span class="mi">0</span>
+            <span class="n">iy</span> <span class="o">=</span> <span class="mi">0</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">parameters</span> <span class="o">=</span> <span class="p">[]</span>
+            <span class="n">keys</span> <span class="o">=</span> <span class="n">params</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span>
+            <span class="n">keys</span><span class="o">.</span><span class="n">sort</span><span class="p">()</span>
+            <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">keys</span><span class="p">:</span>
+                <span class="n">iy</span> <span class="o">+=</span> <span class="mi">1</span>
+                <span class="n">ix</span> <span class="o">=</span> <span class="mi">0</span>
+                <span class="k">if</span> <span class="ow">not</span> <span class="n">item</span> <span class="ow">in</span> <span class="p">[</span><span class="s">&quot;count&quot;</span><span class="p">,</span> <span class="s">&quot;errors&quot;</span><span class="p">]:</span>
+                    <span class="n">text</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">item</span><span class="p">,</span> <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_LEFT</span><span class="p">)</span>
+                    <span class="bp">self</span><span class="o">.</span><span class="n">bck</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">text</span><span class="p">,</span> <span class="p">(</span><span class="n">iy</span><span class="p">,</span> <span class="n">ix</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> 
+                                 <span class="n">wx</span><span class="o">.</span><span class="n">LEFT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ADJUST_MINSIZE</span><span class="p">,</span> <span class="mi">15</span><span class="p">)</span>
+                    <span class="n">ctl</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">TextCtrl</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="p">(</span><span class="mi">80</span><span class="p">,</span> <span class="mi">20</span><span class="p">),</span>
+                                      <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">TE_PROCESS_ENTER</span><span class="p">)</span>
+                    <span class="n">hint_msg</span> <span class="o">=</span> <span class="s">&quot;Modify the value of </span><span class="si">%s</span><span class="s"> to change&quot;</span> <span class="o">%</span> <span class="n">item</span>
+                    <span class="n">hint_msg</span> <span class="o">+=</span> <span class="s">&quot; the 2D slicer&quot;</span>
+                    <span class="n">ctl</span><span class="o">.</span><span class="n">SetToolTipString</span><span class="p">(</span><span class="n">hint_msg</span><span class="p">)</span>
+                    <span class="n">ix</span> <span class="o">=</span> <span class="mi">1</span>
+                    <span class="n">ctl</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="n">format_number</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">params</span><span class="p">[</span><span class="n">item</span><span class="p">])))</span>
+                    <span class="bp">self</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_TEXT_ENTER</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onTextEnter</span><span class="p">)</span>
+                    <span class="bp">self</span><span class="o">.</span><span class="n">parameters</span><span class="o">.</span><span class="n">append</span><span class="p">([</span><span class="n">item</span><span class="p">,</span> <span class="n">ctl</span><span class="p">])</span>
+                    <span class="bp">self</span><span class="o">.</span><span class="n">bck</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">ctl</span><span class="p">,</span> <span class="p">(</span><span class="n">iy</span><span class="p">,</span> <span class="n">ix</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> 
+                                 <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ADJUST_MINSIZE</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
+                    <span class="n">ix</span> <span class="o">=</span> <span class="mi">3</span>
+                    <span class="bp">self</span><span class="o">.</span><span class="n">bck</span><span class="o">.</span><span class="n">Add</span><span class="p">((</span><span class="mi">20</span><span class="p">,</span> <span class="mi">20</span><span class="p">),</span> <span class="p">(</span><span class="n">iy</span><span class="p">,</span> <span class="n">ix</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> 
+                                 <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ADJUST_MINSIZE</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
+                <span class="k">else</span><span class="p">:</span>
+                    <span class="n">text</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">item</span> <span class="o">+</span> <span class="s">&quot; : &quot;</span><span class="p">,</span> 
+                                         <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_LEFT</span><span class="p">)</span>
+                    <span class="bp">self</span><span class="o">.</span><span class="n">bck</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">text</span><span class="p">,</span> <span class="p">(</span><span class="n">iy</span><span class="p">,</span> <span class="n">ix</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> 
+                                 <span class="n">wx</span><span class="o">.</span><span class="n">LEFT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ADJUST_MINSIZE</span><span class="p">,</span> <span class="mi">15</span><span class="p">)</span>
+                    <span class="n">ctl</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> 
+                                    <span class="n">format_number</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">params</span><span class="p">[</span><span class="n">item</span><span class="p">])),</span> 
+                                    <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_LEFT</span><span class="p">)</span>
+                    <span class="n">ix</span> <span class="o">=</span> <span class="mi">1</span>
+                    <span class="bp">self</span><span class="o">.</span><span class="n">bck</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">ctl</span><span class="p">,</span> <span class="p">(</span><span class="n">iy</span><span class="p">,</span> <span class="n">ix</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> 
+                                 <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ADJUST_MINSIZE</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
+            <span class="n">iy</span> <span class="o">+=</span> <span class="mi">1</span>
+            <span class="n">ix</span> <span class="o">=</span> <span class="mi">1</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">bck</span><span class="o">.</span><span class="n">Add</span><span class="p">((</span><span class="mi">20</span><span class="p">,</span> <span class="mi">20</span><span class="p">),</span> <span class="p">(</span><span class="n">iy</span><span class="p">,</span> <span class="n">ix</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> 
+                         <span class="n">wx</span><span class="o">.</span><span class="n">LEFT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ADJUST_MINSIZE</span><span class="p">,</span> <span class="mi">15</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">bck</span><span class="o">.</span><span class="n">Layout</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">bck</span><span class="o">.</span><span class="n">Fit</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">GetSizer</span><span class="p">()</span><span class="o">.</span><span class="n">Layout</span><span class="p">()</span>
+
+    <span class="k">def</span> <span class="nf">onParamChange</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">evt</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="SlicerParameterPanel.onParamChange"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SlicerParameters.SlicerParameterPanel.onParamChange">[docs]</a><span class="sd">        receive an event end reset value text fields</span>
+<span class="sd">        inside self.parameters</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">evt</span><span class="o">.</span><span class="n">Skip</span><span class="p">()</span>
+        <span class="k">if</span> <span class="n">evt</span><span class="o">.</span><span class="n">type</span> <span class="o">==</span> <span class="s">&quot;UPDATE&quot;</span><span class="p">:</span>
+            <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">parameters</span><span class="p">:</span>              
+                <span class="k">if</span> <span class="n">item</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="ow">in</span> <span class="n">evt</span><span class="o">.</span><span class="n">params</span><span class="p">:</span>
+                    <span class="n">item</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="s">&quot;</span><span class="si">%-5.3g</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">evt</span><span class="o">.</span><span class="n">params</span><span class="p">[</span><span class="n">item</span><span class="p">[</span><span class="mi">0</span><span class="p">]])</span>
+                    <span class="n">item</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">Refresh</span><span class="p">()</span>
+        
+    <span class="k">def</span> <span class="nf">onTextEnter</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">evt</span><span class="p">):</span> 
+        <span class="sd">&quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="SlicerParameterPanel.onTextEnter"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.SlicerParameters.SlicerParameterPanel.onTextEnter">[docs]</a><span class="sd">        Parameters have changed</span>
+<span class="sd">        &quot;&quot;&quot;</span> 
+        <span class="n">params</span> <span class="o">=</span> <span class="p">{}</span>
+        <span class="n">has_error</span> <span class="o">=</span> <span class="bp">False</span>
+        <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">parameters</span><span class="p">:</span>
+            <span class="k">try</span><span class="p">:</span>
+                <span class="n">params</span><span class="p">[</span><span class="n">item</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">item</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">GetValue</span><span class="p">())</span>
+                <span class="n">item</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">SetBackgroundColour</span><span class="p">(</span>
+                        <span class="n">wx</span><span class="o">.</span><span class="n">SystemSettings_GetColour</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">SYS_COLOUR_WINDOW</span><span class="p">))</span>
+                <span class="n">item</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">Refresh</span><span class="p">()</span>
+            <span class="k">except</span><span class="p">:</span>
+                <span class="n">has_error</span> <span class="o">=</span> <span class="bp">True</span>
+                <span class="n">item</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">SetBackgroundColour</span><span class="p">(</span><span class="s">&quot;pink&quot;</span><span class="p">)</span>
+                <span class="n">item</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">Refresh</span><span class="p">()</span>
+
+        <span class="k">if</span> <span class="n">has_error</span> <span class="o">==</span> <span class="bp">False</span><span class="p">:</span>
+            <span class="c"># Post parameter event</span>
+            <span class="c">##parent hier is plotter2D</span>
+            <span class="n">event</span> <span class="o">=</span> <span class="n">SlicerParameterEvent</span><span class="p">(</span><span class="nb">type</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">type</span><span class="p">,</span> <span class="n">params</span><span class="o">=</span><span class="n">params</span><span class="p">)</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> <span class="n">event</span><span class="p">)</span>
+        
+</pre></div></div></div>
+
+          </div>
+        </div>
+      </div>
+      <div class="sphinxsidebar">
+        <div class="sphinxsidebarwrapper">
+<div id="searchbox" style="display: none">
+  <h3>Quick search</h3>
+    <form class="search" action="../../../../../search.html" method="get">
+      <input type="text" name="q" />
+      <input type="submit" value="Go" />
+      <input type="hidden" name="check_keywords" value="yes" />
+      <input type="hidden" name="area" value="default" />
+    </form>
+    <p class="searchtip" style="font-size: 90%">
+    Enter search terms or a module, class or function name.
+    </p>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+        </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" >sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>
+    <div class="footer">
+        &copy; Copyright 2013, The SasView Project.
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
+    </div>
+  </body>
+</html>
Index: _modules/sas/guiframe/local_perspectives/plotting/appearanceDialog.html
===================================================================
--- _modules/sas/guiframe/local_perspectives/plotting/appearanceDialog.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
+++ _modules/sas/guiframe/local_perspectives/plotting/appearanceDialog.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
@@ -0,0 +1,320 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>sas.guiframe.local_perspectives.plotting.appearanceDialog &mdash; SasView 3.0.0 documentation</title>
+    
+    <link rel="stylesheet" href="../../../../../_static/default.css" type="text/css" />
+    <link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '../../../../../',
+        VERSION:     '3.0.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="../../../../../_static/jquery.js"></script>
+    <script type="text/javascript" src="../../../../../_static/underscore.js"></script>
+    <script type="text/javascript" src="../../../../../_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <link rel="top" title="SasView 3.0.0 documentation" href="../../../../../index.html" />
+    <link rel="up" title="sas.guiframe" href="../../../guiframe.html" /> 
+  </head>
+  <body>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" accesskey="U">sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>  
+
+    <div class="document">
+      <div class="documentwrapper">
+        <div class="bodywrapper">
+          <div class="body">
+            
+  <h1>Source code for sas.guiframe.local_perspectives.plotting.appearanceDialog</h1><div class="highlight"><pre>
+<span class="c">#!/usr/bin/python</span>
+<span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">Dialog for appearance of plot symbols, color, size etc.</span>
+
+<span class="sd">This software was developed by Institut Laue-Langevin as part of</span>
+<span class="sd">Distributed Data Analysis of Neutron Scattering Experiments (DANSE).</span>
+
+<span class="sd">Copyright 2012 Institut Laue-Langevin</span>
+<span class="sd">&quot;&quot;&quot;</span>
+<span class="kn">import</span> <span class="nn">wx</span>
+<span class="kn">import</span> <span class="nn">operator</span>
+
+<div class="viewcode-block" id="appearanceDialog"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.appearanceDialog.appearanceDialog">[docs]</a><span class="k">class</span> <span class="nc">appearanceDialog</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">Frame</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Appearance dialog</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">title</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Initialization of the Panel</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="nb">super</span><span class="p">(</span><span class="n">appearanceDialog</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="n">parent</span><span class="p">,</span> <span class="n">title</span><span class="o">=</span><span class="n">title</span><span class="p">,</span> 
+                        <span class="n">size</span><span class="o">=</span><span class="p">(</span><span class="mi">570</span><span class="p">,</span><span class="mi">450</span><span class="p">),</span> 
+                        <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">DEFAULT_FRAME_STYLE</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">FRAME_FLOAT_ON_PARENT</span><span class="p">)</span>
+
+        <span class="bp">self</span><span class="o">.</span><span class="n">okay_clicked</span> <span class="o">=</span> <span class="bp">False</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="n">parent</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">symbo_labels</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">get_symbol_label</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">color_labels</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">get_color_label</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">init_ui</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">Centre</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">Show</span><span class="p">()</span>
+
+<div class="viewcode-block" id="appearanceDialog.init_ui"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.appearanceDialog.appearanceDialog.init_ui">[docs]</a>    <span class="k">def</span> <span class="nf">init_ui</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Create spacing needed</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">panel</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Panel</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
+
+        <span class="n">vbox</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">BoxSizer</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">VERTICAL</span><span class="p">)</span>
+
+        <span class="n">hbox1</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">BoxSizer</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">HORIZONTAL</span><span class="p">)</span>
+        <span class="n">hbox2</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">BoxSizer</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">HORIZONTAL</span><span class="p">)</span>
+        <span class="n">hbox3</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">BoxSizer</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">HORIZONTAL</span><span class="p">)</span>
+
+        <span class="n">ivbox1</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">BoxSizer</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">VERTICAL</span><span class="p">)</span>
+        <span class="n">ivbox2</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">BoxSizer</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">VERTICAL</span><span class="p">)</span>
+ 
+        <span class="n">ihbox1</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">BoxSizer</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">HORIZONTAL</span><span class="p">)</span>
+        <span class="n">ihbox2</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">BoxSizer</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">HORIZONTAL</span><span class="p">)</span>
+
+        <span class="n">symbolstaticbox</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticBox</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s">&#39;Symbol&#39;</span><span class="p">)</span>
+        <span class="n">symbolstaticboxsizer</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticBoxSizer</span><span class="p">(</span><span class="n">symbolstaticbox</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">VERTICAL</span><span class="p">)</span>
+
+        <span class="c"># add widgets - reverse order!</span>
+        <span class="c"># texts</span>
+        <span class="n">symboltext</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s">&#39;Shape&#39;</span><span class="p">)</span>
+        <span class="n">colortext</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s">&#39;Color&#39;</span><span class="p">)</span>
+        <span class="n">sizetext</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s">&#39;Size &#39;</span><span class="p">)</span>
+        <span class="n">labeltext</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s">&#39;Legend Label&#39;</span><span class="p">)</span>
+
+        <span class="c"># selection widgets</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">symbollistbox</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ListBox</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="p">(</span><span class="mi">200</span><span class="p">,</span> <span class="mi">200</span><span class="p">))</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">colorlistbox</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ComboBox</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span> <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">CB_READONLY</span><span class="p">,</span> 
+                                        <span class="n">size</span><span class="o">=</span><span class="p">(</span><span class="mi">185</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">))</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">sizecombobox</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ComboBox</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span> <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">CB_READONLY</span><span class="p">,</span> 
+                                        <span class="n">size</span><span class="o">=</span><span class="p">(</span><span class="mi">90</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">))</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">sizecombobox</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_COMBOBOX</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">combo_click</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">sizecustombutton</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Button</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s">&#39;Custom...&#39;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">sizecustombutton</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_BUTTON</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">custom_size</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">labeltextbox</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">TextCtrl</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s">&quot;&quot;</span><span class="p">,</span>  <span class="n">size</span><span class="o">=</span><span class="p">(</span><span class="mi">440</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">))</span>
+
+        <span class="c"># buttons</span>
+        <span class="n">okbutton</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Button</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s">&#39;OK&#39;</span><span class="p">)</span>
+        <span class="n">okbutton</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_BUTTON</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">on_ok</span><span class="p">)</span>
+        <span class="n">cancelbutton</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Button</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s">&#39;Cancel&#39;</span><span class="p">)</span>
+        <span class="n">cancelbutton</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_BUTTON</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">close_dlg</span><span class="p">)</span>
+
+        <span class="c"># now Add all the widgets to relevant spacer - tricky</span>
+        <span class="n">ivbox1</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">symboltext</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALL</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_LEFT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
+        <span class="n">ivbox1</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">symbollistbox</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALL</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_LEFT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
+
+        <span class="n">ihbox1</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">sizetext</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALL</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_LEFT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
+        <span class="n">ihbox1</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">sizecombobox</span><span class="p">,</span> 
+                   <span class="n">flag</span><span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALL</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">RIGHT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_LEFT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
+        <span class="n">ihbox1</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">sizecustombutton</span><span class="p">,</span> 
+                   <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_LEFT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ALL</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
+
+        <span class="n">ihbox2</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">colortext</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALL</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_LEFT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
+        <span class="n">ihbox2</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">colorlistbox</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALL</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_LEFT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
+
+        <span class="n">ivbox2</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">ihbox1</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_LEFT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
+        <span class="n">ivbox2</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">ihbox2</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_LEFT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
+
+        <span class="n">hbox1</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">ivbox1</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_LEFT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
+        <span class="n">hbox1</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">ivbox2</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_LEFT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
+
+        <span class="n">hbox2</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">okbutton</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALL</span><span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_RIGHT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
+        <span class="n">hbox2</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">cancelbutton</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALL</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_RIGHT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
+
+        <span class="n">hbox3</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">labeltext</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ALL</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_LEFT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
+        <span class="n">hbox3</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">labeltextbox</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ALL</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_LEFT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
+  
+        <span class="n">symbolstaticboxsizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">hbox1</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALL</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
+        <span class="n">vbox</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">symbolstaticboxsizer</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALL</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
+        <span class="n">vbox</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">hbox3</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">RIGHT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
+        <span class="n">vbox</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">StaticLine</span><span class="p">(</span><span class="n">panel</span><span class="p">),</span> <span class="mi">0</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALL</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
+        <span class="n">vbox</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">hbox2</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">RIGHT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_RIGHT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
+
+        <span class="n">panel</span><span class="o">.</span><span class="n">SetSizer</span><span class="p">(</span><span class="n">vbox</span><span class="p">)</span>
+
+        <span class="bp">self</span><span class="o">.</span><span class="n">populate_symbol</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">populate_color</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">populate_size</span><span class="p">()</span>
+
+        <span class="bp">self</span><span class="o">.</span><span class="n">SetDefaultItem</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">symbollistbox</span><span class="p">)</span>
+</div>
+<div class="viewcode-block" id="appearanceDialog.custom_size"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.appearanceDialog.appearanceDialog.custom_size">[docs]</a>    <span class="k">def</span> <span class="nf">custom_size</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        On custom size</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">dlg</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">TextEntryDialog</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> 
+                                 <span class="s">&#39;Enter custom size&#39;</span><span class="p">,</span> 
+                                 <span class="s">&#39;Custom size&#39;</span><span class="p">,</span> 
+                                 <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">final_size</span><span class="p">))</span>
+        <span class="k">if</span><span class="p">(</span><span class="n">dlg</span><span class="o">.</span><span class="n">ShowModal</span><span class="p">()</span> <span class="o">==</span> <span class="n">wx</span><span class="o">.</span><span class="n">ID_OK</span><span class="p">):</span>
+            <span class="k">if</span><span class="p">(</span><span class="nb">float</span><span class="p">(</span><span class="n">dlg</span><span class="o">.</span><span class="n">GetValue</span><span class="p">())</span> <span class="o">&lt;</span> <span class="mi">0</span><span class="p">):</span>
+                <span class="n">msg</span> <span class="o">=</span> <span class="s">&quot;Unfortunately imaginary icons are not yet supported.&quot;</span>
+                <span class="n">msg</span> <span class="o">+=</span> <span class="s">&quot;Please enter a positive value&quot;</span>
+                <span class="n">dial</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">MessageDialog</span><span class="p">(</span><span class="bp">None</span><span class="p">,</span> <span class="n">msg</span><span class="p">,</span> <span class="s">&#39;Error&#39;</span><span class="p">,</span>
+                                         <span class="n">wx</span><span class="o">.</span><span class="n">OK</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ICON_ERROR</span><span class="p">)</span>
+                <span class="n">dial</span><span class="o">.</span><span class="n">ShowModal</span><span class="p">()</span>
+                <span class="n">dlg</span><span class="o">.</span><span class="n">Destroy</span><span class="p">()</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">custom_size</span><span class="p">(</span><span class="n">event</span><span class="p">)</span>
+            <span class="k">else</span><span class="p">:</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">final_size</span> <span class="o">=</span> <span class="n">dlg</span><span class="o">.</span><span class="n">GetValue</span><span class="p">()</span>
+                <span class="n">dlg</span><span class="o">.</span><span class="n">Destroy</span><span class="p">()</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="n">dlg</span><span class="o">.</span><span class="n">Destroy</span><span class="p">()</span>
+</div>
+<div class="viewcode-block" id="appearanceDialog.set_defaults"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.appearanceDialog.appearanceDialog.set_defaults">[docs]</a>    <span class="k">def</span> <span class="nf">set_defaults</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">size</span><span class="p">,</span> <span class="n">color</span><span class="p">,</span> <span class="n">symbol</span><span class="p">,</span> <span class="n">label</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Set Defaults</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">final_size</span> <span class="o">=</span> <span class="n">size</span>
+        <span class="c"># set up gui values</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">labeltextbox</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="n">label</span><span class="p">)</span>
+        <span class="k">if</span><span class="p">(</span><span class="n">size</span> <span class="o">%</span> <span class="mi">1</span> <span class="o">==</span> <span class="mi">0</span> <span class="ow">and</span> <span class="n">size</span> <span class="o">&gt;</span> <span class="mi">1</span> <span class="ow">and</span> <span class="n">size</span> <span class="o">&lt;</span> <span class="mi">11</span><span class="p">):</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">sizecombobox</span><span class="o">.</span><span class="n">SetSelection</span><span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="n">size</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">sizecombobox</span><span class="o">.</span><span class="n">SetSelection</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">symbollistbox</span><span class="o">.</span><span class="n">SetSelection</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">sorted_sym_dic</span><span class="p">[</span><span class="n">symbol</span><span class="p">])</span>
+        <span class="n">colorname</span> <span class="o">=</span> <span class="n">appearanceDialog</span><span class="o">.</span><span class="n">find_key</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">get_color_label</span><span class="p">(),</span> 
+                                              <span class="n">color</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">colorlistbox</span><span class="o">.</span><span class="n">SetStringSelection</span><span class="p">(</span><span class="n">colorname</span><span class="p">)</span>
+</div>
+<div class="viewcode-block" id="appearanceDialog.populate_symbol"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.appearanceDialog.appearanceDialog.populate_symbol">[docs]</a>    <span class="k">def</span> <span class="nf">populate_symbol</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Populate Symbols</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">sorted_symbo_labels</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">symbo_labels</span><span class="o">.</span><span class="n">iteritems</span><span class="p">(),</span> 
+                                          <span class="n">key</span><span class="o">=</span><span class="n">operator</span><span class="o">.</span><span class="n">itemgetter</span><span class="p">(</span><span class="mi">1</span><span class="p">))</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">sorted_sym_dic</span> <span class="o">=</span> <span class="p">{}</span>
+        <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span>
+        <span class="k">for</span> <span class="n">label</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">sorted_symbo_labels</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">symbollistbox</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">label</span><span class="p">[</span><span class="mi">0</span><span class="p">]))</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">sorted_sym_dic</span><span class="p">[</span><span class="nb">str</span><span class="p">(</span><span class="n">label</span><span class="p">[</span><span class="mi">0</span><span class="p">])]</span> <span class="o">=</span> <span class="n">i</span>
+            <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
+</div>
+<div class="viewcode-block" id="appearanceDialog.populate_color"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.appearanceDialog.appearanceDialog.populate_color">[docs]</a>    <span class="k">def</span> <span class="nf">populate_color</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Populate Colors</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">sortedcolor_labels</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">color_labels</span><span class="o">.</span><span class="n">iteritems</span><span class="p">(),</span> 
+                                   <span class="n">key</span><span class="o">=</span><span class="n">operator</span><span class="o">.</span><span class="n">itemgetter</span><span class="p">(</span><span class="mi">1</span><span class="p">))</span>
+        <span class="k">for</span> <span class="n">color</span> <span class="ow">in</span> <span class="n">sortedcolor_labels</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">colorlistbox</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">color</span><span class="p">[</span><span class="mi">0</span><span class="p">]))</span>
+ </div>
+<div class="viewcode-block" id="appearanceDialog.populate_size"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.appearanceDialog.appearanceDialog.populate_size">[docs]</a>    <span class="k">def</span> <span class="nf">populate_size</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Populate Size</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">11</span><span class="p">):</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">sizecombobox</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">i</span><span class="p">)</span> <span class="o">+</span> <span class="s">&#39;.0&#39;</span><span class="p">)</span>
+</div>
+<div class="viewcode-block" id="appearanceDialog.combo_click"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.appearanceDialog.appearanceDialog.combo_click">[docs]</a>    <span class="k">def</span> <span class="nf">combo_click</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Combox on click</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">Skip</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">final_size</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sizecombobox</span><span class="o">.</span><span class="n">GetValue</span><span class="p">()</span>
+</div>
+<div class="viewcode-block" id="appearanceDialog.close_dlg"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.appearanceDialog.appearanceDialog.close_dlg">[docs]</a>    <span class="k">def</span> <span class="nf">close_dlg</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        On Close Dlg</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">Skip</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">Destroy</span><span class="p">()</span>
+</div>
+    <span class="nd">@staticmethod</span>
+<div class="viewcode-block" id="appearanceDialog.find_key"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.appearanceDialog.appearanceDialog.find_key">[docs]</a>    <span class="k">def</span> <span class="nf">find_key</span><span class="p">(</span><span class="n">dic</span><span class="p">,</span> <span class="n">val</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Find key</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">return</span> <span class="p">[</span><span class="n">k</span> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">dic</span><span class="o">.</span><span class="n">iteritems</span><span class="p">()</span> <span class="k">if</span> <span class="n">v</span> <span class="o">==</span> <span class="n">val</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span>
+        </div>
+<div class="viewcode-block" id="appearanceDialog.get_current_values"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.appearanceDialog.appearanceDialog.get_current_values">[docs]</a>    <span class="k">def</span> <span class="nf">get_current_values</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> 
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Get Current Values</span>
+<span class="sd">        :returns : (size, color, symbol, dataname)</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">size</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">final_size</span><span class="p">)</span>
+        <span class="n">name</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">labeltextbox</span><span class="o">.</span><span class="n">GetValue</span><span class="p">())</span>
+        <span class="n">seltuple</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">symbollistbox</span><span class="o">.</span><span class="n">GetSelections</span><span class="p">()</span>
+        <span class="n">symbol</span> <span class="o">=</span> <span class="n">appearanceDialog</span><span class="o">.</span><span class="n">find_key</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">sorted_sym_dic</span><span class="p">,</span> 
+                                           <span class="nb">int</span><span class="p">(</span><span class="n">seltuple</span><span class="p">[</span><span class="mi">0</span><span class="p">]))</span>
+        <span class="n">color</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">colorlistbox</span><span class="o">.</span><span class="n">GetValue</span><span class="p">())</span> 
+        <span class="k">return</span><span class="p">(</span><span class="n">size</span><span class="p">,</span> <span class="n">color</span><span class="p">,</span> <span class="n">symbol</span><span class="p">,</span> <span class="n">name</span><span class="p">)</span>
+</div>
+<div class="viewcode-block" id="appearanceDialog.on_ok"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.appearanceDialog.appearanceDialog.on_ok">[docs]</a>    <span class="k">def</span> <span class="nf">on_ok</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        On OK button clicked</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">Skip</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">okay_clicked</span> <span class="o">=</span> <span class="bp">True</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">Close</span><span class="p">()</span></div></div>
+</pre></div>
+
+          </div>
+        </div>
+      </div>
+      <div class="sphinxsidebar">
+        <div class="sphinxsidebarwrapper">
+<div id="searchbox" style="display: none">
+  <h3>Quick search</h3>
+    <form class="search" action="../../../../../search.html" method="get">
+      <input type="text" name="q" />
+      <input type="submit" value="Go" />
+      <input type="hidden" name="check_keywords" value="yes" />
+      <input type="hidden" name="area" value="default" />
+    </form>
+    <p class="searchtip" style="font-size: 90%">
+    Enter search terms or a module, class or function name.
+    </p>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+        </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" >sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>
+    <div class="footer">
+        &copy; Copyright 2013, The SasView Project.
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
+    </div>
+  </body>
+</html>
Index: _modules/sas/guiframe/local_perspectives/plotting/binder.html
===================================================================
--- _modules/sas/guiframe/local_perspectives/plotting/binder.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
+++ _modules/sas/guiframe/local_perspectives/plotting/binder.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
@@ -0,0 +1,482 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>sas.guiframe.local_perspectives.plotting.binder &mdash; SasView 3.0.0 documentation</title>
+    
+    <link rel="stylesheet" href="../../../../../_static/default.css" type="text/css" />
+    <link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '../../../../../',
+        VERSION:     '3.0.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="../../../../../_static/jquery.js"></script>
+    <script type="text/javascript" src="../../../../../_static/underscore.js"></script>
+    <script type="text/javascript" src="../../../../../_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <link rel="top" title="SasView 3.0.0 documentation" href="../../../../../index.html" />
+    <link rel="up" title="sas.guiframe" href="../../../guiframe.html" /> 
+  </head>
+  <body>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" accesskey="U">sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>  
+
+    <div class="document">
+      <div class="documentwrapper">
+        <div class="bodywrapper">
+          <div class="body">
+            
+  <h1>Source code for sas.guiframe.local_perspectives.plotting.binder</h1><div class="highlight"><pre>
+<span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">Extension to MPL to support the binding of artists to key/mouse events.</span>
+<span class="sd">&quot;&quot;&quot;</span>
+
+<div class="viewcode-block" id="Selection"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.binder.Selection">[docs]</a><span class="k">class</span> <span class="nc">Selection</span><span class="p">:</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Store and compare selections.</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="c"># TODO: We need some way to check in prop matches, preferably</span>
+    <span class="c"># TODO: without imposing structure on prop.</span>
+        
+    <span class="n">artist</span> <span class="o">=</span> <span class="bp">None</span>
+    <span class="n">prop</span> <span class="o">=</span> <span class="p">{}</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">artist</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">prop</span><span class="o">=</span><span class="p">{}):</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">artist</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">prop</span> <span class="o">=</span> <span class="n">artist</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">prop</span>
+        
+    <span class="k">def</span> <span class="nf">__eq__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span>
+        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">artist</span> <span class="ow">is</span> <span class="n">other</span><span class="o">.</span><span class="n">artist</span>
+    
+    <span class="k">def</span> <span class="nf">__ne__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span>
+        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">artist</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">other</span><span class="o">.</span><span class="n">artist</span>
+    
+    <span class="k">def</span> <span class="nf">__nonzero__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">artist</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span>
+</div>
+<div class="viewcode-block" id="BindArtist"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.binder.BindArtist">[docs]</a><span class="k">class</span> <span class="nc">BindArtist</span><span class="p">:</span>
+
+    <span class="c"># Track keyboard modifiers for events.</span>
+    <span class="c"># TODO: Move keyboard modifier support into the backend.  We cannot</span>
+    <span class="c"># TODO: properly support it from outside the windowing system since there</span>
+    <span class="c"># TODO: is no way to recognized whether shift is held down when the mouse</span>
+    <span class="c"># TODO: first clicks on the the application window.</span>
+    <span class="n">control</span><span class="p">,</span> <span class="n">shift</span><span class="p">,</span> <span class="n">alt</span><span class="p">,</span> <span class="n">meta</span> <span class="o">=</span> <span class="bp">False</span><span class="p">,</span> <span class="bp">False</span><span class="p">,</span> <span class="bp">False</span><span class="p">,</span> <span class="bp">False</span>
+
+    <span class="c"># Track doubleclick</span>
+    <span class="n">dclick_threshhold</span> <span class="o">=</span> <span class="mf">0.25</span>
+    <span class="n">_last_button</span><span class="p">,</span> <span class="n">_last_time</span> <span class="o">=</span> <span class="bp">None</span><span class="p">,</span> <span class="mi">0</span>
+    
+    <span class="c"># Mouse/keyboard events we can bind to</span>
+    <span class="n">events</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;enter&#39;</span><span class="p">,</span> <span class="s">&#39;leave&#39;</span><span class="p">,</span> <span class="s">&#39;motion&#39;</span><span class="p">,</span> <span class="s">&#39;click&#39;</span><span class="p">,</span> <span class="s">&#39;dclick&#39;</span><span class="p">,</span> <span class="s">&#39;drag&#39;</span><span class="p">,</span> <span class="s">&#39;release&#39;</span><span class="p">,</span>
+             <span class="s">&#39;scroll&#39;</span><span class="p">,</span> <span class="s">&#39;key&#39;</span><span class="p">,</span> <span class="s">&#39;keyup&#39;</span><span class="p">]</span>
+    <span class="c"># TODO: Need our own event structure</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">figure</span><span class="p">):</span>
+        <span class="n">canvas</span> <span class="o">=</span> <span class="n">figure</span><span class="o">.</span><span class="n">canvas</span>
+        <span class="c"># Link to keyboard/mouse</span>
+        <span class="k">try</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">_connections</span> <span class="o">=</span> <span class="p">[</span>
+                <span class="n">canvas</span><span class="o">.</span><span class="n">mpl_connect</span><span class="p">(</span><span class="s">&#39;motion_notify_event&#39;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_onMotion</span><span class="p">),</span>
+                <span class="n">canvas</span><span class="o">.</span><span class="n">mpl_connect</span><span class="p">(</span><span class="s">&#39;button_press_event&#39;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_onClick</span><span class="p">),</span>
+                <span class="n">canvas</span><span class="o">.</span><span class="n">mpl_connect</span><span class="p">(</span><span class="s">&#39;button_release_event&#39;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_onRelease</span><span class="p">),</span>
+                <span class="n">canvas</span><span class="o">.</span><span class="n">mpl_connect</span><span class="p">(</span><span class="s">&#39;key_press_event&#39;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_onKey</span><span class="p">),</span>
+                <span class="n">canvas</span><span class="o">.</span><span class="n">mpl_connect</span><span class="p">(</span><span class="s">&#39;key_release_event&#39;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_onKeyRelease</span><span class="p">),</span>
+                <span class="n">canvas</span><span class="o">.</span><span class="n">mpl_connect</span><span class="p">(</span><span class="s">&#39;scroll_event&#39;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_onScroll</span><span class="p">)</span>
+            <span class="p">]</span>
+        <span class="k">except</span><span class="p">:</span>
+            <span class="c">#print &quot;bypassing scroll_event: wrong matplotlib version&quot;</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">_connections</span> <span class="o">=</span> <span class="p">[</span>
+                <span class="n">canvas</span><span class="o">.</span><span class="n">mpl_connect</span><span class="p">(</span><span class="s">&#39;motion_notify_event&#39;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_onMotion</span><span class="p">),</span>
+                <span class="n">canvas</span><span class="o">.</span><span class="n">mpl_connect</span><span class="p">(</span><span class="s">&#39;button_press_event&#39;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_onClick</span><span class="p">),</span>
+                <span class="n">canvas</span><span class="o">.</span><span class="n">mpl_connect</span><span class="p">(</span><span class="s">&#39;button_release_event&#39;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_onRelease</span><span class="p">),</span>
+                <span class="n">canvas</span><span class="o">.</span><span class="n">mpl_connect</span><span class="p">(</span><span class="s">&#39;key_press_event&#39;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_onKey</span><span class="p">),</span>
+                <span class="n">canvas</span><span class="o">.</span><span class="n">mpl_connect</span><span class="p">(</span><span class="s">&#39;key_release_event&#39;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_onKeyRelease</span><span class="p">),</span>
+            <span class="p">]</span>
+        <span class="c"># Turn off picker if it hasn&#39;t already been done</span>
+        <span class="k">try</span><span class="p">:</span>
+            <span class="n">canvas</span><span class="o">.</span><span class="n">mpl_disconnect</span><span class="p">(</span><span class="n">canvas</span><span class="o">.</span><span class="n">button_pick_id</span><span class="p">)</span>
+            <span class="n">canvas</span><span class="o">.</span><span class="n">mpl_disconnect</span><span class="p">(</span><span class="n">canvas</span><span class="o">.</span><span class="n">scroll_pick_id</span><span class="p">)</span>
+        <span class="k">except</span><span class="p">:</span> 
+            <span class="k">pass</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">canvas</span> <span class="o">=</span> <span class="n">canvas</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">figure</span> <span class="o">=</span> <span class="n">figure</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">clearall</span><span class="p">()</span>
+        
+<div class="viewcode-block" id="BindArtist.clear"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.binder.BindArtist.clear">[docs]</a>    <span class="k">def</span> <span class="nf">clear</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">artists</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        self.clear(h1,h2,...)</span>
+<span class="sd">            Remove connections for artists h1, h2, ...</span>
+<span class="sd">            </span>
+<span class="sd">        Use clearall() to reset all connections.</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">for</span> <span class="n">h</span> <span class="ow">in</span> <span class="n">artists</span><span class="p">:</span>
+            <span class="k">for</span> <span class="n">a</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">events</span><span class="p">:</span>
+                <span class="k">if</span> <span class="n">h</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_actions</span><span class="p">[</span><span class="n">a</span><span class="p">]:</span>
+                    <span class="k">del</span> <span class="bp">self</span><span class="o">.</span><span class="n">_actions</span><span class="p">[</span><span class="n">a</span><span class="p">][</span><span class="n">h</span><span class="p">]</span>
+            <span class="k">if</span> <span class="n">h</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_artists</span><span class="p">:</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">_artists</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">h</span><span class="p">)</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_current</span><span class="o">.</span><span class="n">artist</span> <span class="ow">in</span> <span class="n">artists</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">_current</span> <span class="o">=</span> <span class="n">Selection</span><span class="p">()</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_hasclick</span><span class="o">.</span><span class="n">artist</span> <span class="ow">in</span> <span class="n">artists</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">_hasclick</span> <span class="o">=</span> <span class="n">Selection</span><span class="p">()</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_haskey</span><span class="o">.</span><span class="n">artist</span> <span class="ow">in</span> <span class="n">artists</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">_haskey</span> <span class="o">=</span> <span class="n">Selection</span><span class="p">()</span>
+        </div>
+<div class="viewcode-block" id="BindArtist.clearall"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.binder.BindArtist.clearall">[docs]</a>    <span class="k">def</span> <span class="nf">clearall</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Clear connections to all artists.</span>
+<span class="sd">        </span>
+<span class="sd">        Use clear(h1,h2,...) to reset specific artists.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># Don&#39;t monitor any actions</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_actions</span> <span class="o">=</span> <span class="p">{}</span>
+        <span class="k">for</span> <span class="n">action</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">events</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">_actions</span><span class="p">[</span><span class="n">action</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span>
+        <span class="c"># Need activity state</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_artists</span> <span class="o">=</span> <span class="p">[]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_current</span> <span class="o">=</span> <span class="n">Selection</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_hasclick</span> <span class="o">=</span> <span class="n">Selection</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_haskey</span> <span class="o">=</span> <span class="n">Selection</span><span class="p">()</span>
+</div>
+<div class="viewcode-block" id="BindArtist.disconnect"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.binder.BindArtist.disconnect">[docs]</a>    <span class="k">def</span> <span class="nf">disconnect</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        In case we need to disconnect from the canvas...</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">try</span><span class="p">:</span> 
+            <span class="k">for</span> <span class="n">cid</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_connections</span><span class="p">:</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">mpl_disconnect</span><span class="p">(</span><span class="n">cid</span><span class="p">)</span>
+        <span class="k">except</span><span class="p">:</span> 
+            <span class="k">pass</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_connections</span> <span class="o">=</span> <span class="p">[]</span>
+</div>
+    <span class="k">def</span> <span class="nf">__del__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">disconnect</span><span class="p">()</span>
+
+    <span class="k">def</span> <span class="nf">__call__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">trigger</span><span class="p">,</span> <span class="n">artist</span><span class="p">,</span> <span class="n">action</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;Register a callback for an artist to a particular trigger event.</span>
+<span class="sd">        </span>
+<span class="sd">        usage:</span>
+<span class="sd">            self.connect(eventname,artist,action)</span>
+<span class="sd">    </span>
+<span class="sd">        where:</span>
+<span class="sd">            eventname is a string</span>
+<span class="sd">            artist is the particular graph object to respond to the event</span>
+<span class="sd">            action(event,**kw) is called when the event is triggered</span>
+
+<span class="sd">        The action callback is associated with particular artists.</span>
+<span class="sd">        Different artists will have different kwargs.  See documentation</span>
+<span class="sd">        on the contains() method for each artist.  One common properties</span>
+<span class="sd">        are ind for the index of the item under the cursor, which is</span>
+<span class="sd">        returned by Line2D and by collections.</span>
+
+<span class="sd">        The following events are supported:</span>
+<span class="sd">            enter: mouse cursor moves into the artist or to a new index</span>
+<span class="sd">            leave: mouse cursor leaves the artist</span>
+<span class="sd">            click: mouse button pressed on the artist</span>
+<span class="sd">            drag: mouse button pressed on the artist and cursor moves</span>
+<span class="sd">            release: mouse button released for the artist</span>
+<span class="sd">            key: key pressed when mouse is on the artist</span>
+<span class="sd">            keyrelease: key released for the artist</span>
+<span class="sd">    </span>
+<span class="sd">        The event received by action has a number of attributes:</span>
+<span class="sd">            name is the event name which was triggered</span>
+<span class="sd">            artist is the object which triggered the event</span>
+<span class="sd">            x,y are the screen coordinates of the mouse</span>
+<span class="sd">            xdata,ydata are the graph coordinates of the mouse</span>
+<span class="sd">            button is the mouse button being pressed/released</span>
+<span class="sd">            key is the key being pressed/released</span>
+<span class="sd">            shift,control,alt,meta are flags which are true if the</span>
+<span class="sd">                corresponding key is pressed at the time of the event.</span>
+<span class="sd">            details is a dictionary of artist specific details, such as the </span>
+<span class="sd">                id(s) of the point that were clicked.</span>
+<span class="sd">                </span>
+<span class="sd">        When receiving an event, first check the modifier state to be</span>
+<span class="sd">        sure it applies.  E.g., the callback for &#39;press&#39; might be:</span>
+<span class="sd">            if event.button == 1 and event.shift: process Shift-click</span>
+
+<span class="sd">        :TODO: Only receive events with the correct modifiers (e.g., S-click,</span>
+<span class="sd">        :TODO:   or *-click for any modifiers).</span>
+<span class="sd">        :TODO: Only receive button events for the correct button (e.g., click1</span>
+<span class="sd">        :TODO:   release3, or dclick* for any button)</span>
+<span class="sd">        :TODO: Support virtual artist, so that and artist can be flagged as</span>
+<span class="sd">        :TODO:   having a tag list and receive the correct events</span>
+<span class="sd">        :TODO: Support virtual events for binding to button-3 vs shift button-1</span>
+<span class="sd">        :TODO:   without changing callback code</span>
+<span class="sd">        :TODO: Attach multiple callbacks to the same event?</span>
+<span class="sd">        :TODO: Clean up interaction with toolbar modes</span>
+<span class="sd">        :TODO: push/pushclear/pop context so that binding changes </span>
+<span class="sd">            for the duration</span>
+<span class="sd">        :TODO:   e.g., to support ? context sensitive help</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># Check that the trigger is valid</span>
+        <span class="k">if</span> <span class="n">trigger</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_actions</span><span class="p">:</span>
+            <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">,</span> <span class="s">&quot;</span><span class="si">%s</span><span class="s"> invalid --- valid triggers are </span><span class="si">%s</span><span class="s">&quot;</span> \
+                <span class="o">%</span> <span class="p">(</span><span class="n">trigger</span><span class="p">,</span> <span class="s">&quot;, &quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">events</span><span class="p">))</span>
+        <span class="c"># Register the trigger callback</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_actions</span><span class="p">[</span><span class="n">trigger</span><span class="p">][</span><span class="n">artist</span><span class="p">]</span> <span class="o">=</span> <span class="n">action</span>
+        <span class="c">#print &quot;==&gt; added&quot;,artist,[artist],&quot;to&quot;,trigger,&quot;:&quot;,</span>
+        <span class="c">#self._actions[trigger].keys()</span>
+        <span class="c"># Maintain a list of all artists</span>
+        <span class="k">if</span> <span class="n">artist</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_artists</span><span class="p">:</span> 
+            <span class="bp">self</span><span class="o">.</span><span class="n">_artists</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">artist</span><span class="p">)</span>
+
+<div class="viewcode-block" id="BindArtist.trigger"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.binder.BindArtist.trigger">[docs]</a>    <span class="k">def</span> <span class="nf">trigger</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">actor</span><span class="p">,</span> <span class="n">action</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Trigger a particular event for the artist.  Fallback to axes,</span>
+<span class="sd">        to figure, and to &#39;all&#39; if the event is not processed.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">if</span> <span class="n">action</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">events</span><span class="p">:</span>
+            <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">,</span> <span class="s">&quot;Trigger expects &quot;</span> <span class="o">+</span> <span class="s">&quot;, &quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">events</span><span class="p">)</span>
+        <span class="c"># Tag the event with modifiers</span>
+        <span class="k">for</span> <span class="n">mod</span> <span class="ow">in</span> <span class="p">(</span><span class="s">&#39;alt&#39;</span><span class="p">,</span> <span class="s">&#39;control&#39;</span><span class="p">,</span> <span class="s">&#39;shift&#39;</span><span class="p">,</span> <span class="s">&#39;meta&#39;</span><span class="p">):</span>
+            <span class="nb">setattr</span><span class="p">(</span><span class="n">ev</span><span class="p">,</span> <span class="n">mod</span><span class="p">,</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">mod</span><span class="p">))</span>
+        <span class="nb">setattr</span><span class="p">(</span><span class="n">ev</span><span class="p">,</span> <span class="s">&#39;artist&#39;</span><span class="p">,</span> <span class="bp">None</span><span class="p">)</span>
+        <span class="nb">setattr</span><span class="p">(</span><span class="n">ev</span><span class="p">,</span> <span class="s">&#39;action&#39;</span><span class="p">,</span> <span class="n">action</span><span class="p">)</span>
+        <span class="nb">setattr</span><span class="p">(</span><span class="n">ev</span><span class="p">,</span> <span class="s">&#39;prop&#39;</span><span class="p">,</span> <span class="p">{})</span>
+        <span class="c"># Fallback scheme. If the event does not return false, pass to parent.</span>
+        <span class="n">processed</span> <span class="o">=</span> <span class="bp">False</span>
+        <span class="n">artist</span><span class="p">,</span> <span class="n">prop</span> <span class="o">=</span> <span class="n">actor</span><span class="o">.</span><span class="n">artist</span><span class="p">,</span> <span class="n">actor</span><span class="o">.</span><span class="n">prop</span>
+        <span class="k">if</span> <span class="n">artist</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_actions</span><span class="p">[</span><span class="n">action</span><span class="p">]:</span>
+            <span class="n">ev</span><span class="o">.</span><span class="n">artist</span><span class="p">,</span> <span class="n">ev</span><span class="o">.</span><span class="n">prop</span> <span class="o">=</span> <span class="n">artist</span><span class="p">,</span> <span class="n">prop</span>
+            <span class="n">processed</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_actions</span><span class="p">[</span><span class="n">action</span><span class="p">][</span><span class="n">artist</span><span class="p">](</span><span class="n">ev</span><span class="p">)</span>
+        <span class="k">if</span> <span class="ow">not</span> <span class="n">processed</span> <span class="ow">and</span> <span class="n">ev</span><span class="o">.</span><span class="n">inaxes</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_actions</span><span class="p">[</span><span class="n">action</span><span class="p">]:</span>
+            <span class="n">ev</span><span class="o">.</span><span class="n">artist</span><span class="p">,</span> <span class="n">ev</span><span class="o">.</span><span class="n">prop</span> <span class="o">=</span> <span class="n">ev</span><span class="o">.</span><span class="n">inaxes</span><span class="p">,</span> <span class="p">{}</span>
+            <span class="n">processed</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_actions</span><span class="p">[</span><span class="n">action</span><span class="p">][</span><span class="n">ev</span><span class="o">.</span><span class="n">inaxes</span><span class="p">](</span><span class="n">ev</span><span class="p">)</span>
+        <span class="k">if</span> <span class="ow">not</span> <span class="n">processed</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">figure</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_actions</span><span class="p">[</span><span class="n">action</span><span class="p">]:</span>
+            <span class="n">ev</span><span class="o">.</span><span class="n">artist</span><span class="p">,</span> <span class="n">ev</span><span class="o">.</span><span class="n">prop</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">figure</span><span class="p">,</span> <span class="p">{}</span>
+            <span class="n">processed</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_actions</span><span class="p">[</span><span class="n">action</span><span class="p">][</span><span class="bp">self</span><span class="o">.</span><span class="n">figure</span><span class="p">](</span><span class="n">ev</span><span class="p">)</span>
+        <span class="k">if</span> <span class="ow">not</span> <span class="n">processed</span> <span class="ow">and</span> <span class="s">&#39;all&#39;</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_actions</span><span class="p">[</span><span class="n">action</span><span class="p">]:</span>
+            <span class="n">ev</span><span class="o">.</span><span class="n">artist</span><span class="p">,</span> <span class="n">ev</span><span class="o">.</span><span class="n">prop</span> <span class="o">=</span> <span class="bp">None</span><span class="p">,</span> <span class="p">{}</span>
+            <span class="n">processed</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_actions</span><span class="p">[</span><span class="n">action</span><span class="p">][</span><span class="s">&#39;all&#39;</span><span class="p">](</span><span class="n">ev</span><span class="p">)</span>
+        <span class="k">return</span> <span class="n">processed</span>
+</div>
+    <span class="k">def</span> <span class="nf">_find_current</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Find the artist who will receive the event.  Only search</span>
+<span class="sd">        registered artists.  All others are invisible to the mouse.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># TODO: sort by zorder of axes then by zorder within axes</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_artists</span><span class="o">.</span><span class="n">sort</span><span class="p">(</span><span class="nb">cmp</span><span class="o">=</span><span class="k">lambda</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">:</span> <span class="nb">cmp</span><span class="p">(</span><span class="n">y</span><span class="o">.</span><span class="n">zorder</span><span class="p">,</span> <span class="n">x</span><span class="o">.</span><span class="n">zorder</span><span class="p">))</span>
+        <span class="c"># print &quot;search&quot;,&quot; &quot;.join([str(h) for h in self._artists])</span>
+        <span class="n">found</span> <span class="o">=</span> <span class="n">Selection</span><span class="p">()</span>
+        <span class="c">#print &quot;searching in&quot;,self._artists</span>
+        <span class="k">for</span> <span class="n">artist</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_artists</span><span class="p">:</span>
+            <span class="c"># TODO: should contains() return false if invisible?</span>
+            <span class="k">if</span> <span class="ow">not</span> <span class="n">artist</span><span class="o">.</span><span class="n">get_visible</span><span class="p">():</span> 
+                <span class="k">continue</span>
+            <span class="c"># TODO: optimization - exclude artists not inaxes</span>
+            <span class="k">try</span><span class="p">:</span>
+                <span class="n">inside</span><span class="p">,</span><span class="n">prop</span> <span class="o">=</span> <span class="n">artist</span><span class="o">.</span><span class="n">contains</span><span class="p">(</span><span class="n">event</span><span class="p">)</span>
+            <span class="k">except</span><span class="p">:</span>
+                <span class="c"># Probably an old version of matplotlib</span>
+                <span class="n">inside</span> <span class="o">=</span> <span class="bp">False</span>
+            <span class="k">if</span> <span class="n">inside</span><span class="p">:</span>
+                <span class="n">found</span><span class="o">.</span><span class="n">artist</span><span class="p">,</span> <span class="n">found</span><span class="o">.</span><span class="n">prop</span> <span class="o">=</span> <span class="n">artist</span><span class="p">,</span> <span class="n">prop</span>
+                <span class="k">break</span>
+        <span class="c">#print &quot;found&quot;,found.artist</span>
+        
+        <span class="c"># TODO: how to check if prop is equal?</span>
+        <span class="k">if</span> <span class="n">found</span> <span class="o">!=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_current</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">trigger</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_current</span><span class="p">,</span> <span class="s">&#39;leave&#39;</span><span class="p">,</span> <span class="n">event</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">trigger</span><span class="p">(</span><span class="n">found</span><span class="p">,</span> <span class="s">&#39;enter&#39;</span><span class="p">,</span> <span class="n">event</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_current</span> <span class="o">=</span> <span class="n">found</span>
+        <span class="k">return</span> <span class="n">found</span>
+        
+    <span class="k">def</span> <span class="nf">_onMotion</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Track enter/leave/motion through registered artists; all</span>
+<span class="sd">        other artists are invisible.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c">## Can&#39;t kill double-click on motion since Windows produces</span>
+        <span class="c">## spurious motion events.</span>
+        <span class="c">#self._last_button = None</span>
+        
+        <span class="c"># Dibs on the motion event for the clicked artist</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_hasclick</span><span class="p">:</span>
+            <span class="c"># Make sure the x,y data use the coordinate system of the</span>
+            <span class="c"># artist rather than the default axes coordinates.</span>
+            
+            <span class="n">transform</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_hasclick</span><span class="o">.</span><span class="n">artist</span><span class="o">.</span><span class="n">get_transform</span><span class="p">()</span>
+            <span class="c">#x,y = event.xdata,event.ydata</span>
+            <span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="n">event</span><span class="o">.</span><span class="n">y</span>
+            <span class="k">try</span><span class="p">:</span>
+                <span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">transform</span><span class="o">.</span><span class="n">inverted</span><span class="p">()</span><span class="o">.</span><span class="n">transform_point</span><span class="p">((</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">))</span>
+
+            <span class="k">except</span><span class="p">:</span>
+                <span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">transform</span><span class="o">.</span><span class="n">inverse_xy_tup</span><span class="p">((</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">))</span>
+            <span class="n">event</span><span class="o">.</span><span class="n">xdata</span><span class="p">,</span> <span class="n">event</span><span class="o">.</span><span class="n">ydata</span> <span class="o">=</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">trigger</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_hasclick</span><span class="p">,</span> <span class="s">&#39;drag&#39;</span><span class="p">,</span> <span class="n">event</span><span class="p">)</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="n">found</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_find_current</span><span class="p">(</span><span class="n">event</span><span class="p">)</span>
+            <span class="c">#print &quot;found&quot;,found.artist</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">trigger</span><span class="p">(</span><span class="n">found</span><span class="p">,</span> <span class="s">&#39;motion&#39;</span><span class="p">,</span> <span class="n">event</span><span class="p">)</span>
+
+    <span class="k">def</span> <span class="nf">_onClick</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Process button click</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="kn">import</span> <span class="nn">time</span>
+        
+        <span class="c"># Check for double-click</span>
+        <span class="n">event_time</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span>
+        <span class="c">#print event_time,self._last_time,self.dclick_threshhold</span>
+        <span class="c">#print (event_time &gt; self._last_time + self.dclick_threshhold)</span>
+        <span class="c">#print event.button,self._last_button</span>
+        <span class="k">if</span> <span class="p">(</span><span class="n">event</span><span class="o">.</span><span class="n">button</span> <span class="o">!=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_last_button</span><span class="p">)</span> <span class="ow">or</span> \
+                <span class="p">(</span><span class="n">event_time</span> <span class="o">&gt;</span> <span class="bp">self</span><span class="o">.</span><span class="n">_last_time</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">dclick_threshhold</span><span class="p">):</span>
+            <span class="n">action</span> <span class="o">=</span> <span class="s">&#39;click&#39;</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="n">action</span> <span class="o">=</span> <span class="s">&#39;dclick&#39;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_last_button</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">button</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_last_time</span> <span class="o">=</span> <span class="n">event_time</span>
+        
+        <span class="c"># If an artist is already dragging, feed any additional button</span>
+        <span class="c"># presses to that artist.</span>
+        <span class="c"># TODO: do we want to force a single button model on the user?</span>
+        <span class="c"># TODO: that is, once a button is pressed, no other buttons</span>
+        <span class="c"># TODO: can come through?  I think this belongs in canvas, not here.</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_hasclick</span><span class="p">:</span>
+            <span class="n">found</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_hasclick</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="n">found</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_find_current</span><span class="p">(</span><span class="n">event</span><span class="p">)</span>
+        <span class="c">#print &quot;button %d pressed&quot;%event.button</span>
+        <span class="c"># Note: it seems like if &quot;click&quot; returns False then hasclick should</span>
+        <span class="c"># not be set.  The problem is that there are two reasons it can</span>
+        <span class="c"># return false: because there is no click action for this artist</span>
+        <span class="c"># or because the click action returned false.  A related problem</span>
+        <span class="c"># is that click actions will go to the canvas if there is no click</span>
+        <span class="c"># action for the artist, even if the artist has a drag. I&#39;ll leave</span>
+        <span class="c"># it to future maintainers to sort out this problem.  For now the</span>
+        <span class="c"># recommendation is that users should define click if they have</span>
+        <span class="c"># drag or release on the artist.</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">trigger</span><span class="p">(</span><span class="n">found</span><span class="p">,</span> <span class="n">action</span><span class="p">,</span> <span class="n">event</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_hasclick</span> <span class="o">=</span> <span class="n">found</span>
+
+    <span class="k">def</span> <span class="nf">_onDClick</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Process button double click</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># If an artist is already dragging, feed any additional button</span>
+        <span class="c"># presses to that artist.</span>
+        <span class="c"># TODO: do we want to force a single button model on the user?</span>
+        <span class="c"># TODO: that is, once a button is pressed, no other buttons</span>
+        <span class="c"># TODO: can come through?  I think this belongs in canvas, not here.</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_hasclick</span><span class="p">:</span>
+            <span class="n">found</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_hasclick</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="n">found</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_find_current</span><span class="p">(</span><span class="n">event</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">trigger</span><span class="p">(</span><span class="n">found</span><span class="p">,</span> <span class="s">&#39;dclick&#39;</span><span class="p">,</span> <span class="n">event</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_hasclick</span> <span class="o">=</span> <span class="n">found</span>
+
+    <span class="k">def</span> <span class="nf">_onRelease</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Process release release</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">trigger</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_hasclick</span><span class="p">,</span> <span class="s">&#39;release&#39;</span><span class="p">,</span> <span class="n">event</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_hasclick</span> <span class="o">=</span> <span class="n">Selection</span><span class="p">()</span>
+            
+    <span class="k">def</span> <span class="nf">_onKey</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Process key click</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># TODO: Do we really want keyboard focus separate from mouse focus?</span>
+        <span class="c"># TODO: Do we need an explicit focus command for keyboard?</span>
+        <span class="c"># TODO: Can we tab between items?</span>
+        <span class="c"># TODO: How do unhandled events get propogated to axes, figure and</span>
+        <span class="c"># TODO: finally to application?  Do we need to implement a full tags </span>
+        <span class="c"># TODO: architecture a la Tk?</span>
+        <span class="c"># TODO: Do modifiers cause a grab?  Does the artist see the modifiers?</span>
+        <span class="k">if</span> <span class="n">event</span><span class="o">.</span><span class="n">key</span> <span class="ow">in</span> <span class="p">(</span><span class="s">&#39;alt&#39;</span><span class="p">,</span> <span class="s">&#39;meta&#39;</span><span class="p">,</span> <span class="s">&#39;control&#39;</span><span class="p">,</span> <span class="s">&#39;shift&#39;</span><span class="p">):</span>
+            <span class="nb">setattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="o">.</span><span class="n">key</span><span class="p">,</span> <span class="bp">True</span><span class="p">)</span>
+            <span class="k">return</span>
+
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_haskey</span><span class="p">:</span>
+            <span class="n">found</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_haskey</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="n">found</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_find_current</span><span class="p">(</span><span class="n">event</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">trigger</span><span class="p">(</span><span class="n">found</span><span class="p">,</span> <span class="s">&#39;key&#39;</span><span class="p">,</span> <span class="n">event</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_haskey</span> <span class="o">=</span> <span class="n">found</span>
+    
+    <span class="k">def</span> <span class="nf">_onKeyRelease</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Process key release</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">if</span> <span class="n">event</span><span class="o">.</span><span class="n">key</span> <span class="ow">in</span> <span class="p">(</span><span class="s">&#39;alt&#39;</span><span class="p">,</span> <span class="s">&#39;meta&#39;</span><span class="p">,</span> <span class="s">&#39;control&#39;</span><span class="p">,</span> <span class="s">&#39;shift&#39;</span><span class="p">):</span>
+            <span class="nb">setattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="o">.</span><span class="n">key</span><span class="p">,</span> <span class="bp">False</span><span class="p">)</span>
+            <span class="k">return</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_haskey</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">trigger</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_haskey</span><span class="p">,</span> <span class="s">&#39;keyup&#39;</span><span class="p">,</span> <span class="n">event</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_haskey</span> <span class="o">=</span> <span class="n">Selection</span><span class="p">()</span>
+
+    <span class="k">def</span> <span class="nf">_onScroll</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Process scroll event</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">found</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_find_current</span><span class="p">(</span><span class="n">event</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">trigger</span><span class="p">(</span><span class="n">found</span><span class="p">,</span> <span class="s">&#39;scroll&#39;</span><span class="p">,</span> <span class="n">event</span><span class="p">)</span>
+</pre></div></div>
+
+          </div>
+        </div>
+      </div>
+      <div class="sphinxsidebar">
+        <div class="sphinxsidebarwrapper">
+<div id="searchbox" style="display: none">
+  <h3>Quick search</h3>
+    <form class="search" action="../../../../../search.html" method="get">
+      <input type="text" name="q" />
+      <input type="submit" value="Go" />
+      <input type="hidden" name="check_keywords" value="yes" />
+      <input type="hidden" name="area" value="default" />
+    </form>
+    <p class="searchtip" style="font-size: 90%">
+    Enter search terms or a module, class or function name.
+    </p>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+        </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" >sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>
+    <div class="footer">
+        &copy; Copyright 2013, The SasView Project.
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
+    </div>
+  </body>
+</html>
Index: _modules/sas/guiframe/local_perspectives/plotting/boxMask.html
===================================================================
--- _modules/sas/guiframe/local_perspectives/plotting/boxMask.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
+++ _modules/sas/guiframe/local_perspectives/plotting/boxMask.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
@@ -0,0 +1,346 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>sas.guiframe.local_perspectives.plotting.boxMask &mdash; SasView 3.0.0 documentation</title>
+    
+    <link rel="stylesheet" href="../../../../../_static/default.css" type="text/css" />
+    <link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '../../../../../',
+        VERSION:     '3.0.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="../../../../../_static/jquery.js"></script>
+    <script type="text/javascript" src="../../../../../_static/underscore.js"></script>
+    <script type="text/javascript" src="../../../../../_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <link rel="top" title="SasView 3.0.0 documentation" href="../../../../../index.html" />
+    <link rel="up" title="sas.guiframe" href="../../../guiframe.html" /> 
+  </head>
+  <body>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" accesskey="U">sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>  
+
+    <div class="document">
+      <div class="documentwrapper">
+        <div class="bodywrapper">
+          <div class="body">
+            
+  <h1>Source code for sas.guiframe.local_perspectives.plotting.boxMask</h1><div class="highlight"><pre>
+<span class="kn">import</span> <span class="nn">math</span>
+<span class="c">#import wx</span>
+<span class="c">#from copy import deepcopy</span>
+<span class="kn">from</span> <span class="nn">BaseInteractor</span> <span class="kn">import</span> <span class="n">_BaseInteractor</span>
+<span class="kn">from</span> <span class="nn">boxSum</span> <span class="kn">import</span> <span class="n">PointInteractor</span>
+<span class="kn">from</span> <span class="nn">boxSum</span> <span class="kn">import</span> <span class="n">VerticalDoubleLine</span>
+<span class="kn">from</span> <span class="nn">boxSum</span> <span class="kn">import</span> <span class="n">HorizontalDoubleLine</span>
+<span class="c">#from sas.guiframe.events import SlicerParamUpdateEvent</span>
+
+
+<span class="k">class</span> <span class="nc">BoxMask</span><span class="p">(</span><span class="n">_BaseInteractor</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    BoxMask Class: determine 2 rectangular area to find the pixel of</span>
+<div class="viewcode-block" id="BoxMask"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxMask.BoxMask">[docs]</a><span class="sd">    a Data inside of box. </span>
+<span class="sd">    </span>
+<span class="sd">    Uses PointerInteractor , VerticalDoubleLine,HorizontalDoubleLine.</span>
+<span class="sd">    </span>
+<span class="sd">    :param zorder:  Artists with lower zorder values are drawn first.</span>
+<span class="sd">    :param x_min: the minimum value of the x coordinate</span>
+<span class="sd">    :param x_max: the maximum value of the x coordinate</span>
+<span class="sd">    :param y_min: the minimum value of the y coordinate</span>
+<span class="sd">    :param y_max: the maximum value of the y coordinate</span>
+
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s">&#39;black&#39;</span><span class="p">,</span> <span class="n">zorder</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="n">side</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> 
+                   <span class="n">x_min</span><span class="o">=</span><span class="mf">0.008</span><span class="p">,</span> <span class="n">x_max</span><span class="o">=</span><span class="mf">0.008</span><span class="p">,</span> <span class="n">y_min</span><span class="o">=</span><span class="mf">0.0025</span><span class="p">,</span> <span class="n">y_max</span><span class="o">=</span><span class="mf">0.0025</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">_BaseInteractor</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="n">color</span><span class="p">)</span>
+        <span class="c">## class initialization</span>
+        <span class="c">## list of Boxmask markers</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">markers</span> <span class="o">=</span> <span class="p">[]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">axes</span> <span class="o">=</span> <span class="n">axes</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">mask</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">is_inside</span> <span class="o">=</span> <span class="n">side</span>
+        <span class="c">## connect the artist for the motion</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">connect</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">connect</span>
+        <span class="c">## when qmax is reached the selected line is reset </span>
+        <span class="c">#the its previous value</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">qmax</span> <span class="o">=</span> <span class="nb">min</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmax</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmin</span><span class="p">)</span>
+        <span class="c">## Define the box limits</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">xmin</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span> <span class="o">*</span> <span class="mf">0.5</span> <span class="o">*</span> <span class="nb">min</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmax</span><span class="p">),</span>
+                                 <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmin</span><span class="p">))</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">ymin</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span> <span class="o">*</span> <span class="mf">0.5</span> <span class="o">*</span> <span class="nb">min</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmax</span><span class="p">),</span>
+                                   <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmin</span><span class="p">))</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">xmax</span> <span class="o">=</span> <span class="mf">0.5</span> <span class="o">*</span> <span class="nb">min</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmax</span><span class="p">),</span>
+                              <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmin</span><span class="p">))</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">ymax</span> <span class="o">=</span>  <span class="mf">0.5</span> <span class="o">*</span> <span class="nb">min</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmax</span><span class="p">),</span>
+                               <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmin</span><span class="p">))</span>
+        <span class="c">## center of the box</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">center_x</span> <span class="o">=</span> <span class="mf">0.0002</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">center_y</span> <span class="o">=</span> <span class="mf">0.0003</span>
+        <span class="c">## Number of points on the plot</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">nbins</span> <span class="o">=</span> <span class="mi">20</span>
+        <span class="c">## Define initial result the summation </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">count</span> <span class="o">=</span> <span class="mi">0</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">error</span> <span class="o">=</span> <span class="mi">0</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data</span>
+        <span class="c">## Flag to determine if the current figure has moved</span>
+        <span class="c">## set to False == no motion , set to True== motion</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">has_move</span> <span class="o">=</span> <span class="bp">False</span>
+        <span class="c">## Create Box edges </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span> <span class="o">=</span> <span class="n">HorizontalDoubleLine</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
+                                                     <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">subplot</span><span class="p">,</span>
+                                                     <span class="n">color</span><span class="o">=</span><span class="s">&#39;blue&#39;</span><span class="p">,</span>
+                                                      <span class="n">zorder</span><span class="o">=</span><span class="n">zorder</span><span class="p">,</span>
+                                                      <span class="n">y</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">ymax</span><span class="p">,</span>
+                                                      <span class="n">x</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">xmax</span><span class="p">,</span>
+                                                      <span class="n">center_x</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">center_x</span><span class="p">,</span>
+                                                      <span class="n">center_y</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">center_y</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">qmax</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">qmax</span>
+        
+        <span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span> <span class="o">=</span> <span class="n">VerticalDoubleLine</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
+                                                <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">subplot</span><span class="p">,</span>
+                                                <span class="n">color</span><span class="o">=</span><span class="s">&#39;grey&#39;</span><span class="p">,</span>
+                                                <span class="n">zorder</span><span class="o">=</span><span class="n">zorder</span><span class="p">,</span>
+                                                <span class="n">y</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">ymax</span><span class="p">,</span>
+                                                <span class="n">x</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">xmax</span><span class="p">,</span>
+                                                <span class="n">center_x</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">center_x</span><span class="p">,</span>
+                                                <span class="n">center_y</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">center_y</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">qmax</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">qmax</span>
+        
+        <span class="bp">self</span><span class="o">.</span><span class="n">center</span> <span class="o">=</span> <span class="n">PointInteractor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
+                                      <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">subplot</span><span class="p">,</span><span class="n">color</span><span class="o">=</span><span class="s">&#39;grey&#39;</span><span class="p">,</span>
+                                    <span class="n">zorder</span><span class="o">=</span><span class="n">zorder</span><span class="p">,</span>
+                                    <span class="n">center_x</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">center_x</span><span class="p">,</span>
+                                    <span class="n">center_y</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">center_y</span><span class="p">)</span>
+        <span class="c">## Save the name of the slicer panel associate with this slicer </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">panel_name</span> <span class="o">=</span> <span class="s">&quot;&quot;</span>    
+        <span class="c">## Update and post slicer parameters  </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_post_data</span><span class="p">()</span>
+    
+    <span class="k">def</span> <span class="nf">clear</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Clear the slicer and all connected events related to this slicer</span>
+<div class="viewcode-block" id="BoxMask.clear"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxMask.BoxMask.clear">[docs]</a><span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">clear_markers</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">center</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">connect</span><span class="o">.</span><span class="n">clearall</span><span class="p">()</span>
+        <span class="c">#self.base.Unbind(EVT_SLICER_PARS)</span>
+    
+    <span class="k">def</span> <span class="nf">update</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Respond to changes in the model by recalculating the profiles and</span></div>
+<div class="viewcode-block" id="BoxMask.update"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxMask.BoxMask.update">[docs]</a><span class="sd">        resetting the widgets.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># check if the center point has moved and update the figure accordingly </span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">center</span><span class="o">.</span><span class="n">has_move</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">center</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">center</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">center</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">center</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">center</span><span class="p">)</span>
+        <span class="c">## check if the horizontal lines have moved and update</span>
+        <span class="c"># the figure accordingly    </span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">has_move</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">y1</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">y1</span><span class="p">,</span>
+                                       <span class="n">y2</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">y2</span><span class="p">,</span>
+                                       <span class="n">height</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">half_height</span><span class="p">)</span>
+        <span class="c">## check if the vertical lines have moved and update</span>
+        <span class="c"># the figure accordingly    </span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">has_move</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">x1</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">x1</span><span class="p">,</span>
+                                         <span class="n">x2</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">x2</span><span class="p">,</span>
+                                         <span class="n">width</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">half_width</span><span class="p">)</span>
+        <span class="c">#if self.is_inside != None:</span>
+        <span class="n">out</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_post_data</span><span class="p">()</span>
+        <span class="k">return</span> <span class="n">out</span>
+        
+    <span class="k">def</span> <span class="nf">save</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Remember the roughness for this layer and the next so that we</span></div>
+<div class="viewcode-block" id="BoxMask.save"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxMask.BoxMask.save">[docs]</a><span class="sd">        can restore on Esc.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">freeze_axes</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">save</span><span class="p">(</span><span class="n">ev</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">save</span><span class="p">(</span><span class="n">ev</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">center</span><span class="o">.</span><span class="n">save</span><span class="p">(</span><span class="n">ev</span><span class="p">)</span>
+        
+    <span class="k">def</span> <span class="nf">_post_data</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Get the limits of the boxsum and compute the sum of the pixel</span></div>
+<span class="sd">        contained in that region and the error on that sum</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="kn">from</span> <span class="nn">sas.dataloader.manipulations</span> <span class="kn">import</span> <span class="n">Boxcut</span>
+        <span class="c">## Data 2D for which the pixel will be summed</span>
+        <span class="n">data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data</span>
+        <span class="n">mask</span> <span class="o">=</span> <span class="n">data</span><span class="o">.</span><span class="n">mask</span>
+        <span class="c">## the region of the summation</span>
+        <span class="n">x_min</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">x2</span> 
+        <span class="n">x_max</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">x1</span> 
+        <span class="n">y_min</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">y2</span>
+        <span class="n">y_max</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">y1</span>
+        <span class="n">mask</span> <span class="o">=</span> <span class="n">Boxcut</span><span class="p">(</span><span class="n">x_min</span><span class="o">=</span><span class="n">x_min</span><span class="p">,</span> <span class="n">x_max</span><span class="o">=</span><span class="n">x_max</span><span class="p">,</span> <span class="n">y_min</span><span class="o">=</span><span class="n">y_min</span><span class="p">,</span> <span class="n">y_max</span><span class="o">=</span><span class="n">y_max</span><span class="p">)</span>
+
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_inside</span><span class="p">:</span>
+            <span class="n">out</span> <span class="o">=</span> <span class="p">(</span><span class="n">mask</span><span class="p">(</span><span class="n">data</span><span class="p">)</span> <span class="o">==</span> <span class="bp">False</span><span class="p">)</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="n">out</span> <span class="o">=</span> <span class="p">(</span><span class="n">mask</span><span class="p">(</span><span class="n">data</span><span class="p">))</span>
+        <span class="c">#self.base.data.mask=out</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">mask</span> <span class="o">=</span> <span class="n">mask</span>
+        <span class="k">return</span> <span class="n">out</span>  
+              
+    <span class="k">def</span> <span class="nf">moveend</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        After a dragging motion this function is called to compute</span>
+<div class="viewcode-block" id="BoxMask.moveend"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxMask.BoxMask.moveend">[docs]</a><span class="sd">        the error and the sum of pixel of a given data 2D </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">thaw_axes</span><span class="p">()</span>
+        <span class="c">## post</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_post_data</span><span class="p">()</span>
+            
+    <span class="k">def</span> <span class="nf">restore</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Restore the roughness for this layer.</span></div>
+<div class="viewcode-block" id="BoxMask.restore"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxMask.BoxMask.restore">[docs]</a><span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">restore</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">restore</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">center</span><span class="o">.</span><span class="n">restore</span><span class="p">()</span>
+        
+    <span class="k">def</span> <span class="nf">move</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Process move to a new position, making sure that the move is allowed.</span></div>
+<div class="viewcode-block" id="BoxMask.move"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxMask.BoxMask.move">[docs]</a><span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">pass</span>
+    
+    <span class="k">def</span> <span class="nf">set_cursor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">):</span>
+        <span class="k">pass</span>
+        </div>
+<div class="viewcode-block" id="BoxMask.set_cursor"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxMask.BoxMask.set_cursor">[docs]</a>    <span class="k">def</span> <span class="nf">get_params</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Store a copy of values of parameters of the slicer into a dictionary.</span></div>
+<div class="viewcode-block" id="BoxMask.get_params"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxMask.BoxMask.get_params">[docs]</a><span class="sd">        </span>
+<span class="sd">        :return params: the dictionary created</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">params</span> <span class="o">=</span> <span class="p">{}</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;Width&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">half_width</span><span class="p">)</span> <span class="o">*</span> <span class="mi">2</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;Height&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">half_height</span><span class="p">)</span> <span class="o">*</span> <span class="mi">2</span> 
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;center_x&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">center</span><span class="o">.</span><span class="n">x</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;center_y&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">center</span><span class="o">.</span><span class="n">y</span>
+        <span class="k">return</span> <span class="n">params</span>
+    
+    <span class="k">def</span> <span class="nf">get_mask</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        return mask as a result of boxcut</span></div>
+<div class="viewcode-block" id="BoxMask.get_mask"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxMask.BoxMask.get_mask">[docs]</a><span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">mask</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">mask</span>
+        <span class="k">return</span> <span class="n">mask</span>
+    
+    <span class="k">def</span> <span class="nf">set_params</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">params</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Receive a dictionary and reset the slicer with values contained </span></div>
+<div class="viewcode-block" id="BoxMask.set_params"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxMask.BoxMask.set_params">[docs]</a><span class="sd">        in the values of the dictionary.</span>
+<span class="sd">        </span>
+<span class="sd">        :param params: a dictionary containing name of slicer parameters and </span>
+<span class="sd">           values the user assigned to the slicer.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">x_max</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="n">params</span><span class="p">[</span><span class="s">&quot;Width&quot;</span><span class="p">]</span> <span class="p">)</span><span class="o">/</span><span class="mi">2</span>
+        <span class="n">y_max</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="n">params</span><span class="p">[</span><span class="s">&quot;Height&quot;</span><span class="p">])</span><span class="o">/</span><span class="mi">2</span>
+        
+        <span class="bp">self</span><span class="o">.</span><span class="n">center_x</span> <span class="o">=</span> <span class="n">params</span><span class="p">[</span><span class="s">&quot;center_x&quot;</span><span class="p">]</span> 
+        <span class="bp">self</span><span class="o">.</span><span class="n">center_y</span> <span class="o">=</span> <span class="n">params</span><span class="p">[</span><span class="s">&quot;center_y&quot;</span><span class="p">]</span>
+        <span class="c">#update the slicer given values of params</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">center</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">center_x</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">center_x</span><span class="p">,</span> <span class="n">center_y</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">center_y</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">center</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">center</span><span class="p">,</span>
+                                     <span class="n">width</span><span class="o">=</span><span class="n">x_max</span><span class="p">,</span>
+                                     <span class="n">height</span><span class="o">=</span><span class="n">y_max</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">center</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">center</span><span class="p">,</span>
+                                    <span class="n">width</span><span class="o">=</span><span class="n">x_max</span><span class="p">,</span>
+                                    <span class="n">height</span><span class="o">=</span><span class="n">y_max</span><span class="p">)</span>
+        <span class="c">#compute the new error and sum given values of params</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_post_data</span><span class="p">()</span>
+               
+    <span class="k">def</span> <span class="nf">freeze_axes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">freeze_axes</span><span class="p">()</span>
+        </div>
+<div class="viewcode-block" id="BoxMask.freeze_axes"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxMask.BoxMask.freeze_axes">[docs]</a>    <span class="k">def</span> <span class="nf">thaw_axes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">thaw_axes</span><span class="p">()</span>
+</div>
+<div class="viewcode-block" id="BoxMask.thaw_axes"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxMask.BoxMask.thaw_axes">[docs]</a>    <span class="k">def</span> <span class="nf">draw</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+</div>
+<div class="viewcode-block" id="BoxMask.draw"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxMask.BoxMask.draw">[docs]</a><span class="k">class</span> <span class="nc">inner_BoxMask</span><span class="p">(</span><span class="n">BoxMask</span><span class="p">):</span>   
+    <span class="k">def</span> <span class="nf">__call__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>     
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">mask</span> <span class="o">=</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_post_data</span><span class="p">()</span><span class="o">==</span><span class="bp">False</span><span class="p">)</span></div></div>
+<div class="viewcode-block" id="inner_BoxMask"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxMask.inner_BoxMask">[docs]</a>      
+   
+</pre></div></div>
+
+          </div>
+        </div>
+      </div>
+      <div class="sphinxsidebar">
+        <div class="sphinxsidebarwrapper">
+<div id="searchbox" style="display: none">
+  <h3>Quick search</h3>
+    <form class="search" action="../../../../../search.html" method="get">
+      <input type="text" name="q" />
+      <input type="submit" value="Go" />
+      <input type="hidden" name="check_keywords" value="yes" />
+      <input type="hidden" name="area" value="default" />
+    </form>
+    <p class="searchtip" style="font-size: 90%">
+    Enter search terms or a module, class or function name.
+    </p>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+        </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" >sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>
+    <div class="footer">
+        &copy; Copyright 2013, The SasView Project.
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
+    </div>
+  </body>
+</html>
Index: _modules/sas/guiframe/local_perspectives/plotting/boxSlicer.html
===================================================================
--- _modules/sas/guiframe/local_perspectives/plotting/boxSlicer.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
+++ _modules/sas/guiframe/local_perspectives/plotting/boxSlicer.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
@@ -0,0 +1,663 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>sas.guiframe.local_perspectives.plotting.boxSlicer &mdash; SasView 3.0.0 documentation</title>
+    
+    <link rel="stylesheet" href="../../../../../_static/default.css" type="text/css" />
+    <link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '../../../../../',
+        VERSION:     '3.0.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="../../../../../_static/jquery.js"></script>
+    <script type="text/javascript" src="../../../../../_static/underscore.js"></script>
+    <script type="text/javascript" src="../../../../../_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <link rel="top" title="SasView 3.0.0 documentation" href="../../../../../index.html" />
+    <link rel="up" title="sas.guiframe" href="../../../guiframe.html" /> 
+  </head>
+  <body>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" accesskey="U">sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>  
+
+    <div class="document">
+      <div class="documentwrapper">
+        <div class="bodywrapper">
+          <div class="body">
+            
+  <h1>Source code for sas.guiframe.local_perspectives.plotting.boxSlicer</h1><div class="highlight"><pre>
+<span class="kn">import</span> <span class="nn">wx</span>
+<span class="c">#import copy</span>
+<span class="c">#from copy import deepcopy</span>
+<span class="kn">import</span> <span class="nn">math</span>
+<span class="kn">import</span> <span class="nn">numpy</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">NewPlotEvent</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">StatusEvent</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">SlicerParameterEvent</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">EVT_SLICER_PARS</span>
+<span class="kn">from</span> <span class="nn">BaseInteractor</span> <span class="kn">import</span> <span class="n">_BaseInteractor</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.dataFitting</span> <span class="kn">import</span> <span class="n">Data1D</span>
+<span class="c">#import SlicerParameters</span>
+
+
+<span class="k">class</span> <span class="nc">BoxInteractor</span><span class="p">(</span><span class="n">_BaseInteractor</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<div class="viewcode-block" id="BoxInteractor"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.BoxInteractor">[docs]</a><span class="sd">    BoxInteractor define a rectangle that return data1D average of Data2D</span>
+<span class="sd">    in a rectangle area defined by -x, x ,y, -y</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s">&#39;black&#39;</span><span class="p">,</span> <span class="n">zorder</span><span class="o">=</span><span class="mi">3</span><span class="p">):</span>
+        <span class="n">_BaseInteractor</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="n">color</span><span class="p">)</span>
+        <span class="c">## Class initialization</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">markers</span> <span class="o">=</span> <span class="p">[]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">axes</span> <span class="o">=</span> <span class="n">axes</span>
+        <span class="c">##connecting artist</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">connect</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">connect</span>
+        <span class="c">## which direction is the preferred interaction direction</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">direction</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="c">## determine x y  values</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">x</span> <span class="o">=</span> <span class="mf">0.5</span> <span class="o">*</span> <span class="nb">min</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmax</span><span class="p">),</span>
+                           <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmin</span><span class="p">))</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">y</span> <span class="o">=</span> <span class="mf">0.5</span> <span class="o">*</span> <span class="nb">min</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmax</span><span class="p">),</span>
+                           <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmin</span><span class="p">))</span>        
+        <span class="c">## when reach qmax reset the graph</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">qmax</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmax</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmin</span><span class="p">,</span>
+                        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">ymax</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">ymin</span><span class="p">)</span>   
+        <span class="c">## Number of points on the plot</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">nbins</span> <span class="o">=</span> <span class="mi">30</span>
+        <span class="c">## If True, I(|Q|) will be return, otherwise,</span>
+        <span class="c">#negative q-values are allowed</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">fold</span> <span class="o">=</span> <span class="bp">True</span>        
+        <span class="c">## reference of the current  Slab averaging</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">averager</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="c">## Create vertical and horizaontal lines for the rectangle</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span> <span class="o">=</span> <span class="n">VerticalLines</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
+                                            <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">subplot</span><span class="p">,</span> 
+                                            <span class="n">color</span><span class="o">=</span><span class="s">&#39;blue&#39;</span><span class="p">,</span> 
+                                            <span class="n">zorder</span><span class="o">=</span><span class="n">zorder</span><span class="p">,</span>
+                                            <span class="n">y</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">y</span> <span class="p">,</span>
+                                            <span class="n">x</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">qmax</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">qmax</span>
+       
+        <span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span> <span class="o">=</span> <span class="n">HorizontalLines</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
+                                               <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">subplot</span><span class="p">,</span>
+                                               <span class="n">color</span><span class="o">=</span><span class="s">&#39;green&#39;</span><span class="p">,</span> 
+                                               <span class="n">zorder</span><span class="o">=</span><span class="n">zorder</span><span class="p">,</span>
+                                               <span class="n">x</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">,</span>
+                                               <span class="n">y</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">y</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">qmax</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">qmax</span>
+        <span class="c">## draw the rectangle and plost the data 1D resulting</span>
+        <span class="c">## of averaging data2D</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_post_data</span><span class="p">()</span>
+        <span class="c">## Bind to slice parameter events</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">EVT_SLICER_PARS</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_onEVT_SLICER_PARS</span><span class="p">)</span>
+
+    <span class="k">def</span> <span class="nf">_onEVT_SLICER_PARS</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        receive an event containing parameters values to reset the slicer</span>
+<span class="sd">        </span>
+<span class="sd">        :param event: event of type SlicerParameterEvent with params as </span>
+<span class="sd">            attribute</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span>
+                     <span class="n">StatusEvent</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="s">&quot;BoxSlicer._onEVT_SLICER_PARS&quot;</span><span class="p">))</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">Skip</span><span class="p">()</span>
+        <span class="k">if</span> <span class="n">event</span><span class="o">.</span><span class="n">type</span> <span class="o">==</span> <span class="bp">self</span><span class="o">.</span><span class="n">__class__</span><span class="o">.</span><span class="n">__name__</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">set_params</span><span class="p">(</span><span class="n">event</span><span class="o">.</span><span class="n">params</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+            
+    <span class="k">def</span> <span class="nf">update_and_post</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<div class="viewcode-block" id="BoxInteractor.update_and_post"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.BoxInteractor.update_and_post">[docs]</a><span class="sd">        Update the slicer and plot the resulting data</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_post_data</span><span class="p">()</span>
+        
+    <span class="k">def</span> <span class="nf">set_layer</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">n</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="BoxInteractor.set_layer"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.BoxInteractor.set_layer">[docs]</a><span class="sd">        Allow adding plot to the same panel</span>
+<span class="sd">        </span>
+<span class="sd">        :param n: the number of layer</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">layernum</span> <span class="o">=</span> <span class="n">n</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        
+    <span class="k">def</span> <span class="nf">clear</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="BoxInteractor.clear"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.BoxInteractor.clear">[docs]</a><span class="sd">        Clear the slicer and all connected events related to this slicer</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">averager</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">clear_markers</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">connect</span><span class="o">.</span><span class="n">clearall</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">Unbind</span><span class="p">(</span><span class="n">EVT_SLICER_PARS</span><span class="p">)</span>
+        
+    <span class="k">def</span> <span class="nf">update</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="BoxInteractor.update"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.BoxInteractor.update">[docs]</a><span class="sd">        Respond to changes in the model by recalculating the profiles and</span>
+<span class="sd">        resetting the widgets.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c">##Update the slicer if an horizontal line is dragged   </span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">has_move</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">y</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">y</span><span class="p">)</span>
+        <span class="c">##Update the slicer if a vertical line is dragged    </span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">has_move</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">x</span><span class="p">)</span>
+                 
+    <span class="k">def</span> <span class="nf">save</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="BoxInteractor.save"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.BoxInteractor.save">[docs]</a><span class="sd">        Remember the roughness for this layer and the next so that we</span>
+<span class="sd">        can restore on Esc.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">freeze_axes</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">save</span><span class="p">(</span><span class="n">ev</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">save</span><span class="p">(</span><span class="n">ev</span><span class="p">)</span>
+    
+    <span class="k">def</span> <span class="nf">_post_data</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="k">pass</span></div>
+        
+    <span class="k">def</span> <span class="nf">post_data</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">new_slab</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">nbins</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">direction</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<div class="viewcode-block" id="BoxInteractor.post_data"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.BoxInteractor.post_data">[docs]</a><span class="sd">        post data averaging in Qx or Qy given new_slab type</span>
+<span class="sd">        </span>
+<span class="sd">        :param new_slab: slicer that determine with direction to average</span>
+<span class="sd">        :param nbins: the number of points plotted when averaging</span>
+<span class="sd">        :param direction: the direction of averaging</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">direction</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">direction</span> <span class="o">=</span> <span class="n">direction</span>
+            
+        <span class="n">x_min</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">x</span><span class="p">)</span>
+        <span class="n">x_max</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">x</span><span class="p">)</span>
+        <span class="n">y_min</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">y</span><span class="p">)</span>
+        <span class="n">y_max</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">y</span><span class="p">)</span>
+        
+        <span class="k">if</span> <span class="n">nbins</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">nbins</span> <span class="o">=</span> <span class="n">nbins</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">averager</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="k">if</span> <span class="n">new_slab</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
+                <span class="n">msg</span> <span class="o">=</span> <span class="s">&quot;post data:cannot average , averager is empty&quot;</span>
+                <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">,</span> <span class="n">msg</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">averager</span> <span class="o">=</span> <span class="n">new_slab</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">direction</span> <span class="o">==</span> <span class="s">&quot;X&quot;</span><span class="p">:</span>
+            <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">fold</span><span class="p">:</span>
+                <span class="n">x_low</span> <span class="o">=</span> <span class="mi">0</span>
+            <span class="k">else</span><span class="p">:</span>
+                <span class="n">x_low</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="n">x_min</span><span class="p">)</span>
+            <span class="n">bin_width</span> <span class="o">=</span> <span class="p">(</span><span class="n">x_max</span> <span class="o">+</span> <span class="n">x_low</span><span class="p">)</span><span class="o">/</span><span class="bp">self</span><span class="o">.</span><span class="n">nbins</span>
+        <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">direction</span> <span class="o">==</span> <span class="s">&quot;Y&quot;</span><span class="p">:</span>
+            <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">fold</span><span class="p">:</span>
+                <span class="n">y_low</span> <span class="o">=</span> <span class="mi">0</span>
+            <span class="k">else</span><span class="p">:</span>
+                <span class="n">y_low</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="n">y_min</span><span class="p">)</span>
+            <span class="n">bin_width</span> <span class="o">=</span> <span class="p">(</span><span class="n">y_max</span> <span class="o">+</span> <span class="n">y_low</span><span class="p">)</span><span class="o">/</span><span class="bp">self</span><span class="o">.</span><span class="n">nbins</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="n">msg</span> <span class="o">=</span> <span class="s">&quot;post data:no Box Average direction was supplied&quot;</span>
+            <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">,</span> <span class="n">msg</span>
+        <span class="c">## Average data2D given Qx or Qy</span>
+        <span class="n">box</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">averager</span><span class="p">(</span><span class="n">x_min</span><span class="o">=</span><span class="n">x_min</span><span class="p">,</span> <span class="n">x_max</span><span class="o">=</span><span class="n">x_max</span><span class="p">,</span> <span class="n">y_min</span><span class="o">=</span><span class="n">y_min</span><span class="p">,</span> <span class="n">y_max</span><span class="o">=</span><span class="n">y_max</span><span class="p">,</span>
+                         <span class="n">bin_width</span><span class="o">=</span><span class="n">bin_width</span><span class="p">)</span>
+        <span class="n">box</span><span class="o">.</span><span class="n">fold</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">fold</span>
+        <span class="n">boxavg</span> <span class="o">=</span> <span class="n">box</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="p">)</span>
+        <span class="c">#3 Create Data1D to plot</span>
+        <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">boxavg</span><span class="p">,</span> <span class="s">&quot;dxl&quot;</span><span class="p">):</span>
+            <span class="n">dxl</span> <span class="o">=</span> <span class="n">boxavg</span><span class="o">.</span><span class="n">dxl</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="n">dxl</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">boxavg</span><span class="p">,</span> <span class="s">&quot;dxw&quot;</span><span class="p">):</span>
+            <span class="n">dxw</span> <span class="o">=</span> <span class="n">boxavg</span><span class="o">.</span><span class="n">dxw</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="n">dxw</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="n">new_plot</span> <span class="o">=</span> <span class="n">Data1D</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="n">boxavg</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="n">boxavg</span><span class="o">.</span><span class="n">y</span><span class="p">,</span> <span class="n">dy</span><span class="o">=</span><span class="n">boxavg</span><span class="o">.</span><span class="n">dy</span><span class="p">)</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">dxl</span>  <span class="o">=</span> <span class="n">dxl</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">dxw</span>  <span class="o">=</span> <span class="n">dxw</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">averager</span><span class="o">.</span><span class="n">__name__</span><span class="p">)</span> <span class="o">+</span> \
+                        <span class="s">&quot;(&quot;</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">name</span> <span class="o">+</span> <span class="s">&quot;)&quot;</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">source</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">source</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">interactive</span> <span class="o">=</span> <span class="bp">True</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">detector</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">detector</span>
+        <span class="c">## If the data file does not tell us what the axes are, just assume...</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">xaxis</span><span class="p">(</span><span class="s">&quot;</span><span class="se">\\</span><span class="s">rm{Q}&quot;</span><span class="p">,</span> <span class="s">&quot;A^{-1}&quot;</span><span class="p">)</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">yaxis</span><span class="p">(</span><span class="s">&quot;</span><span class="se">\\</span><span class="s">rm{Intensity} &quot;</span><span class="p">,</span> <span class="s">&quot;cm^{-1}&quot;</span><span class="p">)</span>
+
+        <span class="n">data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span>
+        <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="s">&quot;scale&quot;</span><span class="p">)</span> <span class="ow">and</span> <span class="n">data</span><span class="o">.</span><span class="n">scale</span> <span class="o">==</span> <span class="s">&#39;linear&#39;</span> <span class="ow">and</span> \
+                <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">name</span><span class="o">.</span><span class="n">count</span><span class="p">(</span><span class="s">&quot;Residuals&quot;</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
+            <span class="n">new_plot</span><span class="o">.</span><span class="n">ytransform</span> <span class="o">=</span> <span class="s">&#39;y&#39;</span>
+            <span class="n">new_plot</span><span class="o">.</span><span class="n">yaxis</span><span class="p">(</span><span class="s">&quot;</span><span class="se">\\</span><span class="s">rm{Residuals} &quot;</span><span class="p">,</span> <span class="s">&quot;/&quot;</span><span class="p">)</span>
+            
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">group_id</span> <span class="o">=</span> <span class="s">&quot;2daverage&quot;</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">name</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">id</span> <span class="o">=</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">averager</span><span class="o">.</span><span class="n">__name__</span><span class="p">)</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">name</span>
+        <span class="n">new_plot</span><span class="o">.</span><span class="n">is_data</span><span class="o">=</span> <span class="bp">True</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">update_theory</span><span class="p">(</span><span class="n">data_id</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">id</span><span class="p">,</span> \
+                                       <span class="n">theory</span><span class="o">=</span><span class="n">new_plot</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> <span class="n">NewPlotEvent</span><span class="p">(</span><span class="n">plot</span><span class="o">=</span><span class="n">new_plot</span><span class="p">,</span>
+                                <span class="n">title</span><span class="o">=</span><span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">averager</span><span class="o">.</span><span class="n">__name__</span><span class="p">)))</span>
+          
+    <span class="k">def</span> <span class="nf">moveend</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="BoxInteractor.moveend"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.BoxInteractor.moveend">[docs]</a><span class="sd">        Called after a dragging event.</span>
+<span class="sd">        Post the slicer new parameters and creates a new Data1D </span>
+<span class="sd">        corresponding to the new average</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">thaw_axes</span><span class="p">()</span>
+        <span class="c"># Post paramters</span>
+        <span class="n">event</span> <span class="o">=</span> <span class="n">SlicerParameterEvent</span><span class="p">()</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">type</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">__class__</span><span class="o">.</span><span class="n">__name__</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">params</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_params</span><span class="p">()</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> <span class="n">event</span><span class="p">)</span>
+        <span class="c"># create the new data1D</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_post_data</span><span class="p">()</span>
+            
+    <span class="k">def</span> <span class="nf">restore</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="BoxInteractor.restore"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.BoxInteractor.restore">[docs]</a><span class="sd">        Restore the roughness for this layer.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">restore</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">restore</span><span class="p">()</span>
+       
+    <span class="k">def</span> <span class="nf">move</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="BoxInteractor.move"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.BoxInteractor.move">[docs]</a><span class="sd">        Process move to a new position, making sure that the move is allowed.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">pass</span>
+        
+    <span class="k">def</span> <span class="nf">set_cursor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">):</span>
+        <span class="k">pass</span></div>
+<div class="viewcode-block" id="BoxInteractor.set_cursor"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.BoxInteractor.set_cursor">[docs]</a>        
+    <span class="k">def</span> <span class="nf">get_params</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="BoxInteractor.get_params"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.BoxInteractor.get_params">[docs]</a><span class="sd">        Store a copy of values of parameters of the slicer into a dictionary.</span>
+<span class="sd">        </span>
+<span class="sd">        :return params: the dictionary created</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">params</span> <span class="o">=</span> <span class="p">{}</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;x_max&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">x</span><span class="p">)</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;y_max&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">y</span><span class="p">)</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;nbins&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">nbins</span>
+        <span class="k">return</span> <span class="n">params</span>
+    
+    <span class="k">def</span> <span class="nf">set_params</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">params</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="BoxInteractor.set_params"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.BoxInteractor.set_params">[docs]</a><span class="sd">        Receive a dictionary and reset the slicer with values contained </span>
+<span class="sd">        in the values of the dictionary.</span>
+<span class="sd">        </span>
+<span class="sd">        :param params: a dictionary containing name of slicer parameters and </span>
+<span class="sd">            values the user assigned to the slicer.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">x</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="n">params</span><span class="p">[</span><span class="s">&quot;x_max&quot;</span><span class="p">]))</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">y</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="n">params</span><span class="p">[</span><span class="s">&quot;y_max&quot;</span><span class="p">]</span> <span class="p">))</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">nbins</span> <span class="o">=</span> <span class="n">params</span><span class="p">[</span><span class="s">&quot;nbins&quot;</span><span class="p">]</span>
+        
+        <span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">y</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">y</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">post_data</span><span class="p">(</span><span class="n">nbins</span><span class="o">=</span><span class="bp">None</span><span class="p">)</span>
+        
+    <span class="k">def</span> <span class="nf">freeze_axes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="BoxInteractor.freeze_axes"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.BoxInteractor.freeze_axes">[docs]</a><span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">freeze_axes</span><span class="p">()</span>
+        
+    <span class="k">def</span> <span class="nf">thaw_axes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="BoxInteractor.thaw_axes"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.BoxInteractor.thaw_axes">[docs]</a><span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">thaw_axes</span><span class="p">()</span>
+
+    <span class="k">def</span> <span class="nf">draw</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="BoxInteractor.draw"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.BoxInteractor.draw">[docs]</a><span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">draw</span><span class="p">()</span>
+
+
+<span class="k">class</span> <span class="nc">HorizontalLines</span><span class="p">(</span><span class="n">_BaseInteractor</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span></div></div>
+<div class="viewcode-block" id="HorizontalLines"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.HorizontalLines">[docs]</a><span class="sd">    Draw 2 Horizontal lines centered on (0,0) that can move </span>
+<span class="sd">    on the x- direction and in opposite direction</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s">&#39;black&#39;</span><span class="p">,</span> <span class="n">zorder</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">x</span><span class="o">=</span><span class="mf">0.5</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="mf">0.5</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">_BaseInteractor</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="n">color</span><span class="p">)</span>
+        <span class="c">##Class initialization</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">markers</span> <span class="o">=</span> <span class="p">[]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">axes</span> <span class="o">=</span> <span class="n">axes</span>
+        <span class="c">## Saving the end points of two lines</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">x</span> <span class="o">=</span> <span class="n">x</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_x</span> <span class="o">=</span> <span class="n">x</span>
+        
+        <span class="bp">self</span><span class="o">.</span><span class="n">y</span> <span class="o">=</span> <span class="n">y</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_y</span> <span class="o">=</span> <span class="n">y</span>
+        <span class="c">## Creating a marker</span>
+        <span class="k">try</span><span class="p">:</span>
+            <span class="c"># Inner circle marker</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">inner_marker</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">plot</span><span class="p">([</span><span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">y</span><span class="p">],</span> <span class="n">linestyle</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">,</span>
+                                          <span class="n">marker</span><span class="o">=</span><span class="s">&#39;s&#39;</span><span class="p">,</span> <span class="n">markersize</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span>
+                                          <span class="n">color</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">color</span><span class="p">,</span> <span class="n">alpha</span><span class="o">=</span><span class="mf">0.6</span><span class="p">,</span>
+                                          <span class="n">pickradius</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s">&quot;pick&quot;</span><span class="p">,</span> 
+                                          <span class="c"># Prefer this to other lines</span>
+                                          <span class="n">zorder</span><span class="o">=</span><span class="n">zorder</span><span class="p">,</span> 
+                                          <span class="n">visible</span><span class="o">=</span><span class="bp">True</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+        <span class="k">except</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">inner_marker</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">plot</span><span class="p">([</span><span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">y</span><span class="p">],</span> <span class="n">linestyle</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">,</span>
+                                          <span class="n">marker</span><span class="o">=</span><span class="s">&#39;s&#39;</span><span class="p">,</span> <span class="n">markersize</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span>
+                                          <span class="n">color</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">color</span><span class="p">,</span> <span class="n">alpha</span><span class="o">=</span><span class="mf">0.6</span><span class="p">,</span>
+                                          <span class="n">label</span><span class="o">=</span><span class="s">&quot;pick&quot;</span><span class="p">,</span> <span class="n">visible</span><span class="o">=</span><span class="bp">True</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+            <span class="n">message</span>  <span class="o">=</span> <span class="s">&quot;</span><span class="se">\n</span><span class="s">THIS PROTOTYPE NEEDS THE LATEST VERSION &quot;</span>
+            <span class="n">message</span> <span class="o">+=</span> <span class="s">&quot;OF MATPLOTLIB</span><span class="se">\n</span><span class="s"> Get the SVN version that&quot;</span>
+            <span class="n">message</span> <span class="o">+=</span> <span class="s">&quot; is at least as recent as June 1, 2007&quot;</span>
+            <span class="n">owner</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">parent</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="n">owner</span><span class="p">,</span>
+                         <span class="n">StatusEvent</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="s">&quot;AnnulusSlicer: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">message</span><span class="p">))</span>
+        <span class="c">## Define 2 horizontal lines</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">top_line</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">plot</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">],</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">y</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">y</span><span class="p">],</span>
+                                      <span class="n">linestyle</span><span class="o">=</span><span class="s">&#39;-&#39;</span><span class="p">,</span> <span class="n">marker</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">,</span>
+                                      <span class="n">color</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">color</span><span class="p">,</span> <span class="n">visible</span><span class="o">=</span><span class="bp">True</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">bottom_line</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">plot</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">],</span> <span class="p">[</span><span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">y</span><span class="p">,</span> <span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">y</span><span class="p">],</span>
+                                      <span class="n">linestyle</span><span class="o">=</span><span class="s">&#39;-&#39;</span><span class="p">,</span> <span class="n">marker</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">,</span>
+                                      <span class="n">color</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">color</span><span class="p">,</span> <span class="n">visible</span><span class="o">=</span><span class="bp">True</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+        <span class="c">## Flag to check the motion of the lines</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">has_move</span> <span class="o">=</span> <span class="bp">False</span>
+        <span class="c">## Connecting markers to mouse events and draw</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">connect_markers</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">top_line</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">inner_marker</span><span class="p">])</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+
+    <span class="k">def</span> <span class="nf">set_layer</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">n</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<div class="viewcode-block" id="HorizontalLines.set_layer"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.HorizontalLines.set_layer">[docs]</a><span class="sd">        Allow adding plot to the same panel</span>
+<span class="sd">        </span>
+<span class="sd">        :param n: the number of layer</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">layernum</span> <span class="o">=</span> <span class="n">n</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        
+    <span class="k">def</span> <span class="nf">clear</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="HorizontalLines.clear"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.HorizontalLines.clear">[docs]</a><span class="sd">        Clear this slicer  and its markers</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">clear_markers</span><span class="p">()</span>
+        <span class="k">try</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">inner_marker</span><span class="o">.</span><span class="n">remove</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">top_line</span><span class="o">.</span><span class="n">remove</span><span class="p">()</span> 
+            <span class="bp">self</span><span class="o">.</span><span class="n">bottom_line</span><span class="o">.</span><span class="n">remove</span><span class="p">()</span>
+        <span class="k">except</span><span class="p">:</span>
+            <span class="c"># Old version of matplotlib</span>
+            <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">lines</span><span class="p">)):</span>
+                <span class="k">del</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">lines</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
+   
+    <span class="k">def</span> <span class="nf">update</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="HorizontalLines.update"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.HorizontalLines.update">[docs]</a><span class="sd">        Draw the new roughness on the graph.</span>
+<span class="sd">        </span>
+<span class="sd">        :param x: x-coordinates to reset current class x</span>
+<span class="sd">        :param y: y-coordinates to reset current class y</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c">## Reset x, y- coordinates if send as parameters</span>
+        <span class="k">if</span> <span class="n">x</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">x</span> <span class="o">=</span> <span class="n">numpy</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">)</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
+        <span class="k">if</span> <span class="n">y</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">y</span> <span class="o">=</span> <span class="n">numpy</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">y</span><span class="p">)</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="n">y</span><span class="p">)</span>
+        <span class="c">## Draw lines and markers</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">inner_marker</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">xdata</span><span class="o">=</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">ydata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">y</span><span class="p">])</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">top_line</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">xdata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">],</span> <span class="n">ydata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">y</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">y</span><span class="p">])</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">bottom_line</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">xdata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">,</span><span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">],</span> <span class="n">ydata</span><span class="o">=</span><span class="p">[</span><span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">y</span><span class="p">,</span> <span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">y</span><span class="p">])</span>
+        
+    <span class="k">def</span> <span class="nf">save</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="HorizontalLines.save"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.HorizontalLines.save">[docs]</a><span class="sd">        Remember the roughness for this layer and the next so that we</span>
+<span class="sd">        can restore on Esc.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_x</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">x</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_y</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">y</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">freeze_axes</span><span class="p">()</span>
+
+    <span class="k">def</span> <span class="nf">moveend</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="HorizontalLines.moveend"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.HorizontalLines.moveend">[docs]</a><span class="sd">        Called after a dragging this edge and set self.has_move to False</span>
+<span class="sd">        to specify the end of dragging motion</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">has_move</span> <span class="o">=</span> <span class="bp">False</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">moveend</span><span class="p">(</span><span class="n">ev</span><span class="p">)</span>
+             
+    <span class="k">def</span> <span class="nf">restore</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="HorizontalLines.restore"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.HorizontalLines.restore">[docs]</a><span class="sd">        Restore the roughness for this layer.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">x</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">save_x</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">y</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">save_y</span>
+        
+    <span class="k">def</span> <span class="nf">move</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="HorizontalLines.move"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.HorizontalLines.move">[docs]</a><span class="sd">        Process move to a new position, making sure that the move is allowed.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">y</span> <span class="o">=</span> <span class="n">y</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">has_move</span> <span class="o">=</span> <span class="bp">True</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        
+  
+<span class="k">class</span> <span class="nc">VerticalLines</span><span class="p">(</span><span class="n">_BaseInteractor</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span></div></div>
+<div class="viewcode-block" id="VerticalLines"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.VerticalLines">[docs]</a><span class="sd">    Select an annulus through a 2D plot</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s">&#39;black&#39;</span><span class="p">,</span> <span class="n">zorder</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">x</span><span class="o">=</span><span class="mf">0.5</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="mf">0.5</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">_BaseInteractor</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="n">color</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">markers</span> <span class="o">=</span> <span class="p">[]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">axes</span> <span class="o">=</span> <span class="n">axes</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">x</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_x</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">x</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">y</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="n">y</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_y</span> <span class="o">=</span> <span class="n">y</span>
+        <span class="k">try</span><span class="p">:</span>
+            <span class="c"># Inner circle marker</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">inner_marker</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">plot</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">],</span> <span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">linestyle</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">,</span>
+                                          <span class="n">marker</span><span class="o">=</span><span class="s">&#39;s&#39;</span><span class="p">,</span> <span class="n">markersize</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span>
+                                          <span class="n">color</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">color</span><span class="p">,</span> <span class="n">alpha</span><span class="o">=</span><span class="mf">0.6</span><span class="p">,</span>
+                                          <span class="n">pickradius</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s">&quot;pick&quot;</span><span class="p">,</span> 
+                                          <span class="c"># Prefer this to other lines</span>
+                                          <span class="n">zorder</span><span class="o">=</span><span class="n">zorder</span><span class="p">,</span> <span class="n">visible</span><span class="o">=</span><span class="bp">True</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+        <span class="k">except</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">inner_marker</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">plot</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">],</span> <span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">linestyle</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">,</span>
+                                          <span class="n">marker</span><span class="o">=</span><span class="s">&#39;s&#39;</span><span class="p">,</span> <span class="n">markersize</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span>
+                                          <span class="n">color</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">color</span><span class="p">,</span> <span class="n">alpha</span><span class="o">=</span><span class="mf">0.6</span><span class="p">,</span>
+                                          <span class="n">label</span><span class="o">=</span><span class="s">&quot;pick&quot;</span><span class="p">,</span> <span class="n">visible</span><span class="o">=</span><span class="bp">True</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+            <span class="n">message</span>  <span class="o">=</span> <span class="s">&quot;</span><span class="se">\n</span><span class="s">THIS PROTOTYPE NEEDS THE LATEST VERSION&quot;</span>
+            <span class="n">message</span> <span class="o">+=</span> <span class="s">&quot; OF MATPLOTLIB</span><span class="se">\n</span><span class="s"> Get the SVN version that is&quot;</span>
+            <span class="n">message</span> <span class="o">+=</span> <span class="s">&quot; at least as recent as June 1, 2007&quot;</span>
+            
+        <span class="bp">self</span><span class="o">.</span><span class="n">right_line</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">plot</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">],</span>
+                                         <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">y</span> <span class="p">,</span> <span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">y</span><span class="p">],</span>
+                                      <span class="n">linestyle</span><span class="o">=</span><span class="s">&#39;-&#39;</span><span class="p">,</span> <span class="n">marker</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">,</span>
+                                      <span class="n">color</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">color</span><span class="p">,</span> <span class="n">visible</span><span class="o">=</span><span class="bp">True</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">left_line</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">plot</span><span class="p">([</span><span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">],</span>
+                                        <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">y</span><span class="p">,</span> <span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">y</span><span class="p">],</span>
+                                      <span class="n">linestyle</span><span class="o">=</span><span class="s">&#39;-&#39;</span><span class="p">,</span> <span class="n">marker</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">,</span>
+                                      <span class="n">color</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">color</span><span class="p">,</span> <span class="n">visible</span><span class="o">=</span><span class="bp">True</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">has_move</span> <span class="o">=</span> <span class="bp">False</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">connect_markers</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">right_line</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">inner_marker</span><span class="p">])</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+
+    <span class="k">def</span> <span class="nf">set_layer</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">n</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<div class="viewcode-block" id="VerticalLines.set_layer"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.VerticalLines.set_layer">[docs]</a><span class="sd">        Allow adding plot to the same panel</span>
+<span class="sd">        </span>
+<span class="sd">        :param n: the number of layer</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">layernum</span> <span class="o">=</span> <span class="n">n</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        
+    <span class="k">def</span> <span class="nf">clear</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="VerticalLines.clear"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.VerticalLines.clear">[docs]</a><span class="sd">        Clear this slicer  and its markers</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">clear_markers</span><span class="p">()</span>
+        <span class="k">try</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">inner_marker</span><span class="o">.</span><span class="n">remove</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">remove</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">right_line</span><span class="o">.</span><span class="n">remove</span><span class="p">()</span>
+        <span class="k">except</span><span class="p">:</span>
+            <span class="c"># Old version of matplotlib</span>
+            <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">lines</span><span class="p">)):</span>
+                <span class="k">del</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">lines</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
+
+    <span class="k">def</span> <span class="nf">update</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="VerticalLines.update"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.VerticalLines.update">[docs]</a><span class="sd">        Draw the new roughness on the graph.</span>
+<span class="sd">        </span>
+<span class="sd">        :param x: x-coordinates to reset current class x</span>
+<span class="sd">        :param y: y-coordinates to reset current class y</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c">## reset x, y -coordinates if given as parameters</span>
+        <span class="k">if</span> <span class="n">x</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">x</span> <span class="o">=</span> <span class="n">numpy</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">)</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
+        <span class="k">if</span> <span class="n">y</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">y</span> <span class="o">=</span> <span class="n">numpy</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">y</span><span class="p">)</span> <span class="o">*</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="n">y</span><span class="p">)</span>
+        <span class="c">## draw lines and markers  </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">inner_marker</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">xdata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">],</span> <span class="n">ydata</span><span class="o">=</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> 
+        <span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">xdata</span><span class="o">=</span><span class="p">[</span><span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">],</span> <span class="n">ydata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">y</span><span class="p">,</span> <span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">y</span><span class="p">])</span> 
+        <span class="bp">self</span><span class="o">.</span><span class="n">right_line</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">xdata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">],</span> <span class="n">ydata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">y</span><span class="p">,</span> <span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">y</span><span class="p">])</span> 
+    
+    <span class="k">def</span> <span class="nf">save</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="VerticalLines.save"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.VerticalLines.save">[docs]</a><span class="sd">        Remember the roughness for this layer and the next so that we</span>
+<span class="sd">        can restore on Esc.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_x</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">x</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_y</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">y</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">freeze_axes</span><span class="p">()</span>
+        
+    <span class="k">def</span> <span class="nf">moveend</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="VerticalLines.moveend"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.VerticalLines.moveend">[docs]</a><span class="sd">        Called after a dragging this edge and set self.has_move to False</span>
+<span class="sd">        to specify the end of dragging motion</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">has_move</span> <span class="o">=</span> <span class="bp">False</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">moveend</span><span class="p">(</span><span class="n">ev</span><span class="p">)</span>
+               
+    <span class="k">def</span> <span class="nf">restore</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="VerticalLines.restore"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.VerticalLines.restore">[docs]</a><span class="sd">        Restore the roughness for this layer.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">x</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">save_x</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">y</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">save_y</span>
+      
+    <span class="k">def</span> <span class="nf">move</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="VerticalLines.move"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.VerticalLines.move">[docs]</a><span class="sd">        Process move to a new position, making sure that the move is allowed.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">has_move</span> <span class="o">=</span> <span class="bp">True</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">x</span> <span class="o">=</span> <span class="n">x</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        
+   
+<span class="k">class</span> <span class="nc">BoxInteractorX</span><span class="p">(</span><span class="n">BoxInteractor</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span></div></div>
+<div class="viewcode-block" id="BoxInteractorX"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.BoxInteractorX">[docs]</a><span class="sd">    Average in Qx direction</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s">&#39;black&#39;</span><span class="p">,</span> <span class="n">zorder</span><span class="o">=</span><span class="mi">3</span><span class="p">):</span>
+        <span class="n">BoxInteractor</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="n">color</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span> <span class="o">=</span> <span class="n">base</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_post_data</span><span class="p">()</span>
+        
+    <span class="k">def</span> <span class="nf">_post_data</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Post data creating by averaging in Qx direction</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="kn">from</span> <span class="nn">sas.dataloader.manipulations</span> <span class="kn">import</span> <span class="n">SlabX</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">post_data</span><span class="p">(</span><span class="n">SlabX</span><span class="p">,</span> <span class="n">direction</span><span class="o">=</span><span class="s">&quot;X&quot;</span><span class="p">)</span>   
+        
+
+<span class="k">class</span> <span class="nc">BoxInteractorY</span><span class="p">(</span><span class="n">BoxInteractor</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="BoxInteractorY"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSlicer.BoxInteractorY">[docs]</a><span class="sd">    Average in Qy direction</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s">&#39;black&#39;</span><span class="p">,</span> <span class="n">zorder</span><span class="o">=</span><span class="mi">3</span><span class="p">):</span>
+        <span class="n">BoxInteractor</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="n">color</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span> <span class="o">=</span> <span class="n">base</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_post_data</span><span class="p">()</span>
+        
+    <span class="k">def</span> <span class="nf">_post_data</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Post data creating by averaging in Qy direction</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="kn">from</span> <span class="nn">sas.dataloader.manipulations</span> <span class="kn">import</span> <span class="n">SlabY</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">post_data</span><span class="p">(</span><span class="n">SlabY</span><span class="p">,</span> <span class="n">direction</span><span class="o">=</span><span class="s">&quot;Y&quot;</span><span class="p">)</span>   
+        
+        
+</pre></div></div>
+
+          </div>
+        </div>
+      </div>
+      <div class="sphinxsidebar">
+        <div class="sphinxsidebarwrapper">
+<div id="searchbox" style="display: none">
+  <h3>Quick search</h3>
+    <form class="search" action="../../../../../search.html" method="get">
+      <input type="text" name="q" />
+      <input type="submit" value="Go" />
+      <input type="hidden" name="check_keywords" value="yes" />
+      <input type="hidden" name="area" value="default" />
+    </form>
+    <p class="searchtip" style="font-size: 90%">
+    Enter search terms or a module, class or function name.
+    </p>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+        </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" >sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>
+    <div class="footer">
+        &copy; Copyright 2013, The SasView Project.
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
+    </div>
+  </body>
+</html>
Index: _modules/sas/guiframe/local_perspectives/plotting/boxSum.html
===================================================================
--- _modules/sas/guiframe/local_perspectives/plotting/boxSum.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
+++ _modules/sas/guiframe/local_perspectives/plotting/boxSum.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
@@ -0,0 +1,879 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>sas.guiframe.local_perspectives.plotting.boxSum &mdash; SasView 3.0.0 documentation</title>
+    
+    <link rel="stylesheet" href="../../../../../_static/default.css" type="text/css" />
+    <link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '../../../../../',
+        VERSION:     '3.0.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="../../../../../_static/jquery.js"></script>
+    <script type="text/javascript" src="../../../../../_static/underscore.js"></script>
+    <script type="text/javascript" src="../../../../../_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <link rel="top" title="SasView 3.0.0 documentation" href="../../../../../index.html" />
+    <link rel="up" title="sas.guiframe" href="../../../guiframe.html" /> 
+  </head>
+  <body>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" accesskey="U">sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>  
+
+    <div class="document">
+      <div class="documentwrapper">
+        <div class="bodywrapper">
+          <div class="body">
+            
+  <h1>Source code for sas.guiframe.local_perspectives.plotting.boxSum</h1><div class="highlight"><pre>
+<span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Boxsum Class: determine 2 rectangular area to compute </span>
+<span class="sd">    the sum of pixel of a Data. </span>
+<span class="sd">&quot;&quot;&quot;</span>
+<span class="kn">import</span> <span class="nn">math</span>
+<span class="kn">import</span> <span class="nn">wx</span>
+<span class="kn">from</span> <span class="nn">BaseInteractor</span> <span class="kn">import</span> <span class="n">_BaseInteractor</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">SlicerParamUpdateEvent</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">EVT_SLICER_PARS</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">StatusEvent</span>
+
+
+<div class="viewcode-block" id="BoxSum"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.BoxSum">[docs]</a><span class="k">class</span> <span class="nc">BoxSum</span><span class="p">(</span><span class="n">_BaseInteractor</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Boxsum Class: determine 2 rectangular area to compute </span>
+<span class="sd">        the sum of pixel of a Data. </span>
+<span class="sd">        Uses PointerInteractor , VerticalDoubleLine,HorizontalDoubleLine.</span>
+<span class="sd">        @param zorder:  Artists with lower zorder values are drawn first.</span>
+<span class="sd">        @param x_min: the minimum value of the x coordinate</span>
+<span class="sd">        @param x_max: the maximum value of the x coordinate</span>
+<span class="sd">        @param y_min: the minimum value of the y coordinate</span>
+<span class="sd">        @param y_max: the maximum value of the y coordinate</span>
+
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s">&#39;black&#39;</span><span class="p">,</span> <span class="n">zorder</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="n">x_min</span><span class="o">=</span><span class="mf">0.008</span><span class="p">,</span>
+                  <span class="n">x_max</span><span class="o">=</span><span class="mf">0.008</span><span class="p">,</span> <span class="n">y_min</span><span class="o">=</span><span class="mf">0.0025</span><span class="p">,</span> <span class="n">y_max</span><span class="o">=</span><span class="mf">0.0025</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">_BaseInteractor</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="n">color</span><span class="p">)</span>
+        <span class="c">## class initialization</span>
+        <span class="c">## list of Boxsmun markers</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">markers</span> <span class="o">=</span> <span class="p">[]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">axes</span> <span class="o">=</span> <span class="n">axes</span>
+        <span class="c">## connect the artist for the motion</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">connect</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">connect</span>
+        <span class="c">## when qmax is reached the selected line is reset the its previous value</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">qmax</span> <span class="o">=</span> <span class="nb">min</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmax</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmin</span><span class="p">)</span>
+        <span class="c">## Define the boxsum limits</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">xmin</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span> <span class="o">*</span> <span class="mf">0.5</span> <span class="o">*</span> <span class="nb">min</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmax</span><span class="p">),</span>
+                                  <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmin</span><span class="p">))</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">ymin</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span> <span class="o">*</span> <span class="mf">0.5</span> <span class="o">*</span> <span class="nb">min</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmax</span><span class="p">),</span>
+                                  <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmin</span><span class="p">))</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">xmax</span> <span class="o">=</span> <span class="mf">0.5</span> <span class="o">*</span> <span class="nb">min</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmax</span><span class="p">),</span>
+                              <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmin</span><span class="p">))</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">ymax</span> <span class="o">=</span> <span class="mf">0.5</span> <span class="o">*</span> <span class="nb">min</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmax</span><span class="p">),</span>
+                              <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="o">.</span><span class="n">xmin</span><span class="p">))</span>
+        <span class="c">## center of the boxSum</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">center_x</span> <span class="o">=</span> <span class="mf">0.0002</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">center_y</span> <span class="o">=</span> <span class="mf">0.0003</span>
+        <span class="c">## Number of points on the plot</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">nbins</span> <span class="o">=</span> <span class="mi">20</span>
+        <span class="c">## Define initial result the summation </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">count</span> <span class="o">=</span> <span class="mi">0</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">error</span> <span class="o">=</span> <span class="mi">0</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">total</span> <span class="o">=</span> <span class="mi">0</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">totalerror</span> <span class="o">=</span> <span class="mi">0</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">points</span> <span class="o">=</span> <span class="mi">0</span>
+        <span class="c">## Flag to determine if the current figure has moved</span>
+        <span class="c">## set to False == no motion , set to True== motion</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">has_move</span> <span class="o">=</span> <span class="bp">False</span>
+        <span class="c">## Create Boxsum edges </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span> <span class="o">=</span> <span class="n">HorizontalDoubleLine</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
+                                                    <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">subplot</span><span class="p">,</span>
+                                                    <span class="n">color</span><span class="o">=</span><span class="s">&#39;blue&#39;</span><span class="p">,</span>
+                                                      <span class="n">zorder</span><span class="o">=</span><span class="n">zorder</span><span class="p">,</span>
+                                                      <span class="n">y</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">ymax</span><span class="p">,</span>
+                                                      <span class="n">x</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">xmax</span><span class="p">,</span>
+                                                      <span class="n">center_x</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">center_x</span><span class="p">,</span>
+                                                      <span class="n">center_y</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">center_y</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">qmax</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">qmax</span>
+        
+        <span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span> <span class="o">=</span> <span class="n">VerticalDoubleLine</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
+                                                <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">subplot</span><span class="p">,</span>
+                                                <span class="n">color</span><span class="o">=</span><span class="s">&#39;black&#39;</span><span class="p">,</span>
+                                                <span class="n">zorder</span><span class="o">=</span><span class="n">zorder</span><span class="p">,</span>
+                                                <span class="n">y</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">ymax</span><span class="p">,</span>
+                                                <span class="n">x</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">xmax</span><span class="p">,</span>
+                                                <span class="n">center_x</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">center_x</span><span class="p">,</span>
+                                                <span class="n">center_y</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">center_y</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">qmax</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">qmax</span>
+        
+        <span class="bp">self</span><span class="o">.</span><span class="n">center</span> <span class="o">=</span> <span class="n">PointInteractor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
+                                     <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">subplot</span><span class="p">,</span><span class="n">color</span><span class="o">=</span><span class="s">&#39;grey&#39;</span><span class="p">,</span>
+                                    <span class="n">zorder</span><span class="o">=</span><span class="n">zorder</span><span class="p">,</span>
+                                    <span class="n">center_x</span><span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">center_x</span><span class="p">,</span>
+                                    <span class="n">center_y</span><span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">center_y</span><span class="p">)</span>
+        <span class="c">## Save the name of the slicer panel associate with this slicer </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">panel_name</span> <span class="o">=</span> <span class="s">&quot;&quot;</span>    
+        <span class="c">## Update and post slicer parameters  </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_post_data</span><span class="p">()</span>
+        <span class="c">## Bind to slice parameter events</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">EVT_SLICER_PARS</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_onEVT_SLICER_PARS</span><span class="p">)</span>
+        
+<div class="viewcode-block" id="BoxSum.set_panel_name"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.BoxSum.set_panel_name">[docs]</a>    <span class="k">def</span> <span class="nf">set_panel_name</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">            Store the name of the panel associated to this slicer</span>
+<span class="sd">            @param name: the name of this panel</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">panel_name</span> <span class="o">=</span> <span class="n">name</span>
+        </div>
+    <span class="k">def</span> <span class="nf">_onEVT_SLICER_PARS</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">            receive an event containing parameters values to reset the slicer</span>
+<span class="sd">            @param event: event of type SlicerParameterEvent with params as </span>
+<span class="sd">            attribute</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c">## Post e message to declare what kind of event has being received</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span>
+                     <span class="n">StatusEvent</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="s">&quot;Boxsum._onEVT_SLICER_PARS&quot;</span><span class="p">))</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">Skip</span><span class="p">()</span>
+        <span class="c">## reset the slicer with the values contains the event.params dictionary</span>
+        <span class="k">if</span> <span class="n">event</span><span class="o">.</span><span class="n">type</span> <span class="o">==</span> <span class="bp">self</span><span class="o">.</span><span class="n">__class__</span><span class="o">.</span><span class="n">__name__</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">set_params</span><span class="p">(</span><span class="n">event</span><span class="o">.</span><span class="n">params</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+
+<div class="viewcode-block" id="BoxSum.set_layer"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.BoxSum.set_layer">[docs]</a>    <span class="k">def</span> <span class="nf">set_layer</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">n</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Allow adding plot to the same panel</span>
+<span class="sd">        :param n: the number of layer</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">layernum</span> <span class="o">=</span> <span class="n">n</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        </div>
+<div class="viewcode-block" id="BoxSum.clear"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.BoxSum.clear">[docs]</a>    <span class="k">def</span> <span class="nf">clear</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Clear the slicer and all connected events related to this slicer</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">clear_markers</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">center</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">connect</span><span class="o">.</span><span class="n">clearall</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">Unbind</span><span class="p">(</span><span class="n">EVT_SLICER_PARS</span><span class="p">)</span>
+        </div>
+<div class="viewcode-block" id="BoxSum.update"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.BoxSum.update">[docs]</a>    <span class="k">def</span> <span class="nf">update</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Respond to changes in the model by recalculating the profiles and</span>
+<span class="sd">        resetting the widgets.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c">## check if the center point has moved and update the figure accordingly </span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">center</span><span class="o">.</span><span class="n">has_move</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">center</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">update</span><span class="p">(</span> <span class="n">center</span><span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">center</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">update</span><span class="p">(</span> <span class="n">center</span><span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">center</span><span class="p">)</span>
+        <span class="c">## check if the horizontal lines have moved and </span>
+        <span class="c">#update the figure accordingly    </span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">has_move</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">y1</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">y1</span><span class="p">,</span>
+                                       <span class="n">y2</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">y2</span><span class="p">,</span>
+                                       <span class="n">height</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">half_height</span><span class="p">)</span>
+        <span class="c">## check if the vertical lines have moved and </span>
+        <span class="c">#update the figure accordingly    </span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">has_move</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">x1</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">x1</span><span class="p">,</span>
+                                         <span class="n">x2</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">x2</span><span class="p">,</span>
+                                         <span class="n">width</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">half_width</span><span class="p">)</span>
+            </div>
+<div class="viewcode-block" id="BoxSum.save"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.BoxSum.save">[docs]</a>    <span class="k">def</span> <span class="nf">save</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Remember the roughness for this layer and the next so that we</span>
+<span class="sd">        can restore on Esc.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">freeze_axes</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">save</span><span class="p">(</span><span class="n">ev</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">save</span><span class="p">(</span><span class="n">ev</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">center</span><span class="o">.</span><span class="n">save</span><span class="p">(</span><span class="n">ev</span><span class="p">)</span>
+        </div>
+    <span class="k">def</span> <span class="nf">_post_data</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Get the limits of the boxsum and compute the sum of the pixel</span>
+<span class="sd">        contained in that region and the error on that sum</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c">## Data 2D for which the pixel will be summed</span>
+        <span class="n">data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span>
+        <span class="c">## the region of the summation</span>
+        <span class="n">x_min</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">x2</span> 
+        <span class="n">x_max</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">x1</span> 
+        <span class="n">y_min</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">y2</span>
+        <span class="n">y_max</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">y1</span>
+        <span class="c">##computation of the sum and its error</span>
+        <span class="kn">from</span> <span class="nn">sas.dataloader.manipulations</span> <span class="kn">import</span> <span class="n">Boxavg</span>
+        <span class="n">box</span> <span class="o">=</span>  <span class="n">Boxavg</span><span class="p">(</span><span class="n">x_min</span><span class="o">=</span><span class="n">x_min</span><span class="p">,</span> <span class="n">x_max</span><span class="o">=</span><span class="n">x_max</span><span class="p">,</span> <span class="n">y_min</span><span class="o">=</span><span class="n">y_min</span><span class="p">,</span> <span class="n">y_max</span><span class="o">=</span><span class="n">y_max</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">count</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">error</span> <span class="o">=</span> <span class="n">box</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="p">)</span>
+        <span class="c"># Dig out number of points summed, SMK &amp; PDB, 04/03/2013</span>
+        <span class="kn">from</span> <span class="nn">sas.dataloader.manipulations</span> <span class="kn">import</span> <span class="n">Boxsum</span>
+        <span class="n">boxtotal</span> <span class="o">=</span>  <span class="n">Boxsum</span><span class="p">(</span><span class="n">x_min</span><span class="o">=</span><span class="n">x_min</span><span class="p">,</span> <span class="n">x_max</span><span class="o">=</span><span class="n">x_max</span><span class="p">,</span> <span class="n">y_min</span><span class="o">=</span><span class="n">y_min</span><span class="p">,</span> <span class="n">y_max</span><span class="o">=</span><span class="n">y_max</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">total</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">totalerror</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">points</span> <span class="o">=</span> <span class="n">boxtotal</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data2D</span><span class="p">)</span>
+        
+<div class="viewcode-block" id="BoxSum.moveend"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.BoxSum.moveend">[docs]</a>    <span class="k">def</span> <span class="nf">moveend</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">            After a dragging motion this function is called to compute</span>
+<span class="sd">            the error and the sum of pixel of a given data 2D </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">thaw_axes</span><span class="p">()</span>
+        <span class="c">## compute error an d sum of data&#39;s pixel</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_post_data</span><span class="p">()</span>
+        <span class="c">## Create and event ( posted to guiframe)that  set the </span>
+        <span class="c">##current slicer parameter to a panel of name self.panel_name</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">type</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">__class__</span><span class="o">.</span><span class="n">__name__</span>
+        <span class="n">params</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_params</span><span class="p">()</span>
+        <span class="n">event</span> <span class="o">=</span> <span class="n">SlicerParamUpdateEvent</span><span class="p">(</span><span class="nb">type</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">type</span><span class="p">,</span>
+                                       <span class="n">params</span><span class="o">=</span><span class="n">params</span><span class="p">,</span>
+                                       <span class="n">panel_name</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">panel_name</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> <span class="n">event</span><span class="p">)</span>
+        </div>
+<div class="viewcode-block" id="BoxSum.restore"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.BoxSum.restore">[docs]</a>    <span class="k">def</span> <span class="nf">restore</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Restore the roughness for this layer.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">restore</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">restore</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">center</span><span class="o">.</span><span class="n">restore</span><span class="p">()</span>
+        </div>
+<div class="viewcode-block" id="BoxSum.move"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.BoxSum.move">[docs]</a>    <span class="k">def</span> <span class="nf">move</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Process move to a new position, making sure that the move is allowed.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">pass</span>
+    </div>
+<div class="viewcode-block" id="BoxSum.set_cursor"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.BoxSum.set_cursor">[docs]</a>    <span class="k">def</span> <span class="nf">set_cursor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">pass</span>
+        </div>
+<div class="viewcode-block" id="BoxSum.get_params"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.BoxSum.get_params">[docs]</a>    <span class="k">def</span> <span class="nf">get_params</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Store a copy of values of parameters of the slicer into a dictionary.</span>
+<span class="sd">        :return params: the dictionary created</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">params</span> <span class="o">=</span> <span class="p">{}</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;Width&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">half_width</span><span class="p">)</span> <span class="o">*</span> <span class="mi">2</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;Height&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">half_height</span><span class="p">)</span> <span class="o">*</span> <span class="mi">2</span> 
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;center_x&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">center</span><span class="o">.</span><span class="n">x</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;center_y&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">center</span><span class="o">.</span><span class="n">y</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;num_points&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">points</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;avg&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">count</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;avg_error&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">error</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;sum&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">total</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;sum_error&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">totalerror</span>
+        <span class="k">return</span> <span class="n">params</span>
+    </div>
+<div class="viewcode-block" id="BoxSum.get_result"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.BoxSum.get_result">[docs]</a>    <span class="k">def</span> <span class="nf">get_result</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">            return the result of box summation</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">result</span> <span class="o">=</span> <span class="p">{}</span>
+        <span class="n">result</span><span class="p">[</span><span class="s">&quot;num_points&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">points</span>
+        <span class="n">result</span><span class="p">[</span><span class="s">&quot;avg&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">count</span>
+        <span class="n">result</span><span class="p">[</span><span class="s">&quot;avg_error&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">error</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;sum&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">total</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;sum_error&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">totalerror</span>
+        <span class="k">return</span> <span class="n">result</span>
+        </div>
+<div class="viewcode-block" id="BoxSum.set_params"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.BoxSum.set_params">[docs]</a>    <span class="k">def</span> <span class="nf">set_params</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">params</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Receive a dictionary and reset the slicer with values contained </span>
+<span class="sd">        in the values of the dictionary.</span>
+<span class="sd">        :param params: a dictionary containing name of slicer parameters and values the user assigned to the slicer.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">x_max</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="n">params</span><span class="p">[</span><span class="s">&quot;Width&quot;</span><span class="p">]</span> <span class="p">)</span><span class="o">/</span><span class="mi">2</span>
+        <span class="n">y_max</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="n">params</span><span class="p">[</span><span class="s">&quot;Height&quot;</span><span class="p">]</span> <span class="p">)</span><span class="o">/</span><span class="mi">2</span>
+        
+        <span class="bp">self</span><span class="o">.</span><span class="n">center_x</span> <span class="o">=</span> <span class="n">params</span><span class="p">[</span><span class="s">&quot;center_x&quot;</span><span class="p">]</span> 
+        <span class="bp">self</span><span class="o">.</span><span class="n">center_y</span> <span class="o">=</span> <span class="n">params</span><span class="p">[</span><span class="s">&quot;center_y&quot;</span><span class="p">]</span>
+        <span class="c">#update the slicer given values of params</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">center</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">center_x</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">center_x</span><span class="p">,</span> <span class="n">center_y</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">center_y</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">horizontal_lines</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">center</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">center</span><span class="p">,</span>
+                                     <span class="n">width</span><span class="o">=</span><span class="n">x_max</span><span class="p">,</span> <span class="n">height</span><span class="o">=</span><span class="n">y_max</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">vertical_lines</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">center</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">center</span><span class="p">,</span>
+                                    <span class="n">width</span><span class="o">=</span><span class="n">x_max</span><span class="p">,</span> <span class="n">height</span><span class="o">=</span><span class="n">y_max</span><span class="p">)</span>
+        <span class="c">#compute the new error and sum given values of params</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_post_data</span><span class="p">()</span>
+        </div>
+<div class="viewcode-block" id="BoxSum.freeze_axes"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.BoxSum.freeze_axes">[docs]</a>    <span class="k">def</span> <span class="nf">freeze_axes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">freeze_axes</span><span class="p">()</span>
+        </div>
+<div class="viewcode-block" id="BoxSum.thaw_axes"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.BoxSum.thaw_axes">[docs]</a>    <span class="k">def</span> <span class="nf">thaw_axes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">thaw_axes</span><span class="p">()</span>
+</div>
+<div class="viewcode-block" id="BoxSum.draw"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.BoxSum.draw">[docs]</a>    <span class="k">def</span> <span class="nf">draw</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">draw</span><span class="p">()</span>
+        
+        
+        </div></div>
+<div class="viewcode-block" id="PointInteractor"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.PointInteractor">[docs]</a><span class="k">class</span> <span class="nc">PointInteractor</span><span class="p">(</span><span class="n">_BaseInteractor</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Draw a point that can be dragged with the marker.</span>
+<span class="sd">    this class controls the motion the center of the BoxSum </span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s">&#39;black&#39;</span><span class="p">,</span> <span class="n">zorder</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">center_x</span><span class="o">=</span><span class="mf">0.0</span><span class="p">,</span>
+                 <span class="n">center_y</span><span class="o">=</span><span class="mf">0.0</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">_BaseInteractor</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="n">color</span><span class="p">)</span>
+        <span class="c">## Initialization the class </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">markers</span> <span class="o">=</span> <span class="p">[]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">axes</span> <span class="o">=</span> <span class="n">axes</span>
+        <span class="c"># center coordinates</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">x</span> <span class="o">=</span> <span class="n">center_x</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">y</span> <span class="o">=</span> <span class="n">center_y</span>
+        <span class="c">## saved value of the center coordinates</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_x</span> <span class="o">=</span> <span class="n">center_x</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_y</span> <span class="o">=</span> <span class="n">center_y</span>
+        <span class="c">## Create a marker </span>
+        <span class="k">try</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">center_marker</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">plot</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">],[</span><span class="bp">self</span><span class="o">.</span><span class="n">y</span><span class="p">],</span> <span class="n">linestyle</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">,</span>
+                                          <span class="n">marker</span><span class="o">=</span><span class="s">&#39;s&#39;</span><span class="p">,</span> <span class="n">markersize</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span>
+                                          <span class="n">color</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">color</span><span class="p">,</span> <span class="n">alpha</span><span class="o">=</span><span class="mf">0.6</span><span class="p">,</span>
+                                          <span class="n">pickradius</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s">&quot;pick&quot;</span><span class="p">,</span> 
+                                          <span class="c"># Prefer this to other lines</span>
+                                          <span class="n">zorder</span><span class="o">=</span><span class="n">zorder</span><span class="p">,</span> 
+                                          <span class="n">visible</span><span class="o">=</span><span class="bp">True</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+        <span class="k">except</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">center_marker</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">plot</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">],[</span><span class="bp">self</span><span class="o">.</span><span class="n">y</span><span class="p">],</span> <span class="n">linestyle</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">,</span>
+                                          <span class="n">marker</span><span class="o">=</span><span class="s">&#39;s&#39;</span><span class="p">,</span> <span class="n">markersize</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span>
+                                          <span class="n">color</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">color</span><span class="p">,</span> <span class="n">alpha</span><span class="o">=</span><span class="mf">0.6</span><span class="p">,</span>
+                                          <span class="n">label</span><span class="o">=</span><span class="s">&quot;pick&quot;</span><span class="p">,</span> 
+                                          <span class="n">visible</span><span class="o">=</span><span class="bp">True</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+            <span class="n">message</span>  <span class="o">=</span> <span class="s">&quot;</span><span class="se">\n</span><span class="s">THIS PROTOTYPE NEEDS THE LATEST VERSION&quot;</span>
+            <span class="n">message</span> <span class="o">+=</span> <span class="s">&quot; OF MATPLOTLIB.</span><span class="se">\n</span><span class="s"> Get the SVN version that is &quot;</span>
+            <span class="n">message</span> <span class="o">+=</span> <span class="s">&quot;at least as recent as June 1, 2007&quot;</span>
+            <span class="n">owner</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">parent</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="n">owner</span><span class="p">,</span>
+                         <span class="n">StatusEvent</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="s">&quot;AnnulusSlicer: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">message</span><span class="p">))</span>
+        <span class="c">## Draw a point</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">center</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">plot</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">],</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">y</span><span class="p">],</span>
+                                      <span class="n">linestyle</span><span class="o">=</span><span class="s">&#39;-&#39;</span><span class="p">,</span> <span class="n">marker</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">,</span>
+                                      <span class="n">color</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">color</span><span class="p">,</span>
+                                      <span class="n">visible</span><span class="o">=</span><span class="bp">True</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+        <span class="c">## Flag to determine the motion this point </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">has_move</span> <span class="o">=</span> <span class="bp">False</span>   
+        <span class="c">## connecting the marker to allow them to move </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">connect_markers</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">center_marker</span><span class="p">])</span>
+        <span class="c">## Update the figure</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+    
+<div class="viewcode-block" id="PointInteractor.set_layer"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.PointInteractor.set_layer">[docs]</a>    <span class="k">def</span> <span class="nf">set_layer</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">n</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">            Allow adding plot to the same panel</span>
+<span class="sd">            @param n: the number of layer</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">layernum</span> <span class="o">=</span> <span class="n">n</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        </div>
+<div class="viewcode-block" id="PointInteractor.clear"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.PointInteractor.clear">[docs]</a>    <span class="k">def</span> <span class="nf">clear</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">            Clear this figure and its markers</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">clear_markers</span><span class="p">()</span>
+        <span class="k">try</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">center</span><span class="o">.</span><span class="n">remove</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">center_marker</span><span class="o">.</span><span class="n">remove</span><span class="p">()</span>
+        <span class="k">except</span><span class="p">:</span>
+            <span class="c"># Old version of matplotlib</span>
+            <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">lines</span><span class="p">)):</span>
+                <span class="k">del</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">lines</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
+  </div>
+<div class="viewcode-block" id="PointInteractor.update"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.PointInteractor.update">[docs]</a>    <span class="k">def</span> <span class="nf">update</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">center_x</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span><span class="n">center_y</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">            Draw the new roughness on the graph.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">if</span> <span class="n">center_x</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">x</span> <span class="o">=</span> <span class="n">center_x</span>
+        <span class="k">if</span> <span class="n">center_y</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">y</span> <span class="o">=</span> <span class="n">center_y</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">center_marker</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">xdata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">],</span> <span class="n">ydata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">y</span><span class="p">])</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">center</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">xdata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">],</span> <span class="n">ydata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">y</span><span class="p">])</span>
+        </div>
+<div class="viewcode-block" id="PointInteractor.save"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.PointInteractor.save">[docs]</a>    <span class="k">def</span> <span class="nf">save</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Remember the roughness for this layer and the next so that we</span>
+<span class="sd">        can restore on Esc.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_x</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">x</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_y</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">y</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">freeze_axes</span><span class="p">()</span>
+        </div>
+<div class="viewcode-block" id="PointInteractor.moveend"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.PointInteractor.moveend">[docs]</a>    <span class="k">def</span> <span class="nf">moveend</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">has_move</span><span class="o">=</span><span class="bp">False</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">moveend</span><span class="p">(</span><span class="n">ev</span><span class="p">)</span>
+            </div>
+<div class="viewcode-block" id="PointInteractor.restore"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.PointInteractor.restore">[docs]</a>    <span class="k">def</span> <span class="nf">restore</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Restore the roughness for this layer.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">y</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">save_y</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">x</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">save_x</span>
+    </div>
+<div class="viewcode-block" id="PointInteractor.move"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.PointInteractor.move">[docs]</a>    <span class="k">def</span> <span class="nf">move</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Process move to a new position, making sure that the move is allowed.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">x</span> <span class="o">=</span> <span class="n">x</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">y</span> <span class="o">=</span> <span class="n">y</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">has_move</span> <span class="o">=</span> <span class="bp">True</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        </div>
+<div class="viewcode-block" id="PointInteractor.set_cursor"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.PointInteractor.set_cursor">[docs]</a>    <span class="k">def</span> <span class="nf">set_cursor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">move</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="bp">None</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        </div></div>
+<div class="viewcode-block" id="VerticalDoubleLine"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.VerticalDoubleLine">[docs]</a><span class="k">class</span> <span class="nc">VerticalDoubleLine</span><span class="p">(</span><span class="n">_BaseInteractor</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">         Draw 2 vertical lines moving in opposite direction and centered on </span>
+<span class="sd">         a point (PointInteractor)</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s">&#39;black&#39;</span><span class="p">,</span> <span class="n">zorder</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">x</span><span class="o">=</span><span class="mf">0.5</span><span class="p">,</span><span class="n">y</span><span class="o">=</span><span class="mf">0.5</span><span class="p">,</span>
+                 <span class="n">center_x</span><span class="o">=</span><span class="mf">0.0</span><span class="p">,</span> <span class="n">center_y</span><span class="o">=</span><span class="mf">0.0</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">_BaseInteractor</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="n">color</span><span class="p">)</span>
+        <span class="c">## Initialization the class </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">markers</span> <span class="o">=</span> <span class="p">[]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">axes</span> <span class="o">=</span> <span class="n">axes</span>
+        <span class="c">## Center coordinates</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">center_x</span> <span class="o">=</span> <span class="n">center_x</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">center_y</span> <span class="o">=</span> <span class="n">center_y</span>
+        <span class="c">## defined end points vertical lignes and their saved values</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">y1</span> <span class="o">=</span> <span class="n">y</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">center_y</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_y1</span><span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">y1</span>
+        
+        <span class="n">delta</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">y1</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">center_y</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">y2</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">center_y</span> <span class="o">-</span> <span class="n">delta</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_y2</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">y2</span>
+        
+        <span class="bp">self</span><span class="o">.</span><span class="n">x1</span> <span class="o">=</span> <span class="n">x</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">center_x</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_x1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">x1</span>
+         
+        <span class="n">delta</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">x1</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">center_x</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">x2</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">center_x</span> <span class="o">-</span> <span class="n">delta</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_x2</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">x2</span>
+        <span class="c">## save the color of the line</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">color</span> <span class="o">=</span> <span class="n">color</span>
+        <span class="c">## the height of the rectangle</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">half_height</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="n">y</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_half_height</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="n">y</span><span class="p">)</span>
+        <span class="c">## the with of the rectangle</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">half_width</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">x1</span><span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">x2</span><span class="p">)</span><span class="o">/</span><span class="mi">2</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_half_width</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">x1</span><span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">x2</span><span class="p">)</span><span class="o">/</span><span class="mi">2</span>
+        <span class="c">## Create marker </span>
+        <span class="k">try</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">right_marker</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">plot</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">x1</span><span class="p">],[</span><span class="mi">0</span><span class="p">],</span> <span class="n">linestyle</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">,</span>
+                                          <span class="n">marker</span><span class="o">=</span><span class="s">&#39;s&#39;</span><span class="p">,</span> <span class="n">markersize</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span>
+                                          <span class="n">color</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">color</span><span class="p">,</span> <span class="n">alpha</span><span class="o">=</span><span class="mf">0.6</span><span class="p">,</span>
+                                          <span class="n">pickradius</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s">&quot;pick&quot;</span><span class="p">,</span> 
+                                          <span class="c"># Prefer this to other lines</span>
+                                          <span class="n">zorder</span><span class="o">=</span><span class="n">zorder</span><span class="p">,</span> <span class="n">visible</span><span class="o">=</span><span class="bp">True</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+        <span class="k">except</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">right_marker</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">plot</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">x1</span><span class="p">],[</span><span class="mi">0</span><span class="p">],</span> <span class="n">linestyle</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">,</span>
+                                          <span class="n">marker</span><span class="o">=</span><span class="s">&#39;s&#39;</span><span class="p">,</span> <span class="n">markersize</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span>
+                                          <span class="n">color</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">color</span><span class="p">,</span> <span class="n">alpha</span><span class="o">=</span><span class="mf">0.6</span><span class="p">,</span>
+                                          <span class="n">label</span><span class="o">=</span><span class="s">&quot;pick&quot;</span><span class="p">,</span> <span class="n">visible</span><span class="o">=</span><span class="bp">True</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+            <span class="n">message</span>  <span class="o">=</span> <span class="s">&quot;</span><span class="se">\n</span><span class="s">THIS PROTOTYPE NEEDS THE LATEST &quot;</span>
+            <span class="n">message</span> <span class="o">+=</span> <span class="s">&quot;VERSION OF MATPLOTLIB</span><span class="se">\n</span><span class="s"> Get the SVN version that&quot;</span>
+            <span class="n">message</span> <span class="o">+=</span> <span class="s">&quot; is at least as recent as June 1, 2007&quot;</span>
+            <span class="n">owner</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">parent</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="n">owner</span><span class="p">,</span>
+                         <span class="n">StatusEvent</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="s">&quot;AnnulusSlicer: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">message</span><span class="p">))</span>
+            
+        <span class="c">## define the left and right lines of the rectangle</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">right_line</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">plot</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">x1</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">x1</span><span class="p">],</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">y1</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">y2</span><span class="p">],</span>
+                                      <span class="n">linestyle</span><span class="o">=</span><span class="s">&#39;-&#39;</span><span class="p">,</span> <span class="n">marker</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">,</span>
+                                      <span class="n">color</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">color</span><span class="p">,</span> <span class="n">visible</span><span class="o">=</span><span class="bp">True</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">left_line</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">plot</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">x2</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">x2</span><span class="p">],</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">y1</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">y2</span><span class="p">],</span>
+                                      <span class="n">linestyle</span><span class="o">=</span><span class="s">&#39;-&#39;</span><span class="p">,</span> <span class="n">marker</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">,</span>
+                                      <span class="n">color</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">color</span><span class="p">,</span> <span class="n">visible</span><span class="o">=</span><span class="bp">True</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+        <span class="c">## Flag to determine if the lines have moved</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">has_move</span> <span class="o">=</span> <span class="bp">False</span>  
+        <span class="c">## connection the marker and draw the pictures  </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">connect_markers</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">right_marker</span><span class="p">])</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+
+<div class="viewcode-block" id="VerticalDoubleLine.set_layer"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.VerticalDoubleLine.set_layer">[docs]</a>    <span class="k">def</span> <span class="nf">set_layer</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">n</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Allow adding plot to the same panel</span>
+<span class="sd">        :param n: the number of layer</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">layernum</span> <span class="o">=</span> <span class="n">n</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        </div>
+<div class="viewcode-block" id="VerticalDoubleLine.clear"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.VerticalDoubleLine.clear">[docs]</a>    <span class="k">def</span> <span class="nf">clear</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Clear this slicer  and its markers</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">clear_markers</span><span class="p">()</span>
+        <span class="k">try</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">right_marker</span><span class="o">.</span><span class="n">remove</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">right_line</span><span class="o">.</span><span class="n">remove</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">remove</span><span class="p">()</span>
+        <span class="k">except</span><span class="p">:</span>
+            <span class="c"># Old version of matplotlib</span>
+            <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">lines</span><span class="p">)):</span>
+                <span class="k">del</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">lines</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
+   </div>
+<div class="viewcode-block" id="VerticalDoubleLine.update"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.VerticalDoubleLine.update">[docs]</a>    <span class="k">def</span> <span class="nf">update</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x1</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">x2</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">y1</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">y2</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span><span class="n">width</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
+                <span class="n">height</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">center</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Draw the new roughness on the graph.</span>
+<span class="sd">        :param x1: new maximum value of x coordinates</span>
+<span class="sd">        :param x2: new minimum value of x coordinates</span>
+<span class="sd">        :param y1: new maximum value of y coordinates</span>
+<span class="sd">        :param y2: new minimum value of y coordinates</span>
+<span class="sd">        :param width: is the width of the new rectangle</span>
+<span class="sd">        :param height: is the height of the new rectangle</span>
+<span class="sd">        :param center: provided x, y  coordinates of the center point</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c">## save the new height, witdh of the rectangle if given as a param</span>
+        <span class="k">if</span> <span class="n">width</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">half_width</span> <span class="o">=</span> <span class="n">width</span>
+        <span class="k">if</span> <span class="n">height</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">half_height</span> <span class="o">=</span> <span class="n">height</span>
+        <span class="c">## If new  center coordinates are given draw the rectangle </span>
+        <span class="c">##given these value </span>
+        <span class="k">if</span> <span class="n">center</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">center_x</span> <span class="o">=</span> <span class="n">center</span><span class="o">.</span><span class="n">x</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">center_y</span> <span class="o">=</span> <span class="n">center</span><span class="o">.</span><span class="n">y</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">x1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">half_width</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">center_x</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">x2</span><span class="o">=</span> <span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">half_width</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">center_x</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">y1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">half_height</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">center_y</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">y2</span><span class="o">=</span> <span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">half_height</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">center_y</span>
+         
+            <span class="bp">self</span><span class="o">.</span><span class="n">right_marker</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">xdata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">x1</span><span class="p">],</span> <span class="n">ydata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">center_y</span><span class="p">])</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">right_line</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">xdata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">x1</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">x1</span><span class="p">],</span> 
+                                <span class="n">ydata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">y1</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">y2</span><span class="p">])</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">xdata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">x2</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">x2</span><span class="p">],</span>
+                               <span class="n">ydata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">y1</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">y2</span><span class="p">])</span>
+            <span class="k">return</span> 
+        <span class="c">## if x1, y1, y2, y3 are given draw the rectangle with this value</span>
+        <span class="k">if</span> <span class="n">x1</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span> 
+            <span class="bp">self</span><span class="o">.</span><span class="n">x1</span> <span class="o">=</span> <span class="n">x1</span>
+        <span class="k">if</span> <span class="n">x2</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span> 
+            <span class="bp">self</span><span class="o">.</span><span class="n">x2</span> <span class="o">=</span> <span class="n">x2</span>
+        <span class="k">if</span> <span class="n">y1</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span> 
+            <span class="bp">self</span><span class="o">.</span><span class="n">y1</span> <span class="o">=</span> <span class="n">y1</span>
+        <span class="k">if</span> <span class="n">y2</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span> 
+            <span class="bp">self</span><span class="o">.</span><span class="n">y2</span> <span class="o">=</span> <span class="n">y2</span>
+        <span class="c">## Draw 2 vertical lines and a marker </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">right_marker</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">xdata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">x1</span><span class="p">],</span> <span class="n">ydata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">center_y</span><span class="p">])</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">right_line</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">xdata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">x1</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">x1</span><span class="p">],</span> <span class="n">ydata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">y1</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">y2</span><span class="p">])</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">xdata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">x2</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">x2</span><span class="p">],</span> <span class="n">ydata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">y1</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">y2</span><span class="p">])</span>
+        </div>
+<div class="viewcode-block" id="VerticalDoubleLine.save"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.VerticalDoubleLine.save">[docs]</a>    <span class="k">def</span> <span class="nf">save</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Remember the roughness for this layer and the next so that we</span>
+<span class="sd">        can restore on Esc.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_x2</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">x2</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_y2</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">y2</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_x1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">x1</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_y1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">y1</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_half_height</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">half_height</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_half_width</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">half_width</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">freeze_axes</span><span class="p">()</span>
+</div>
+<div class="viewcode-block" id="VerticalDoubleLine.moveend"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.VerticalDoubleLine.moveend">[docs]</a>    <span class="k">def</span> <span class="nf">moveend</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">            After a dragging motion reset the flag self.has_move to False</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">has_move</span> <span class="o">=</span> <span class="bp">False</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">moveend</span><span class="p">(</span><span class="n">ev</span><span class="p">)</span>
+            </div>
+<div class="viewcode-block" id="VerticalDoubleLine.restore"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.VerticalDoubleLine.restore">[docs]</a>    <span class="k">def</span> <span class="nf">restore</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Restore the roughness for this layer.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">y2</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">save_y2</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">x2</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">save_x2</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">y1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">save_y1</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">x1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">save_x1</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">half_height</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">save_half_height</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">half_width</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">save_half_width</span>
+       </div>
+<div class="viewcode-block" id="VerticalDoubleLine.move"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.VerticalDoubleLine.move">[docs]</a>    <span class="k">def</span> <span class="nf">move</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Process move to a new position, making sure that the move is allowed.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">x1</span> <span class="o">=</span> <span class="n">x</span>
+        <span class="n">delta</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">x1</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">center_x</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">x2</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">center_x</span> <span class="o">-</span> <span class="n">delta</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">half_width</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">x1</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">x2</span><span class="p">)</span><span class="o">/</span><span class="mi">2</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">has_move</span> <span class="o">=</span> <span class="bp">True</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        </div>
+<div class="viewcode-block" id="VerticalDoubleLine.set_cursor"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.VerticalDoubleLine.set_cursor">[docs]</a>    <span class="k">def</span> <span class="nf">set_cursor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">            Update the figure given x and y </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">move</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="bp">None</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        </div></div>
+<div class="viewcode-block" id="HorizontalDoubleLine"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.HorizontalDoubleLine">[docs]</a><span class="k">class</span> <span class="nc">HorizontalDoubleLine</span><span class="p">(</span><span class="n">_BaseInteractor</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">         Select an annulus through a 2D plot</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s">&#39;black&#39;</span><span class="p">,</span> <span class="n">zorder</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">x</span><span class="o">=</span><span class="mf">0.5</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="mf">0.5</span><span class="p">,</span>
+                 <span class="n">center_x</span><span class="o">=</span><span class="mf">0.0</span><span class="p">,</span> <span class="n">center_y</span><span class="o">=</span><span class="mf">0.0</span><span class="p">):</span>
+        
+        <span class="n">_BaseInteractor</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="n">color</span><span class="p">)</span>
+        <span class="c">## Initialization the class </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">markers</span> <span class="o">=</span> <span class="p">[]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">axes</span> <span class="o">=</span> <span class="n">axes</span>
+        <span class="c">## Center coordinates</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">center_x</span> <span class="o">=</span> <span class="n">center_x</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">center_y</span> <span class="o">=</span> <span class="n">center_y</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">y1</span> <span class="o">=</span> <span class="n">y</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">center_y</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_y1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">y1</span>
+        <span class="n">delta</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">y1</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">center_y</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">y2</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">center_y</span> <span class="o">-</span> <span class="n">delta</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_y2</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">y2</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">x1</span> <span class="o">=</span> <span class="n">x</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">center_x</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_x1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">x1</span>
+        <span class="n">delta</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">x1</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">center_x</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">x2</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">center_x</span> <span class="o">-</span> <span class="n">delta</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_x2</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">x2</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">color</span> <span class="o">=</span> <span class="n">color</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">half_height</span><span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="n">y</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_half_height</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="n">y</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">half_width</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_half_width</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
+        <span class="k">try</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">top_marker</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">plot</span><span class="p">([</span><span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">y1</span><span class="p">],</span> <span class="n">linestyle</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">,</span>
+                                          <span class="n">marker</span><span class="o">=</span><span class="s">&#39;s&#39;</span><span class="p">,</span> <span class="n">markersize</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span>
+                                          <span class="n">color</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">color</span><span class="p">,</span> <span class="n">alpha</span><span class="o">=</span><span class="mf">0.6</span><span class="p">,</span>
+                                          <span class="n">pickradius</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s">&quot;pick&quot;</span><span class="p">,</span>
+                                          <span class="c"># Prefer this to other lines</span>
+                                          <span class="n">zorder</span><span class="o">=</span><span class="n">zorder</span><span class="p">,</span> <span class="n">visible</span><span class="o">=</span><span class="bp">True</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+        <span class="k">except</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">top_marker</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">plot</span><span class="p">([</span><span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">y1</span><span class="p">],</span> <span class="n">linestyle</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">,</span>
+                                          <span class="n">marker</span><span class="o">=</span><span class="s">&#39;s&#39;</span><span class="p">,</span> <span class="n">markersize</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span>
+                                          <span class="n">color</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">color</span><span class="p">,</span> <span class="n">alpha</span><span class="o">=</span><span class="mf">0.6</span><span class="p">,</span>
+                                          <span class="n">label</span><span class="o">=</span><span class="s">&quot;pick&quot;</span><span class="p">,</span> <span class="n">visible</span><span class="o">=</span><span class="bp">True</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+            <span class="n">message</span>  <span class="o">=</span> <span class="s">&quot;</span><span class="se">\n</span><span class="s">THIS PROTOTYPE NEEDS THE LATEST VERSION &quot;</span>
+            <span class="n">message</span> <span class="o">+=</span> <span class="s">&quot;OF MATPLOTLIB</span><span class="se">\n</span><span class="s"> Get the SVN version &quot;</span>
+            <span class="n">message</span> <span class="o">+=</span> <span class="s">&quot;that is at least as recent as June 1, 2007&quot;</span>
+            <span class="n">owner</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">parent</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="n">owner</span><span class="p">,</span>
+                         <span class="n">StatusEvent</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="s">&quot;AnnulusSlicer: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">message</span><span class="p">))</span>
+            
+        <span class="c"># Define 2 horizotnal lines</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">top_line</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">plot</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">x1</span><span class="p">,</span> <span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">x1</span><span class="p">],</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">y1</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">y1</span><span class="p">],</span>
+                                      <span class="n">linestyle</span><span class="o">=</span><span class="s">&#39;-&#39;</span><span class="p">,</span> <span class="n">marker</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">,</span>
+                                      <span class="n">color</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">color</span><span class="p">,</span> <span class="n">visible</span><span class="o">=</span><span class="bp">True</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">bottom_line</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">plot</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">x1</span><span class="p">,</span> <span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">x1</span><span class="p">],</span> 
+                                          <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">y2</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">y2</span><span class="p">],</span>
+                                      <span class="n">linestyle</span><span class="o">=</span><span class="s">&#39;-&#39;</span><span class="p">,</span> <span class="n">marker</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">,</span>
+                                      <span class="n">color</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">color</span><span class="p">,</span> <span class="n">visible</span><span class="o">=</span><span class="bp">True</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+        <span class="c">## Flag to determine if the lines have moved</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">has_move</span> <span class="o">=</span> <span class="bp">False</span>    
+        <span class="c">## connection the marker and draw the pictures </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">connect_markers</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">top_marker</span><span class="p">])</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+
+<div class="viewcode-block" id="HorizontalDoubleLine.set_layer"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.HorizontalDoubleLine.set_layer">[docs]</a>    <span class="k">def</span> <span class="nf">set_layer</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">n</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">            Allow adding plot to the same panel</span>
+<span class="sd">            @param n: the number of layer</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">layernum</span> <span class="o">=</span> <span class="n">n</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        </div>
+<div class="viewcode-block" id="HorizontalDoubleLine.clear"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.HorizontalDoubleLine.clear">[docs]</a>    <span class="k">def</span> <span class="nf">clear</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">            Clear this figure and its markers</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">clear_markers</span><span class="p">()</span>
+        <span class="k">try</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">top_marker</span><span class="o">.</span><span class="n">remove</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">bottom_line</span><span class="o">.</span><span class="n">remove</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">top_line</span><span class="o">.</span><span class="n">remove</span><span class="p">()</span>
+        <span class="k">except</span><span class="p">:</span>
+            <span class="c"># Old version of matplotlib</span>
+            <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">lines</span><span class="p">)):</span>
+                <span class="k">del</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="o">.</span><span class="n">lines</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
+    </div>
+<div class="viewcode-block" id="HorizontalDoubleLine.update"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.HorizontalDoubleLine.update">[docs]</a>    <span class="k">def</span> <span class="nf">update</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x1</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">x2</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">y1</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">y2</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
+               <span class="n">width</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">height</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">center</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Draw the new roughness on the graph.</span>
+<span class="sd">        :param x1: new maximum value of x coordinates</span>
+<span class="sd">        :param x2: new minimum value of x coordinates</span>
+<span class="sd">        :param y1: new maximum value of y coordinates</span>
+<span class="sd">        :param y2: new minimum value of y coordinates</span>
+<span class="sd">        :param width: is the width of the new rectangle</span>
+<span class="sd">        :param height: is the height of the new rectangle</span>
+<span class="sd">        :param center: provided x, y  coordinates of the center point</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c">## save the new height, witdh of the rectangle if given as a param</span>
+        <span class="k">if</span> <span class="n">width</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">half_width</span> <span class="o">=</span> <span class="n">width</span>
+        <span class="k">if</span> <span class="n">height</span><span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">half_height</span> <span class="o">=</span> <span class="n">height</span>
+        <span class="c">## If new  center coordinates are given draw the rectangle </span>
+        <span class="c">##given these value </span>
+        <span class="k">if</span> <span class="n">center</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">center_x</span> <span class="o">=</span> <span class="n">center</span><span class="o">.</span><span class="n">x</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">center_y</span> <span class="o">=</span> <span class="n">center</span><span class="o">.</span><span class="n">y</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">x1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">half_width</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">center_x</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">x2</span> <span class="o">=</span> <span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">half_width</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">center_x</span>
+            
+            <span class="bp">self</span><span class="o">.</span><span class="n">y1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">half_height</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">center_y</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">y2</span> <span class="o">=</span> <span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">half_height</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">center_y</span>
+            
+            <span class="bp">self</span><span class="o">.</span><span class="n">top_marker</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">xdata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">center_x</span><span class="p">],</span> <span class="n">ydata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">y1</span><span class="p">])</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">top_line</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">xdata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">x1</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">x2</span><span class="p">],</span>
+                              <span class="n">ydata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">y1</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">y1</span><span class="p">])</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">bottom_line</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">xdata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">x1</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">x2</span><span class="p">],</span>
+                                 <span class="n">ydata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">y2</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">y2</span><span class="p">])</span>
+            <span class="k">return</span> 
+        <span class="c">## if x1, y1, y2, y3 are given draw the rectangle with this value</span>
+        <span class="k">if</span> <span class="n">x1</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span> 
+            <span class="bp">self</span><span class="o">.</span><span class="n">x1</span> <span class="o">=</span> <span class="n">x1</span>
+        <span class="k">if</span> <span class="n">x2</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span> 
+            <span class="bp">self</span><span class="o">.</span><span class="n">x2</span> <span class="o">=</span> <span class="n">x2</span>
+        <span class="k">if</span> <span class="n">y1</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span> 
+            <span class="bp">self</span><span class="o">.</span><span class="n">y1</span> <span class="o">=</span> <span class="n">y1</span>
+        <span class="k">if</span> <span class="n">y2</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span> 
+            <span class="bp">self</span><span class="o">.</span><span class="n">y2</span> <span class="o">=</span> <span class="n">y2</span>
+        <span class="c">## Draw 2 vertical lines and a marker </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">top_marker</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">xdata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">center_x</span><span class="p">],</span> <span class="n">ydata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">y1</span><span class="p">])</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">top_line</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">xdata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">x1</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">x2</span><span class="p">],</span> <span class="n">ydata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">y1</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">y1</span><span class="p">])</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">bottom_line</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">xdata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">x1</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">x2</span><span class="p">],</span> <span class="n">ydata</span><span class="o">=</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">y2</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">y2</span><span class="p">])</span>
+       </div>
+<div class="viewcode-block" id="HorizontalDoubleLine.save"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.HorizontalDoubleLine.save">[docs]</a>    <span class="k">def</span> <span class="nf">save</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Remember the roughness for this layer and the next so that we</span>
+<span class="sd">        can restore on Esc.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_x2</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">x2</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_y2</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">y2</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_x1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">x1</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_y1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">y1</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_half_height</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">half_height</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">save_half_width</span> <span class="o">=</span>  <span class="bp">self</span><span class="o">.</span><span class="n">half_width</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">freeze_axes</span><span class="p">()</span>
+        </div>
+<div class="viewcode-block" id="HorizontalDoubleLine.moveend"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.HorizontalDoubleLine.moveend">[docs]</a>    <span class="k">def</span> <span class="nf">moveend</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        After a dragging motion reset the flag self.has_move to False</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">has_move</span> <span class="o">=</span> <span class="bp">False</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">moveend</span><span class="p">(</span><span class="n">ev</span><span class="p">)</span>
+           </div>
+<div class="viewcode-block" id="HorizontalDoubleLine.restore"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.HorizontalDoubleLine.restore">[docs]</a>    <span class="k">def</span> <span class="nf">restore</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Restore the roughness for this layer.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">y2</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">save_y2</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">x2</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">save_x2</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">y1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">save_y1</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">x1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">save_x1</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">half_height</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">save_half_height</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">half_width</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">save_half_width</span>
+        </div>
+<div class="viewcode-block" id="HorizontalDoubleLine.move"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.HorizontalDoubleLine.move">[docs]</a>    <span class="k">def</span> <span class="nf">move</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Process move to a new position, making sure that the move is allowed.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">y1</span> <span class="o">=</span> <span class="n">y</span>
+        <span class="n">delta</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">y1</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">center_y</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">y2</span> <span class="o">=</span>  <span class="bp">self</span><span class="o">.</span><span class="n">center_y</span> <span class="o">-</span> <span class="n">delta</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">half_height</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">y1</span><span class="p">)</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">center_y</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">has_move</span> <span class="o">=</span> <span class="bp">True</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+    </div>
+<div class="viewcode-block" id="HorizontalDoubleLine.set_cursor"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.boxSum.HorizontalDoubleLine.set_cursor">[docs]</a>    <span class="k">def</span> <span class="nf">set_cursor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">            Update the figure given x and y </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">move</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="bp">None</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+         </div></div>
+</pre></div>
+
+          </div>
+        </div>
+      </div>
+      <div class="sphinxsidebar">
+        <div class="sphinxsidebarwrapper">
+<div id="searchbox" style="display: none">
+  <h3>Quick search</h3>
+    <form class="search" action="../../../../../search.html" method="get">
+      <input type="text" name="q" />
+      <input type="submit" value="Go" />
+      <input type="hidden" name="check_keywords" value="yes" />
+      <input type="hidden" name="area" value="default" />
+    </form>
+    <p class="searchtip" style="font-size: 90%">
+    Enter search terms or a module, class or function name.
+    </p>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+        </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" >sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>
+    <div class="footer">
+        &copy; Copyright 2013, The SasView Project.
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
+    </div>
+  </body>
+</html>
Index: _modules/sas/guiframe/local_perspectives/plotting/detector_dialog.html
===================================================================
--- _modules/sas/guiframe/local_perspectives/plotting/detector_dialog.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
+++ _modules/sas/guiframe/local_perspectives/plotting/detector_dialog.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
@@ -0,0 +1,384 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>sas.guiframe.local_perspectives.plotting.detector_dialog &mdash; SasView 3.0.0 documentation</title>
+    
+    <link rel="stylesheet" href="../../../../../_static/default.css" type="text/css" />
+    <link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '../../../../../',
+        VERSION:     '3.0.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="../../../../../_static/jquery.js"></script>
+    <script type="text/javascript" src="../../../../../_static/underscore.js"></script>
+    <script type="text/javascript" src="../../../../../_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <link rel="top" title="SasView 3.0.0 documentation" href="../../../../../index.html" />
+    <link rel="up" title="sas.guiframe" href="../../../guiframe.html" /> 
+  </head>
+  <body>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" accesskey="U">sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>  
+
+    <div class="document">
+      <div class="documentwrapper">
+        <div class="bodywrapper">
+          <div class="body">
+            
+  <h1>Source code for sas.guiframe.local_perspectives.plotting.detector_dialog</h1><div class="highlight"><pre>
+<span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Widget to display a 2D map of the detector</span>
+<span class="sd">&quot;&quot;&quot;</span>
+<span class="kn">import</span> <span class="nn">wx</span>
+<span class="kn">import</span> <span class="nn">sys</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.utils</span> <span class="kn">import</span> <span class="n">format_number</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">StatusEvent</span> 
+<span class="kn">from</span> <span class="nn">matplotlib.backends.backend_wxagg</span> <span class="kn">import</span> <span class="n">FigureCanvasWxAgg</span> <span class="k">as</span> <span class="n">Canvas</span>
+<span class="kn">from</span> <span class="nn">matplotlib</span> <span class="kn">import</span> <span class="n">mpl</span>
+<span class="kn">from</span> <span class="nn">matplotlib</span> <span class="kn">import</span> <span class="n">pylab</span>
+<span class="c">#FONT size </span>
+<span class="k">if</span> <span class="n">sys</span><span class="o">.</span><span class="n">platform</span><span class="o">.</span><span class="n">count</span><span class="p">(</span><span class="s">&quot;win32&quot;</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
+    <span class="n">FONT_VARIANT</span> <span class="o">=</span> <span class="mi">0</span>
+<span class="k">else</span><span class="p">:</span>
+    <span class="n">FONT_VARIANT</span> <span class="o">=</span> <span class="mi">1</span>
+    
+<span class="n">DEFAULT_CMAP</span> <span class="o">=</span> <span class="n">pylab</span><span class="o">.</span><span class="n">cm</span><span class="o">.</span><span class="n">get_cmap</span><span class="p">(</span><span class="s">&#39;jet&#39;</span><span class="p">)</span>
+
+<div class="viewcode-block" id="DetectorDialog"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.detector_dialog.DetectorDialog">[docs]</a><span class="k">class</span> <span class="nc">DetectorDialog</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">Dialog</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Dialog box to let the user edit detector settings</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="nb">id</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">base</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">dpi</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
+                 <span class="n">cmap</span><span class="o">=</span><span class="n">DEFAULT_CMAP</span><span class="p">,</span> <span class="n">reset_zmin_ctl</span> <span class="o">=</span> <span class="bp">None</span><span class="p">,</span>
+                 <span class="n">reset_zmax_ctl</span> <span class="o">=</span> <span class="bp">None</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwds</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">kwds</span><span class="p">[</span><span class="s">&quot;style&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">DEFAULT_DIALOG_STYLE</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">Dialog</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="nb">id</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwds</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">SetWindowVariant</span><span class="p">(</span><span class="n">variant</span><span class="o">=</span><span class="n">FONT_VARIANT</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="n">base</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">dpi</span> <span class="o">=</span> <span class="n">dpi</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">cmap</span> <span class="o">=</span> <span class="n">cmap</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">reset_zmin_ctl</span> <span class="o">=</span> <span class="n">reset_zmin_ctl</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">reset_zmax_ctl</span> <span class="o">=</span> <span class="n">reset_zmax_ctl</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">label_xnpts</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s">&quot;Detector width in pixels&quot;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">label_ynpts</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s">&quot;Detector Height in pixels&quot;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">label_qmax</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s">&quot;Q max&quot;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">label_zmin</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span>
+                                    <span class="s">&quot;Min amplitude for color map (optional)&quot;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">label_zmax</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span>
+                                    <span class="s">&quot;Max amplitude for color map (optional)&quot;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">label_beam</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span>
+                                        <span class="s">&quot;Beam stop radius in units of q&quot;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">xnpts_ctl</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s">&quot;&quot;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">ynpts_ctl</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s">&quot;&quot;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">qmax_ctl</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s">&quot;&quot;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">beam_ctl</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s">&quot;&quot;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">zmin_ctl</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">TextCtrl</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="p">(</span><span class="mi">60</span><span class="p">,</span> <span class="mi">20</span><span class="p">))</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">zmin_ctl</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_SET_FOCUS</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onSetFocus</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">zmax_ctl</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">TextCtrl</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="p">(</span><span class="mi">60</span><span class="p">,</span> <span class="mi">20</span><span class="p">))</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">zmax_ctl</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_SET_FOCUS</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onSetFocus</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">static_line_3</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticLine</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">button_Cancel</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Button</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">ID_CANCEL</span><span class="p">,</span> <span class="s">&quot;Cancel&quot;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">button_reset</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Button</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">(),</span> <span class="s">&quot;Reset&quot;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_BUTTON</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">resetValues</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">button_reset</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">button_OK</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Button</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">ID_OK</span><span class="p">,</span> <span class="s">&quot;OK&quot;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_BUTTON</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">checkValues</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">button_OK</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">__set_properties</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">__do_layout</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">Fit</span><span class="p">()</span>
+        
+<div class="viewcode-block" id="DetectorDialog.Event"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.detector_dialog.DetectorDialog.Event">[docs]</a>    <span class="k">class</span> <span class="nc">Event</span><span class="p">:</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">xnpts</span> <span class="o">=</span> <span class="mi">0</span>
+        <span class="n">ynpts</span> <span class="o">=</span> <span class="mi">0</span>
+        <span class="n">qpax</span> <span class="o">=</span> <span class="mi">0</span>
+        <span class="n">beam</span> <span class="o">=</span> <span class="mi">0</span>
+        <span class="n">zmin</span> <span class="o">=</span> <span class="mi">0</span>
+        <span class="n">zmax</span> <span class="o">=</span> <span class="mi">0</span>
+        <span class="n">cmap</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="n">sym4</span> <span class="o">=</span> <span class="bp">False</span>
+    </div>
+<div class="viewcode-block" id="DetectorDialog.onSetFocus"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.detector_dialog.DetectorDialog.onSetFocus">[docs]</a>    <span class="k">def</span> <span class="nf">onSetFocus</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Highlight the txtcrtl</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># Get a handle to the TextCtrl</span>
+        <span class="n">widget</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">GetEventObject</span><span class="p">()</span>
+        <span class="c"># Select the whole control, after this event resolves</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">CallAfter</span><span class="p">(</span><span class="n">widget</span><span class="o">.</span><span class="n">SetSelection</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
+        </div>
+<div class="viewcode-block" id="DetectorDialog.resetValues"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.detector_dialog.DetectorDialog.resetValues">[docs]</a>    <span class="k">def</span> <span class="nf">resetValues</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        reset detector info</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">try</span><span class="p">:</span>
+            <span class="n">zmin</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">reset_zmin_ctl</span>
+            <span class="n">zmax</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">reset_zmax_ctl</span>
+            <span class="k">if</span> <span class="n">zmin</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
+                <span class="n">zmin</span> <span class="o">=</span> <span class="s">&quot;&quot;</span>
+            <span class="k">if</span> <span class="n">zmax</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
+                <span class="n">zmax</span> <span class="o">=</span> <span class="s">&quot;&quot;</span>    
+            <span class="bp">self</span><span class="o">.</span><span class="n">zmin_ctl</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">zmin</span><span class="p">))</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">zmax_ctl</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">zmax</span><span class="p">))</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">cmap</span> <span class="o">=</span> <span class="n">DEFAULT_CMAP</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">cmap_selector</span><span class="o">.</span><span class="n">SetStringSelection</span><span class="p">(</span><span class="s">&quot;jet&quot;</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">_on_select_cmap</span><span class="p">(</span><span class="n">event</span><span class="o">=</span><span class="bp">None</span><span class="p">)</span>
+        <span class="k">except</span><span class="p">:</span>
+            <span class="n">msg</span> <span class="o">=</span> <span class="s">&quot;error occurs while resetting Detector: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">sys</span><span class="o">.</span><span class="n">exc_value</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> <span class="n">StatusEvent</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="n">msg</span><span class="p">))</span>
+        </div>
+<div class="viewcode-block" id="DetectorDialog.checkValues"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.detector_dialog.DetectorDialog.checkValues">[docs]</a>    <span class="k">def</span> <span class="nf">checkValues</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Check the valitidity of zmin and zmax value</span>
+<span class="sd">        zmax should be a float and zmin less than zmax</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">flag</span> <span class="o">=</span> <span class="bp">True</span>
+        <span class="k">try</span><span class="p">:</span>
+            <span class="n">value</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">zmin_ctl</span><span class="o">.</span><span class="n">GetValue</span><span class="p">()</span>
+            <span class="c">#if value and float( value) == 0.0:</span>
+            <span class="c">#    flag = False</span>
+            <span class="c">#    wx.PostEvent(self.parent,</span>
+            <span class="c">#            StatusEvent(status=&quot;Enter number greater than zero&quot;))</span>
+            <span class="c">#    self.zmin_ctl.SetBackgroundColour(&quot;pink&quot;)</span>
+            <span class="c">#    self.zmin_ctl.Refresh()</span>
+            <span class="c">#else:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">zmin_ctl</span><span class="o">.</span><span class="n">SetBackgroundColour</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">WHITE</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">zmin_ctl</span><span class="o">.</span><span class="n">Refresh</span><span class="p">()</span>
+        <span class="k">except</span><span class="p">:</span>
+            <span class="n">flag</span> <span class="o">=</span> <span class="bp">False</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> <span class="n">StatusEvent</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="s">&quot;Enter float value&quot;</span><span class="p">))</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">zmin_ctl</span><span class="o">.</span><span class="n">SetBackgroundColour</span><span class="p">(</span><span class="s">&quot;pink&quot;</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">zmin_ctl</span><span class="o">.</span><span class="n">Refresh</span><span class="p">()</span>
+        <span class="k">try</span><span class="p">:</span>
+            <span class="n">value</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">zmax_ctl</span><span class="o">.</span><span class="n">GetValue</span><span class="p">()</span>
+            <span class="k">if</span> <span class="n">value</span> <span class="ow">and</span> <span class="nb">float</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> <span class="o">==</span> <span class="mf">0.0</span><span class="p">:</span>
+                <span class="n">flag</span> <span class="o">=</span> <span class="bp">False</span>
+                <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span>
+                        <span class="n">StatusEvent</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="s">&quot;Enter number greater than zero&quot;</span><span class="p">))</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">zmax_ctl</span><span class="o">.</span><span class="n">SetBackgroundColour</span><span class="p">(</span><span class="s">&quot;pink&quot;</span><span class="p">)</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">zmax_ctl</span><span class="o">.</span><span class="n">Refresh</span><span class="p">()</span>
+            <span class="k">else</span><span class="p">:</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">zmax_ctl</span><span class="o">.</span><span class="n">SetBackgroundColour</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">WHITE</span><span class="p">)</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">zmax_ctl</span><span class="o">.</span><span class="n">Refresh</span><span class="p">()</span>
+        <span class="k">except</span><span class="p">:</span>
+            <span class="n">flag</span> <span class="o">=</span> <span class="bp">False</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> <span class="n">StatusEvent</span><span class="p">(</span><span class="n">status</span><span class="o">=</span><span class="s">&quot;Enter Integer value&quot;</span><span class="p">))</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">zmax_ctl</span><span class="o">.</span><span class="n">SetBackgroundColour</span><span class="p">(</span><span class="s">&quot;pink&quot;</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">zmax_ctl</span><span class="o">.</span><span class="n">Refresh</span><span class="p">()</span>
+        <span class="k">if</span> <span class="n">flag</span><span class="p">:</span>
+            <span class="n">event</span><span class="o">.</span><span class="n">Skip</span><span class="p">(</span><span class="bp">True</span><span class="p">)</span>
+    </div>
+<div class="viewcode-block" id="DetectorDialog.setContent"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.detector_dialog.DetectorDialog.setContent">[docs]</a>    <span class="k">def</span> <span class="nf">setContent</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">xnpts</span><span class="p">,</span> <span class="n">ynpts</span><span class="p">,</span> <span class="n">qmax</span><span class="p">,</span> <span class="n">beam</span><span class="p">,</span>
+                   <span class="n">zmin</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">zmax</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">sym</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        received value and displayed them</span>
+<span class="sd">        </span>
+<span class="sd">        :param xnpts: the number of point of the x_bins of data</span>
+<span class="sd">        :param ynpts: the number of point of the y_bins of data</span>
+<span class="sd">        :param qmax: the maxmimum value of data pixel</span>
+<span class="sd">        :param beam: the radius of the beam</span>
+<span class="sd">        :param zmin:  the value to get the minimum color</span>
+<span class="sd">        :param zmax:  the value to get the maximum color</span>
+<span class="sd">        :param sym:</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">xnpts_ctl</span><span class="o">.</span><span class="n">SetLabel</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">format_number</span><span class="p">(</span><span class="n">xnpts</span><span class="p">)))</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">ynpts_ctl</span><span class="o">.</span><span class="n">SetLabel</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">format_number</span><span class="p">(</span><span class="n">ynpts</span><span class="p">)))</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">qmax_ctl</span><span class="o">.</span><span class="n">SetLabel</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">format_number</span><span class="p">(</span><span class="n">qmax</span><span class="p">)))</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">beam_ctl</span><span class="o">.</span><span class="n">SetLabel</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">format_number</span><span class="p">(</span><span class="n">beam</span><span class="p">)))</span>
+        <span class="k">if</span> <span class="n">zmin</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">zmin_ctl</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">format_number</span><span class="p">(</span><span class="n">zmin</span><span class="p">)))</span>
+        <span class="k">if</span> <span class="n">zmax</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">zmax_ctl</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">format_number</span><span class="p">(</span><span class="n">zmax</span><span class="p">)))</span>
+</div>
+<div class="viewcode-block" id="DetectorDialog.getContent"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.detector_dialog.DetectorDialog.getContent">[docs]</a>    <span class="k">def</span> <span class="nf">getContent</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        return event containing value to reset the detector of a given data</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">event</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">Event</span><span class="p">()</span>
+        <span class="n">t_min</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">zmin_ctl</span><span class="o">.</span><span class="n">GetValue</span><span class="p">()</span>
+        <span class="n">t_max</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">zmax_ctl</span><span class="o">.</span><span class="n">GetValue</span><span class="p">()</span>
+        <span class="n">v_min</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="n">v_max</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">t_min</span><span class="o">.</span><span class="n">lstrip</span><span class="p">())</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
+            <span class="k">try</span><span class="p">:</span>
+                <span class="n">v_min</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">t_min</span><span class="p">)</span>
+            <span class="k">except</span><span class="p">:</span>
+                <span class="n">v_min</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">t_max</span><span class="o">.</span><span class="n">lstrip</span><span class="p">())</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
+            <span class="k">try</span><span class="p">:</span>
+                <span class="n">v_max</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">t_max</span><span class="p">)</span>
+            <span class="k">except</span><span class="p">:</span>
+                <span class="n">v_max</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">zmin</span> <span class="o">=</span> <span class="n">v_min</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">zmax</span> <span class="o">=</span> <span class="n">v_max</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">cmap</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">cmap</span>
+        <span class="k">return</span> <span class="n">event</span>
+</div>
+    <span class="k">def</span> <span class="nf">__set_properties</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        set proprieties of the dialog window</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">SetTitle</span><span class="p">(</span><span class="s">&quot;2D Color Map&quot;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">SetSize</span><span class="p">((</span><span class="mi">600</span><span class="p">,</span> <span class="mi">595</span><span class="p">))</span>
+
+    <span class="k">def</span> <span class="nf">__do_layout</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        fill the dialog window .</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">sizer_main</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">BoxSizer</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">VERTICAL</span><span class="p">)</span>
+        <span class="n">sizer_button</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">BoxSizer</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">HORIZONTAL</span><span class="p">)</span>
+        <span class="n">sizer_params</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">GridBagSizer</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
+        <span class="n">sizer_colormap</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">BoxSizer</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">VERTICAL</span><span class="p">)</span>
+        <span class="n">sizer_selection</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">BoxSizer</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">HORIZONTAL</span><span class="p">)</span>
+       
+        <span class="n">iy</span> <span class="o">=</span> <span class="mi">0</span>
+        <span class="n">sizer_params</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">label_xnpts</span><span class="p">,</span> <span class="p">(</span><span class="n">iy</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span>
+                          <span class="n">wx</span><span class="o">.</span><span class="n">LEFT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ADJUST_MINSIZE</span><span class="p">,</span> <span class="mi">15</span><span class="p">)</span>
+        <span class="n">sizer_params</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">xnpts_ctl</span><span class="p">,</span>   <span class="p">(</span><span class="n">iy</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span>
+                         <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ADJUST_MINSIZE</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
+        <span class="n">iy</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">sizer_params</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">label_ynpts</span><span class="p">,</span> <span class="p">(</span><span class="n">iy</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span>
+                         <span class="n">wx</span><span class="o">.</span><span class="n">LEFT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ADJUST_MINSIZE</span><span class="p">,</span> <span class="mi">15</span><span class="p">)</span>
+        <span class="n">sizer_params</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">ynpts_ctl</span><span class="p">,</span>   <span class="p">(</span><span class="n">iy</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span>
+                         <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ADJUST_MINSIZE</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
+        <span class="n">iy</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">sizer_params</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">label_qmax</span><span class="p">,</span> <span class="p">(</span><span class="n">iy</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span>
+                         <span class="n">wx</span><span class="o">.</span><span class="n">LEFT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ADJUST_MINSIZE</span><span class="p">,</span> <span class="mi">15</span><span class="p">)</span>
+        <span class="n">sizer_params</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">qmax_ctl</span><span class="p">,</span>   <span class="p">(</span><span class="n">iy</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span>
+                         <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ADJUST_MINSIZE</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
+        <span class="n">iy</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">sizer_params</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">label_beam</span><span class="p">,</span> <span class="p">(</span><span class="n">iy</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span>
+                         <span class="n">wx</span><span class="o">.</span><span class="n">LEFT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ADJUST_MINSIZE</span><span class="p">,</span> <span class="mi">15</span><span class="p">)</span>
+        <span class="n">sizer_params</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">beam_ctl</span><span class="p">,</span>   <span class="p">(</span><span class="n">iy</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span>
+                         <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ADJUST_MINSIZE</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
+        <span class="n">iy</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">sizer_params</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">label_zmin</span><span class="p">,</span> <span class="p">(</span><span class="n">iy</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span>
+                         <span class="n">wx</span><span class="o">.</span><span class="n">LEFT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ADJUST_MINSIZE</span><span class="p">,</span> <span class="mi">15</span><span class="p">)</span>
+        <span class="n">sizer_params</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">zmin_ctl</span><span class="p">,</span>   <span class="p">(</span><span class="n">iy</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span>
+                         <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ADJUST_MINSIZE</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
+        <span class="n">iy</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">sizer_params</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">label_zmax</span><span class="p">,</span> <span class="p">(</span><span class="n">iy</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span>
+                         <span class="n">wx</span><span class="o">.</span><span class="n">LEFT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ADJUST_MINSIZE</span><span class="p">,</span> <span class="mi">15</span><span class="p">)</span>
+        <span class="n">sizer_params</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">zmax_ctl</span><span class="p">,</span>   <span class="p">(</span><span class="n">iy</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span>
+                         <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ADJUST_MINSIZE</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
+        <span class="n">iy</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">fig</span> <span class="o">=</span> <span class="n">mpl</span><span class="o">.</span><span class="n">figure</span><span class="o">.</span><span class="n">Figure</span><span class="p">(</span><span class="n">dpi</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">dpi</span><span class="p">,</span> <span class="n">figsize</span><span class="o">=</span><span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="mi">1</span><span class="p">))</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">ax1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">fig</span><span class="o">.</span><span class="n">add_axes</span><span class="p">([</span><span class="mf">0.05</span><span class="p">,</span> <span class="mf">0.65</span><span class="p">,</span> <span class="mf">0.9</span><span class="p">,</span> <span class="mf">0.15</span><span class="p">])</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">norm</span> <span class="o">=</span> <span class="n">mpl</span><span class="o">.</span><span class="n">colors</span><span class="o">.</span><span class="n">Normalize</span><span class="p">(</span><span class="n">vmin</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">vmax</span><span class="o">=</span><span class="mi">100</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">cb1</span> <span class="o">=</span> <span class="n">mpl</span><span class="o">.</span><span class="n">colorbar</span><span class="o">.</span><span class="n">ColorbarBase</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">ax1</span><span class="p">,</span> <span class="n">cmap</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">cmap</span><span class="p">,</span>
+                                           <span class="n">norm</span><span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">norm</span><span class="p">,</span>
+                                           <span class="n">orientation</span><span class="o">=</span><span class="s">&#39;horizontal&#39;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">cb1</span><span class="o">.</span><span class="n">set_label</span><span class="p">(</span><span class="s">&#39;Detector Colors&#39;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">canvas</span> <span class="o">=</span> <span class="n">Canvas</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">fig</span><span class="p">)</span>
+        <span class="n">sizer_colormap</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">canvas</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">LEFT</span> <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="p">,</span><span class="mi">5</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">cmap_selector</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ComboBox</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">cmap_selector</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">cmap</span><span class="o">.</span><span class="n">name</span><span class="p">))</span>
+        <span class="n">maps</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">m</span> <span class="k">for</span> <span class="n">m</span> <span class="ow">in</span> <span class="n">pylab</span><span class="o">.</span><span class="n">cm</span><span class="o">.</span><span class="n">datad</span> <span class="k">if</span> <span class="ow">not</span> <span class="n">m</span><span class="o">.</span><span class="n">endswith</span><span class="p">(</span><span class="s">&quot;_r&quot;</span><span class="p">))</span>
+       
+        <span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">m</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">maps</span><span class="p">):</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">cmap_selector</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">m</span><span class="p">),</span> <span class="n">pylab</span><span class="o">.</span><span class="n">get_cmap</span><span class="p">(</span><span class="n">m</span><span class="p">))</span>
+        
+        <span class="n">wx</span><span class="o">.</span><span class="n">EVT_COMBOBOX</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">cmap_selector</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_on_select_cmap</span><span class="p">)</span>
+        <span class="n">sizer_selection</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s">&quot;Select Cmap: &quot;</span><span class="p">),</span> <span class="mi">0</span><span class="p">,</span>
+                             <span class="n">wx</span><span class="o">.</span><span class="n">LEFT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ADJUST_MINSIZE</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span> 
+        <span class="n">sizer_selection</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">cmap_selector</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ALL</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span>
+        <span class="n">sizer_main</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">sizer_params</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ALL</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
+        <span class="n">sizer_main</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">sizer_selection</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ALL</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
+        <span class="n">note</span> <span class="o">=</span> <span class="s">&quot;   Note: This is one time option. &quot;</span> <span class="o">+</span>\
+               <span class="s">&quot;It will be reset on updating the image.&quot;</span>
+        <span class="n">note_txt</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">note</span><span class="p">)</span>
+        <span class="n">sizer_main</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">note_txt</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ALL</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
+        <span class="n">sizer_main</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">sizer_colormap</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ALL</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
+        <span class="n">sizer_main</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">static_line_3</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
+        <span class="n">sizer_button</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">button_reset</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">LEFT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ADJUST_MINSIZE</span><span class="p">,</span> <span class="mi">100</span><span class="p">)</span>
+        <span class="n">sizer_button</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">button_OK</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">LEFT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ADJUST_MINSIZE</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span>
+        <span class="n">sizer_button</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">button_Cancel</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span>
+                         <span class="n">wx</span><span class="o">.</span><span class="n">LEFT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">RIGHT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ADJUST_MINSIZE</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span>
+        <span class="n">sizer_main</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">sizer_button</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">BOTTOM</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">TOP</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">SetAutoLayout</span><span class="p">(</span><span class="bp">True</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">SetSizer</span><span class="p">(</span><span class="n">sizer_main</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">Layout</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">Centre</span><span class="p">()</span>
+        <span class="c"># end wxGlade</span>
+        
+    <span class="k">def</span> <span class="nf">_on_select_cmap</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        display a new cmap </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">cmap_name</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">cmap_selector</span><span class="o">.</span><span class="n">GetCurrentSelection</span><span class="p">()</span>
+        <span class="n">current_cmap</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">cmap_selector</span><span class="o">.</span><span class="n">GetClientData</span><span class="p">(</span><span class="n">cmap_name</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">cmap</span> <span class="o">=</span> <span class="n">current_cmap</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">cb1</span> <span class="o">=</span> <span class="n">mpl</span><span class="o">.</span><span class="n">colorbar</span><span class="o">.</span><span class="n">ColorbarBase</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">ax1</span><span class="p">,</span> <span class="n">cmap</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">cmap</span><span class="p">,</span>
+                                     <span class="n">norm</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">norm</span><span class="p">,</span> <span class="n">orientation</span><span class="o">=</span><span class="s">&#39;horizontal&#39;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">draw</span><span class="p">()</span></div>
+</pre></div>
+
+          </div>
+        </div>
+      </div>
+      <div class="sphinxsidebar">
+        <div class="sphinxsidebarwrapper">
+<div id="searchbox" style="display: none">
+  <h3>Quick search</h3>
+    <form class="search" action="../../../../../search.html" method="get">
+      <input type="text" name="q" />
+      <input type="submit" value="Go" />
+      <input type="hidden" name="check_keywords" value="yes" />
+      <input type="hidden" name="area" value="default" />
+    </form>
+    <p class="searchtip" style="font-size: 90%">
+    Enter search terms or a module, class or function name.
+    </p>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+        </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" >sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>
+    <div class="footer">
+        &copy; Copyright 2013, The SasView Project.
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
+    </div>
+  </body>
+</html>
Index: _modules/sas/guiframe/local_perspectives/plotting/graphAppearance.html
===================================================================
--- _modules/sas/guiframe/local_perspectives/plotting/graphAppearance.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
+++ _modules/sas/guiframe/local_perspectives/plotting/graphAppearance.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
@@ -0,0 +1,419 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>sas.guiframe.local_perspectives.plotting.graphAppearance &mdash; SasView 3.0.0 documentation</title>
+    
+    <link rel="stylesheet" href="../../../../../_static/default.css" type="text/css" />
+    <link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '../../../../../',
+        VERSION:     '3.0.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="../../../../../_static/jquery.js"></script>
+    <script type="text/javascript" src="../../../../../_static/underscore.js"></script>
+    <script type="text/javascript" src="../../../../../_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <link rel="top" title="SasView 3.0.0 documentation" href="../../../../../index.html" />
+    <link rel="up" title="sas.guiframe" href="../../../guiframe.html" /> 
+  </head>
+  <body>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" accesskey="U">sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>  
+
+    <div class="document">
+      <div class="documentwrapper">
+        <div class="bodywrapper">
+          <div class="body">
+            
+  <h1>Source code for sas.guiframe.local_perspectives.plotting.graphAppearance</h1><div class="highlight"><pre>
+<span class="c">#!/usr/bin/python</span>
+
+<span class="sd">&quot;&quot;&quot;</span>
+
+<span class="sd">Dialog for general graph appearance</span>
+
+
+<span class="sd">/**</span>
+<span class="sd">    This software was developed by Institut Laue-Langevin as part of</span>
+<span class="sd">    Distributed Data Analysis of Neutron Scattering Experiments (DANSE).</span>
+
+<span class="sd">    Copyright 2012 Institut Laue-Langevin</span>
+
+<span class="sd">**/</span>
+
+
+<span class="sd">&quot;&quot;&quot;</span>
+
+<span class="kn">import</span> <span class="nn">wx</span>
+<span class="kn">from</span> <span class="nn">sas.plottools.SimpleFont</span> <span class="kn">import</span> <span class="n">SimpleFont</span>
+
+<span class="n">COLOR</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;black&#39;</span><span class="p">,</span> <span class="s">&#39;blue&#39;</span><span class="p">,</span> <span class="s">&#39;green&#39;</span><span class="p">,</span> <span class="s">&#39;red&#39;</span><span class="p">,</span> <span class="s">&#39;cyan&#39;</span><span class="p">,</span> <span class="s">&#39;magenta&#39;</span><span class="p">,</span> <span class="s">&#39;yellow&#39;</span><span class="p">]</span>
+
+
+<div class="viewcode-block" id="graphAppearance"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.graphAppearance.graphAppearance">[docs]</a><span class="k">class</span> <span class="nc">graphAppearance</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">Frame</span><span class="p">):</span>
+
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">title</span><span class="p">,</span> <span class="n">legend</span><span class="o">=</span><span class="bp">True</span><span class="p">):</span>
+        <span class="nb">super</span><span class="p">(</span><span class="n">graphAppearance</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="n">parent</span><span class="p">,</span> <span class="n">title</span><span class="o">=</span><span class="n">title</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="p">(</span><span class="mi">520</span><span class="p">,</span> <span class="mi">435</span><span class="p">))</span>
+
+        <span class="bp">self</span><span class="o">.</span><span class="n">legend</span> <span class="o">=</span> <span class="n">legend</span>
+
+        <span class="bp">self</span><span class="o">.</span><span class="n">InitUI</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">Centre</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">Show</span><span class="p">()</span>
+
+        <span class="bp">self</span><span class="o">.</span><span class="n">xfont</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">yfont</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">is_xtick</span> <span class="o">=</span> <span class="bp">False</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">is_ytick</span> <span class="o">=</span> <span class="bp">False</span>
+
+
+<div class="viewcode-block" id="graphAppearance.InitUI"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.graphAppearance.graphAppearance.InitUI">[docs]</a>    <span class="k">def</span> <span class="nf">InitUI</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+
+        <span class="n">panel</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Panel</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
+
+        <span class="n">vbox</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">BoxSizer</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">VERTICAL</span><span class="p">)</span>
+        <span class="n">hbox1</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">BoxSizer</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">HORIZONTAL</span><span class="p">)</span>
+        <span class="n">hbox2</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">BoxSizer</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">HORIZONTAL</span><span class="p">)</span>
+
+        <span class="n">xhbox1</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">BoxSizer</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">HORIZONTAL</span><span class="p">)</span>
+        <span class="n">xhbox2</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">BoxSizer</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">HORIZONTAL</span><span class="p">)</span>
+        <span class="n">yhbox1</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">BoxSizer</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">HORIZONTAL</span><span class="p">)</span>
+        <span class="n">yhbox2</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">BoxSizer</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">HORIZONTAL</span><span class="p">)</span>
+
+
+
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">legend</span><span class="p">:</span>
+            <span class="n">legendLocText</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s">&#39;Legend location: &#39;</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">legend_loc_combo</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ComboBox</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span><span class="n">style</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">CB_READONLY</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="p">(</span><span class="mi">180</span><span class="p">,</span><span class="o">-</span><span class="mi">1</span><span class="p">))</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">fillLegendLocs</span><span class="p">()</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">legend_loc_combo</span> <span class="o">=</span> <span class="bp">None</span>
+
+
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">legend</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">toggle_legend</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">CheckBox</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s">&#39;Toggle legend on/off&#39;</span><span class="p">)</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">toggle_legend</span> <span class="o">=</span> <span class="bp">None</span>
+
+        <span class="bp">self</span><span class="o">.</span><span class="n">toggle_grid</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">CheckBox</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s">&#39;Toggle grid on/off&#39;</span><span class="p">)</span>
+
+        
+        <span class="n">xstatic_box</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticBox</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s">&#39;x-axis label&#39;</span><span class="p">)</span>
+        <span class="n">xstatic_box_sizer</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticBoxSizer</span><span class="p">(</span><span class="n">xstatic_box</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">VERTICAL</span><span class="p">)</span>
+        <span class="n">ystatic_box</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticBox</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s">&#39;y-axis label&#39;</span><span class="p">)</span>
+        <span class="n">ystatic_box_sizer</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticBoxSizer</span><span class="p">(</span><span class="n">ystatic_box</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">VERTICAL</span><span class="p">)</span>
+
+
+        <span class="n">xaxis_label</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s">&#39;X-axis: &#39;</span><span class="p">)</span>
+        <span class="n">yaxis_label</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s">&#39;Y-axis: &#39;</span><span class="p">)</span>
+        <span class="n">unitlabel_1</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s">&#39;Units: &#39;</span><span class="p">)</span>
+        <span class="n">unitlabel_2</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s">&#39;Units: &#39;</span><span class="p">)</span>
+
+        <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_text</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">TextCtrl</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s">&quot;&quot;</span><span class="p">,</span><span class="n">size</span><span class="o">=</span><span class="p">(</span><span class="mi">220</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">))</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_text</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">TextCtrl</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s">&quot;&quot;</span><span class="p">,</span><span class="n">size</span><span class="o">=</span><span class="p">(</span><span class="mi">220</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">))</span>
+
+        <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_unit_text</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">TextCtrl</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span><span class="s">&quot;&quot;</span><span class="p">,</span><span class="n">size</span><span class="o">=</span><span class="p">(</span><span class="mi">100</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">))</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_unit_text</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">TextCtrl</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span><span class="s">&quot;&quot;</span><span class="p">,</span><span class="n">size</span><span class="o">=</span><span class="p">(</span><span class="mi">100</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">))</span>
+
+
+
+        <span class="n">xcolorLabel</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s">&#39;Font color: &#39;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">xfont_color</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ComboBox</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="p">(</span><span class="mi">100</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">),</span> <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">CB_READONLY</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">xfill_colors</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">xfont_color</span><span class="o">.</span><span class="n">SetSelection</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
+        <span class="n">xfont_button</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Button</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s">&#39;Font&#39;</span><span class="p">)</span>
+        <span class="n">xfont_button</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_BUTTON</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onxFont</span><span class="p">)</span>
+
+        <span class="n">ycolorLabel</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s">&#39;Font color: &#39;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">yfont_color</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ComboBox</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="p">(</span><span class="mi">100</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">),</span><span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">CB_READONLY</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">yfill_colors</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">yfont_color</span><span class="o">.</span><span class="n">SetSelection</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
+        <span class="n">yfont_button</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Button</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s">&#39;Font&#39;</span><span class="p">)</span>
+        <span class="n">yfont_button</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_BUTTON</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onyFont</span><span class="p">)</span>
+
+        
+
+        <span class="bp">self</span><span class="o">.</span><span class="n">cancel_button</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Button</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s">&#39;Cancel&#39;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">ok_button</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Button</span><span class="p">(</span><span class="n">panel</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s">&#39;OK&#39;</span><span class="p">)</span>
+
+        <span class="bp">self</span><span class="o">.</span><span class="n">cancel_button</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_BUTTON</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onCancel</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">ok_button</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_BUTTON</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">on_ok</span><span class="p">)</span>
+
+
+        <span class="n">xhbox1</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">xaxis_label</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALL</span> <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span>  <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_LEFT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
+        <span class="n">xhbox1</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">xaxis_text</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALL</span> <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span>  <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_LEFT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
+        <span class="n">xhbox1</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">unitlabel_1</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALL</span> <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span>  <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_RIGHT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
+        <span class="n">xhbox1</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">xaxis_unit_text</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALL</span> <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span>  <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_RIGHT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
+
+        <span class="n">yhbox1</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">yaxis_label</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALL</span> <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span>  <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_LEFT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
+        <span class="n">yhbox1</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">yaxis_text</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALL</span> <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span>  <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_LEFT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
+        <span class="n">yhbox1</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">unitlabel_2</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALL</span> <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span>  <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_RIGHT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
+        <span class="n">yhbox1</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">yaxis_unit_text</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALL</span> <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span>  <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_RIGHT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
+
+        <span class="n">xhbox2</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">xcolorLabel</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALL</span> <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_RIGHT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
+        <span class="n">xhbox2</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">xfont_color</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALL</span> <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_RIGHT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
+        <span class="n">xhbox2</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">xfont_button</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALL</span> <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_RIGHT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
+
+        <span class="n">yhbox2</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">ycolorLabel</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALL</span> <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_RIGHT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
+        <span class="n">yhbox2</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">yfont_color</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALL</span> <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_RIGHT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
+        <span class="n">yhbox2</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">yfont_button</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALL</span> <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_RIGHT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
+
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">legend</span><span class="p">:</span>
+            <span class="n">hbox1</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">legendLocText</span><span class="p">,</span> <span class="n">flag</span> <span class="o">=</span>  <span class="n">wx</span><span class="o">.</span><span class="n">ALL</span> <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span>  <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_LEFT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
+            <span class="n">hbox1</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">legend_loc_combo</span><span class="p">,</span> <span class="n">flag</span> <span class="o">=</span>  <span class="n">wx</span><span class="o">.</span><span class="n">ALL</span> <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span>  <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_LEFT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
+
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">legend</span><span class="p">:</span>
+            <span class="n">hbox1</span><span class="o">.</span><span class="n">Add</span><span class="p">((</span><span class="mi">5</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">))</span>
+            <span class="n">hbox1</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">toggle_legend</span><span class="p">,</span> <span class="n">flag</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALL</span> <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span>  <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_LEFT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
+
+        <span class="n">hbox2</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">ok_button</span><span class="p">,</span> <span class="n">flag</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALL</span> <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_RIGHT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
+        <span class="n">hbox2</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">cancel_button</span><span class="p">,</span> <span class="n">flag</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALL</span> <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_RIGHT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
+        <span class="n">hbox2</span><span class="o">.</span><span class="n">Add</span><span class="p">((</span><span class="mi">15</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">))</span>
+
+        <span class="n">xstatic_box_sizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">xhbox1</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span> <span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
+        <span class="n">xstatic_box_sizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">xhbox2</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALL</span> <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_RIGHT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
+        <span class="n">ystatic_box_sizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">yhbox1</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
+        <span class="n">ystatic_box_sizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">yhbox2</span><span class="p">,</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALL</span> <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_RIGHT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
+
+        <span class="n">vbox</span><span class="o">.</span><span class="n">Add</span><span class="p">((</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">20</span><span class="p">))</span>
+        <span class="n">vbox</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">hbox1</span><span class="p">,</span> <span class="n">flag</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span> <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALL</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
+        <span class="n">vbox</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">xstatic_box_sizer</span><span class="p">,</span> <span class="n">flag</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALL</span> <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
+        <span class="n">vbox</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">ystatic_box_sizer</span><span class="p">,</span> <span class="n">flag</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALL</span> <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
+
+        <span class="n">vbox</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">toggle_grid</span><span class="p">,</span> <span class="n">flag</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_RIGHT</span> <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">RIGHT</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">20</span><span class="p">)</span>
+        <span class="n">vbox</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">hbox2</span><span class="p">,</span> <span class="n">flag</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_RIGHT</span> <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALL</span> <span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
+
+
+        <span class="n">panel</span><span class="o">.</span><span class="n">SetSizer</span><span class="p">(</span><span class="n">vbox</span><span class="p">)</span>
+</div>
+<div class="viewcode-block" id="graphAppearance.xfill_colors"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.graphAppearance.graphAppearance.xfill_colors">[docs]</a>    <span class="k">def</span> <span class="nf">xfill_colors</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="n">c_list</span> <span class="o">=</span> <span class="n">COLOR</span>
+        <span class="k">for</span> <span class="n">idx</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">c_list</span><span class="p">)):</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">xfont_color</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="n">c_list</span><span class="p">[</span><span class="n">idx</span><span class="p">],</span> <span class="n">idx</span><span class="p">)</span>
+</div>
+<div class="viewcode-block" id="graphAppearance.yfill_colors"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.graphAppearance.graphAppearance.yfill_colors">[docs]</a>    <span class="k">def</span> <span class="nf">yfill_colors</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="n">c_list</span> <span class="o">=</span> <span class="n">COLOR</span>
+        <span class="k">for</span> <span class="n">idx</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">c_list</span><span class="p">)):</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">yfont_color</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="n">c_list</span><span class="p">[</span><span class="n">idx</span><span class="p">],</span> <span class="n">idx</span><span class="p">)</span>
+</div>
+<div class="viewcode-block" id="graphAppearance.onxFont"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.graphAppearance.graphAppearance.onxFont">[docs]</a>    <span class="k">def</span> <span class="nf">onxFont</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">):</span>
+        <span class="n">title</span> <span class="o">=</span> <span class="s">&#39;Modify x axis font&#39;</span>
+
+        <span class="n">fonty</span> <span class="o">=</span> <span class="n">SimpleFont</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">(),</span> <span class="n">title</span><span class="p">)</span>
+        <span class="n">fonty</span><span class="o">.</span><span class="n">set_default_font</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">xfont</span><span class="p">)</span>
+        <span class="n">fonty</span><span class="o">.</span><span class="n">set_ticklabel_check</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">is_xtick</span><span class="p">)</span>
+        <span class="k">if</span><span class="p">(</span><span class="n">fonty</span><span class="o">.</span><span class="n">ShowModal</span><span class="p">()</span> <span class="o">==</span> <span class="n">wx</span><span class="o">.</span><span class="n">ID_OK</span><span class="p">):</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">xfont</span> <span class="o">=</span> <span class="n">fonty</span><span class="o">.</span><span class="n">get_font</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">is_xtick</span> <span class="o">=</span> <span class="n">fonty</span><span class="o">.</span><span class="n">get_ticklabel_check</span><span class="p">()</span>
+</div>
+<div class="viewcode-block" id="graphAppearance.onyFont"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.graphAppearance.graphAppearance.onyFont">[docs]</a>    <span class="k">def</span> <span class="nf">onyFont</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">):</span>
+        <span class="n">title</span> <span class="o">=</span> <span class="s">&#39;Modify y axis font&#39;</span>
+        <span class="n">fonty</span> <span class="o">=</span> <span class="n">SimpleFont</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">(),</span> <span class="n">title</span><span class="p">)</span>
+        <span class="n">fonty</span><span class="o">.</span><span class="n">set_default_font</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">yfont</span><span class="p">)</span>
+        <span class="n">fonty</span><span class="o">.</span><span class="n">set_ticklabel_check</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">is_ytick</span><span class="p">)</span>
+        <span class="k">if</span><span class="p">(</span><span class="n">fonty</span><span class="o">.</span><span class="n">ShowModal</span><span class="p">()</span> <span class="o">==</span> <span class="n">wx</span><span class="o">.</span><span class="n">ID_OK</span><span class="p">):</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">yfont</span> <span class="o">=</span> <span class="n">fonty</span><span class="o">.</span><span class="n">get_font</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">is_ytick</span> <span class="o">=</span> <span class="n">fonty</span><span class="o">.</span><span class="n">get_ticklabel_check</span><span class="p">()</span>
+</div>
+<div class="viewcode-block" id="graphAppearance.on_ok"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.graphAppearance.graphAppearance.on_ok">[docs]</a>    <span class="k">def</span> <span class="nf">on_ok</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">):</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">Close</span><span class="p">()</span>
+</div>
+<div class="viewcode-block" id="graphAppearance.onCancel"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.graphAppearance.graphAppearance.onCancel">[docs]</a>    <span class="k">def</span> <span class="nf">onCancel</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">e</span><span class="p">):</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">Destroy</span><span class="p">()</span>
+
+</div>
+<div class="viewcode-block" id="graphAppearance.get_loc_label"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.graphAppearance.graphAppearance.get_loc_label">[docs]</a>    <span class="k">def</span> <span class="nf">get_loc_label</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Associates label to a specific legend location</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">_labels</span> <span class="o">=</span> <span class="p">{}</span>
+        <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;best&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;upper right&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;upper left&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;lower left&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;lower right&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;right&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;center left&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;center right&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;lower center&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;upper center&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="n">i</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="n">_labels</span><span class="p">[</span><span class="s">&#39;center&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>
+        <span class="k">return</span> <span class="n">_labels</span>
+
+</div>
+<div class="viewcode-block" id="graphAppearance.fillLegendLocs"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.graphAppearance.graphAppearance.fillLegendLocs">[docs]</a>    <span class="k">def</span> <span class="nf">fillLegendLocs</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+
+        <span class="c"># labels = []</span>
+        <span class="c"># for label in self.get_loc_label():</span>
+        <span class="c">#     labels.append(str(label))</span>
+
+        <span class="c"># for label in reversed(labels):</span>
+        <span class="c">#     self.legend_loc_combo.Append(label)</span>
+        <span class="k">for</span> <span class="n">label</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_loc_label</span><span class="p">():</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">legend_loc_combo</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="n">label</span><span class="p">)</span>
+
+</div>
+<div class="viewcode-block" id="graphAppearance.setDefaults"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.graphAppearance.graphAppearance.setDefaults">[docs]</a>    <span class="k">def</span> <span class="nf">setDefaults</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="n">grid</span><span class="p">,</span><span class="n">legend</span><span class="p">,</span><span class="n">xlab</span><span class="p">,</span><span class="n">ylab</span><span class="p">,</span><span class="n">xunit</span><span class="p">,</span><span class="n">yunit</span><span class="p">,</span>
+                    <span class="n">xaxis_font</span><span class="p">,</span><span class="n">yaxis_font</span><span class="p">,</span><span class="n">legend_loc</span><span class="p">,</span>
+                    <span class="n">xcolor</span><span class="p">,</span><span class="n">ycolor</span><span class="p">,</span> <span class="n">is_xtick</span><span class="p">,</span> <span class="n">is_ytick</span><span class="p">):</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">toggle_grid</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="n">grid</span><span class="p">)</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">legend</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">toggle_legend</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="n">legend</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_text</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="n">xlab</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_text</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="n">ylab</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_unit_text</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="n">xunit</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_unit_text</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="n">yunit</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">xfont</span> <span class="o">=</span> <span class="n">xaxis_font</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">yfont</span> <span class="o">=</span> <span class="n">yaxis_font</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">is_xtick</span> <span class="o">=</span> <span class="n">is_xtick</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">is_ytick</span> <span class="o">=</span> <span class="n">is_ytick</span>
+
+        <span class="k">if</span> <span class="ow">not</span> <span class="n">xcolor</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">xfont_color</span><span class="o">.</span><span class="n">SetSelection</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">xfont_color</span><span class="o">.</span><span class="n">SetStringSelection</span><span class="p">(</span><span class="n">xcolor</span><span class="p">)</span>
+
+        <span class="k">if</span> <span class="ow">not</span> <span class="n">ycolor</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">yfont_color</span><span class="o">.</span><span class="n">SetSelection</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">yfont_color</span><span class="o">.</span><span class="n">SetStringSelection</span><span class="p">(</span><span class="n">ycolor</span><span class="p">)</span>
+            
+
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">legend</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">legend_loc_combo</span><span class="o">.</span><span class="n">SetStringSelection</span><span class="p">(</span><span class="n">legend_loc</span><span class="p">)</span>
+
+
+    <span class="c"># get whether grid is toggled on/off</span></div>
+<div class="viewcode-block" id="graphAppearance.get_togglegrid"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.graphAppearance.graphAppearance.get_togglegrid">[docs]</a>    <span class="k">def</span> <span class="nf">get_togglegrid</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">toggle_grid</span><span class="o">.</span><span class="n">GetValue</span><span class="p">()</span>
+
+    <span class="c"># get whether legend is toggled on/off</span></div>
+<div class="viewcode-block" id="graphAppearance.get_togglelegend"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.graphAppearance.graphAppearance.get_togglelegend">[docs]</a>    <span class="k">def</span> <span class="nf">get_togglelegend</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">toggle_legend</span><span class="o">.</span><span class="n">GetValue</span><span class="p">()</span>
+
+    <span class="c"># get x label</span></div>
+<div class="viewcode-block" id="graphAppearance.get_xlab"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.graphAppearance.graphAppearance.get_xlab">[docs]</a>    <span class="k">def</span> <span class="nf">get_xlab</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_text</span><span class="o">.</span><span class="n">GetValue</span><span class="p">()</span>
+
+    <span class="c"># get y label</span></div>
+<div class="viewcode-block" id="graphAppearance.get_ylab"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.graphAppearance.graphAppearance.get_ylab">[docs]</a>    <span class="k">def</span> <span class="nf">get_ylab</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_text</span><span class="o">.</span><span class="n">GetValue</span><span class="p">()</span>
+
+    <span class="c"># get x unit</span></div>
+<div class="viewcode-block" id="graphAppearance.get_xunit"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.graphAppearance.graphAppearance.get_xunit">[docs]</a>    <span class="k">def</span> <span class="nf">get_xunit</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_unit_text</span><span class="o">.</span><span class="n">GetValue</span><span class="p">()</span>
+
+    <span class="c"># get y unit</span></div>
+<div class="viewcode-block" id="graphAppearance.get_yunit"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.graphAppearance.graphAppearance.get_yunit">[docs]</a>    <span class="k">def</span> <span class="nf">get_yunit</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_unit_text</span><span class="o">.</span><span class="n">GetValue</span><span class="p">()</span>
+
+    <span class="c"># get legend location</span></div>
+<div class="viewcode-block" id="graphAppearance.get_legend_loc"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.graphAppearance.graphAppearance.get_legend_loc">[docs]</a>    <span class="k">def</span> <span class="nf">get_legend_loc</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_loc_label</span><span class="p">()[</span><span class="bp">self</span><span class="o">.</span><span class="n">legend_loc_combo</span><span class="o">.</span><span class="n">GetStringSelection</span><span class="p">()]</span>
+
+    <span class="c"># get x axis label color</span></div>
+<div class="viewcode-block" id="graphAppearance.get_xcolor"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.graphAppearance.graphAppearance.get_xcolor">[docs]</a>    <span class="k">def</span> <span class="nf">get_xcolor</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">xfont_color</span><span class="o">.</span><span class="n">GetValue</span><span class="p">()</span>
+
+    <span class="c"># get y axis label color</span></div>
+<div class="viewcode-block" id="graphAppearance.get_ycolor"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.graphAppearance.graphAppearance.get_ycolor">[docs]</a>    <span class="k">def</span> <span class="nf">get_ycolor</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">yfont_color</span><span class="o">.</span><span class="n">GetValue</span><span class="p">()</span>
+
+    <span class="c"># get x axis font (type is FontProperties)</span></div>
+<div class="viewcode-block" id="graphAppearance.get_xfont"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.graphAppearance.graphAppearance.get_xfont">[docs]</a>    <span class="k">def</span> <span class="nf">get_xfont</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">xfont</span>
+
+    <span class="c"># get y axis font</span></div>
+<div class="viewcode-block" id="graphAppearance.get_yfont"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.graphAppearance.graphAppearance.get_yfont">[docs]</a>    <span class="k">def</span> <span class="nf">get_yfont</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">yfont</span>
+    </div>
+<div class="viewcode-block" id="graphAppearance.get_xtick_check"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.graphAppearance.graphAppearance.get_xtick_check">[docs]</a>    <span class="k">def</span> <span class="nf">get_xtick_check</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_xtick</span>
+</div>
+<div class="viewcode-block" id="graphAppearance.get_ytick_check"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.graphAppearance.graphAppearance.get_ytick_check">[docs]</a>    <span class="k">def</span> <span class="nf">get_ytick_check</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_ytick</span>
+    
+</div></div>
+<span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&#39;__main__&#39;</span><span class="p">:</span>
+
+    <span class="n">app</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">App</span><span class="p">()</span>
+    <span class="n">graphD</span> <span class="o">=</span> <span class="n">graphAppearance</span><span class="p">(</span><span class="bp">None</span><span class="p">,</span><span class="n">title</span><span class="o">=</span><span class="s">&#39;Modify graph appearance&#39;</span><span class="p">)</span>
+    <span class="n">app</span><span class="o">.</span><span class="n">MainLoop</span><span class="p">()</span>
+</pre></div>
+
+          </div>
+        </div>
+      </div>
+      <div class="sphinxsidebar">
+        <div class="sphinxsidebarwrapper">
+<div id="searchbox" style="display: none">
+  <h3>Quick search</h3>
+    <form class="search" action="../../../../../search.html" method="get">
+      <input type="text" name="q" />
+      <input type="submit" value="Go" />
+      <input type="hidden" name="check_keywords" value="yes" />
+      <input type="hidden" name="area" value="default" />
+    </form>
+    <p class="searchtip" style="font-size: 90%">
+    Enter search terms or a module, class or function name.
+    </p>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+        </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" >sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>
+    <div class="footer">
+        &copy; Copyright 2013, The SasView Project.
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
+    </div>
+  </body>
+</html>
Index: _modules/sas/guiframe/local_perspectives/plotting/help_panel.html
===================================================================
--- _modules/sas/guiframe/local_perspectives/plotting/help_panel.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
+++ _modules/sas/guiframe/local_perspectives/plotting/help_panel.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
@@ -0,0 +1,207 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>sas.guiframe.local_perspectives.plotting.help_panel &mdash; SasView 3.0.0 documentation</title>
+    
+    <link rel="stylesheet" href="../../../../../_static/default.css" type="text/css" />
+    <link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '../../../../../',
+        VERSION:     '3.0.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="../../../../../_static/jquery.js"></script>
+    <script type="text/javascript" src="../../../../../_static/underscore.js"></script>
+    <script type="text/javascript" src="../../../../../_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <link rel="top" title="SasView 3.0.0 documentation" href="../../../../../index.html" />
+    <link rel="up" title="sas.guiframe" href="../../../guiframe.html" /> 
+  </head>
+  <body>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" accesskey="U">sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>  
+
+    <div class="document">
+      <div class="documentwrapper">
+        <div class="bodywrapper">
+          <div class="body">
+            
+  <h1>Source code for sas.guiframe.local_perspectives.plotting.help_panel</h1><div class="highlight"><pre>
+<span class="c">#!/usr/bin/python</span>
+<span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">Help panel for plotting</span>
+<span class="sd">&quot;&quot;&quot;</span>
+<span class="kn">import</span> <span class="nn">os</span>
+<span class="kn">import</span> <span class="nn">wx</span>
+<span class="kn">import</span> <span class="nn">wx.html</span> <span class="kn">as</span> <span class="nn">html</span>
+<span class="kn">from</span> <span class="nn">wx.lib.splitter</span> <span class="kn">import</span> <span class="n">MultiSplitterWindow</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe</span> <span class="kn">import</span> <span class="n">get_media_path</span>
+
+
+<div class="viewcode-block" id="HelpWindow"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.help_panel.HelpWindow">[docs]</a><span class="k">class</span> <span class="nc">HelpWindow</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">Frame</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">title</span><span class="o">=</span><span class="s">&#39;Plotting Help&#39;</span><span class="p">,</span> <span class="n">pageToOpen</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">Frame</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">title</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="p">(</span><span class="mi">700</span><span class="p">,</span> <span class="mi">450</span><span class="p">))</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">             contains help info</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">SetTitle</span><span class="p">(</span><span class="s">&#39;Plotting Help&#39;</span><span class="p">)</span> 
+        <span class="n">splitter</span> <span class="o">=</span> <span class="n">MultiSplitterWindow</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">SP_LIVE_UPDATE</span><span class="p">)</span>
+        <span class="n">rpanel</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Panel</span><span class="p">(</span><span class="n">splitter</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
+        <span class="n">lpanel</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Panel</span><span class="p">(</span><span class="n">splitter</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">BORDER_SUNKEN</span><span class="p">)</span>
+        
+        <span class="n">vbox</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">BoxSizer</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">VERTICAL</span><span class="p">)</span>
+        <span class="n">header</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Panel</span><span class="p">(</span><span class="n">rpanel</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
+        <span class="n">header</span><span class="o">.</span><span class="n">SetBackgroundColour</span><span class="p">(</span><span class="s">&#39;#6666FF&#39;</span><span class="p">)</span>
+        <span class="n">header</span><span class="o">.</span><span class="n">SetForegroundColour</span><span class="p">(</span><span class="s">&#39;WHITE&#39;</span><span class="p">)</span>
+        <span class="n">hbox</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">BoxSizer</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">HORIZONTAL</span><span class="p">)</span>
+        <span class="n">st</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="n">header</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s">&#39;Contents&#39;</span><span class="p">,</span> <span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="mi">5</span><span class="p">))</span>
+        <span class="n">font</span> <span class="o">=</span> <span class="n">st</span><span class="o">.</span><span class="n">GetFont</span><span class="p">()</span>
+        <span class="n">font</span><span class="o">.</span><span class="n">SetPointSize</span><span class="p">(</span><span class="mi">10</span><span class="p">)</span>
+        <span class="n">st</span><span class="o">.</span><span class="n">SetFont</span><span class="p">(</span><span class="n">font</span><span class="p">)</span>
+        <span class="n">hbox</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">st</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">TOP</span> <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">BOTTOM</span> <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">LEFT</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
+        <span class="n">header</span><span class="o">.</span><span class="n">SetSizer</span><span class="p">(</span><span class="n">hbox</span><span class="p">)</span>
+        <span class="n">vbox</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">header</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="p">)</span>
+       
+        <span class="n">vboxl</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">BoxSizer</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">VERTICAL</span><span class="p">)</span>
+        <span class="n">headerl</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Panel</span><span class="p">(</span><span class="n">lpanel</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">20</span><span class="p">))</span>
+       
+        <span class="n">headerl</span><span class="o">.</span><span class="n">SetBackgroundColour</span><span class="p">(</span><span class="s">&#39;#6666FF&#39;</span><span class="p">)</span>
+        <span class="n">headerl</span><span class="o">.</span><span class="n">SetForegroundColour</span><span class="p">(</span><span class="s">&#39;WHITE&#39;</span><span class="p">)</span>
+        <span class="n">hboxl</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">BoxSizer</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">HORIZONTAL</span><span class="p">)</span>
+        <span class="n">lst</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="n">headerl</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s">&#39;Menu&#39;</span><span class="p">,</span> <span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="mi">5</span><span class="p">))</span>
+        <span class="n">fontl</span> <span class="o">=</span> <span class="n">lst</span><span class="o">.</span><span class="n">GetFont</span><span class="p">()</span>
+        <span class="n">fontl</span><span class="o">.</span><span class="n">SetPointSize</span><span class="p">(</span><span class="mi">10</span><span class="p">)</span>
+        <span class="n">lst</span><span class="o">.</span><span class="n">SetFont</span><span class="p">(</span><span class="n">fontl</span><span class="p">)</span>
+        <span class="n">hboxl</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">lst</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">TOP</span> <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">BOTTOM</span> <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">LEFT</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
+        <span class="n">headerl</span><span class="o">.</span><span class="n">SetSizer</span><span class="p">(</span><span class="n">hboxl</span><span class="p">)</span>
+        <span class="n">vboxl</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">headerl</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">lhelp</span> <span class="o">=</span> <span class="n">html</span><span class="o">.</span><span class="n">HtmlWindow</span><span class="p">(</span><span class="n">lpanel</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">NO_BORDER</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">rhelp</span> <span class="o">=</span> <span class="n">html</span><span class="o">.</span><span class="n">HtmlWindow</span><span class="p">(</span><span class="n">rpanel</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">NO_BORDER</span><span class="p">,</span> 
+                                     <span class="n">size</span><span class="o">=</span><span class="p">(</span><span class="mi">500</span><span class="p">,</span><span class="o">-</span><span class="mi">1</span><span class="p">))</span>
+        
+        <span class="bp">self</span><span class="o">.</span><span class="n">path</span> <span class="o">=</span> <span class="n">get_media_path</span><span class="p">(</span><span class="n">media</span><span class="o">=</span><span class="s">&#39;media&#39;</span><span class="p">)</span>
+       
+        <span class="n">page1</span> <span class="o">=</span> <span class="s">&quot;&quot;&quot;&lt;html&gt;</span>
+<span class="s">            &lt;body&gt;</span>
+<span class="s">             &lt;p&gt;Select topic on Menu&lt;/p&gt;</span>
+<span class="s">            &lt;/body&gt;</span>
+<span class="s">            &lt;/html&gt;&quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">rhelp</span><span class="o">.</span><span class="n">SetPage</span><span class="p">(</span><span class="n">page1</span><span class="p">)</span>
+        <span class="n">page</span> <span class="o">=</span> <span class="s">&quot;&quot;&quot;&lt;html&gt;</span>
+<span class="s">            &lt;body&gt;</span>
+<span class="s">            &lt;ul&gt;</span>
+<span class="s">            &lt;li&gt;&lt;a href =&quot;Graph_help.html&quot; </span>
+<span class="s">            target =&quot;showframe&quot;&gt;Graph Menu&lt;/a&gt;&lt;br&gt;&lt;/li&gt;</span>
+<span class="s">            &lt;li&gt;&lt;a href =&quot;averaging_help.html&quot; </span>
+<span class="s">            target =&quot;showframe&quot;&gt;2D Data Averaging&lt;/a&gt;&lt;br&gt;&lt;/li&gt;</span>
+<span class="s">            &lt;li&gt;&lt;a href =&quot;key_help.html&quot; </span>
+<span class="s">            target =&quot;showframe&quot;&gt;Key Combination&lt;/a&gt;&lt;br&gt;&lt;/li&gt;</span>
+<span class="s">            &lt;/ul&gt;</span>
+<span class="s">            &lt;/body&gt;</span>
+<span class="s">            &lt;/html&gt;&quot;&quot;&quot;</span>
+
+        <span class="bp">self</span><span class="o">.</span><span class="n">lhelp</span><span class="o">.</span><span class="n">SetPage</span><span class="p">(</span><span class="n">page</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">lhelp</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">html</span><span class="o">.</span><span class="n">EVT_HTML_LINK_CLICKED</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">OnLinkClicked</span><span class="p">)</span>
+        
+        <span class="n">vbox</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">rhelp</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="p">)</span>
+        <span class="n">vboxl</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">lhelp</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="p">)</span>
+        <span class="n">rpanel</span><span class="o">.</span><span class="n">SetSizer</span><span class="p">(</span><span class="n">vbox</span><span class="p">)</span>
+        <span class="n">lpanel</span><span class="o">.</span><span class="n">SetSizer</span><span class="p">(</span><span class="n">vboxl</span><span class="p">)</span>
+        <span class="n">lpanel</span><span class="o">.</span><span class="n">SetFocus</span><span class="p">()</span>
+        
+        <span class="n">vbox1</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">BoxSizer</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">HORIZONTAL</span><span class="p">)</span>
+        <span class="n">vbox1</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">splitter</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="p">)</span>
+        <span class="n">splitter</span><span class="o">.</span><span class="n">AppendWindow</span><span class="p">(</span><span class="n">lpanel</span><span class="p">,</span> <span class="mi">200</span><span class="p">)</span>
+        <span class="n">splitter</span><span class="o">.</span><span class="n">AppendWindow</span><span class="p">(</span><span class="n">rpanel</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">SetSizer</span><span class="p">(</span><span class="n">vbox1</span><span class="p">)</span>
+       
+        <span class="bp">self</span><span class="o">.</span><span class="n">Centre</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">Show</span><span class="p">(</span><span class="bp">True</span><span class="p">)</span>
+        
+<div class="viewcode-block" id="HelpWindow.OnLinkClicked"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.help_panel.HelpWindow.OnLinkClicked">[docs]</a>    <span class="k">def</span> <span class="nf">OnLinkClicked</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">            Function to diplay html page related to the hyperlinktext selected</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">link</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">GetLinkInfo</span><span class="p">()</span><span class="o">.</span><span class="n">GetHref</span><span class="p">()</span>
+        <span class="n">link</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">path</span><span class="p">,</span> <span class="n">link</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">rhelp</span><span class="o">.</span><span class="n">LoadPage</span><span class="p">(</span><span class="n">link</span><span class="p">)</span>
+        
+        </div></div>
+<div class="viewcode-block" id="ViewApp"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.help_panel.ViewApp">[docs]</a><span class="k">class</span> <span class="nc">ViewApp</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">App</span><span class="p">):</span>
+<div class="viewcode-block" id="ViewApp.OnInit"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.help_panel.ViewApp.OnInit">[docs]</a>    <span class="k">def</span> <span class="nf">OnInit</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="n">frame</span> <span class="o">=</span> <span class="n">HelpWindow</span><span class="p">(</span><span class="bp">None</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s">&#39;HelpWindow&#39;</span><span class="p">)</span>    
+        <span class="n">frame</span><span class="o">.</span><span class="n">Show</span><span class="p">(</span><span class="bp">True</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">SetTopWindow</span><span class="p">(</span><span class="n">frame</span><span class="p">)</span>
+        <span class="k">return</span> <span class="bp">True</span>
+        </div></div>
+<span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&quot;__main__&quot;</span><span class="p">:</span> 
+    <span class="n">app</span> <span class="o">=</span> <span class="n">ViewApp</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
+    <span class="n">app</span><span class="o">.</span><span class="n">MainLoop</span><span class="p">()</span>     
+</pre></div>
+
+          </div>
+        </div>
+      </div>
+      <div class="sphinxsidebar">
+        <div class="sphinxsidebarwrapper">
+<div id="searchbox" style="display: none">
+  <h3>Quick search</h3>
+    <form class="search" action="../../../../../search.html" method="get">
+      <input type="text" name="q" />
+      <input type="submit" value="Go" />
+      <input type="hidden" name="check_keywords" value="yes" />
+      <input type="hidden" name="area" value="default" />
+    </form>
+    <p class="searchtip" style="font-size: 90%">
+    Enter search terms or a module, class or function name.
+    </p>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+        </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" >sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>
+    <div class="footer">
+        &copy; Copyright 2013, The SasView Project.
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
+    </div>
+  </body>
+</html>
Index: _modules/sas/guiframe/local_perspectives/plotting/masking.html
===================================================================
--- _modules/sas/guiframe/local_perspectives/plotting/masking.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
+++ _modules/sas/guiframe/local_perspectives/plotting/masking.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
@@ -0,0 +1,930 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>sas.guiframe.local_perspectives.plotting.masking &mdash; SasView 3.0.0 documentation</title>
+    
+    <link rel="stylesheet" href="../../../../../_static/default.css" type="text/css" />
+    <link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '../../../../../',
+        VERSION:     '3.0.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="../../../../../_static/jquery.js"></script>
+    <script type="text/javascript" src="../../../../../_static/underscore.js"></script>
+    <script type="text/javascript" src="../../../../../_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <link rel="top" title="SasView 3.0.0 documentation" href="../../../../../index.html" />
+    <link rel="up" title="sas.guiframe" href="../../../guiframe.html" /> 
+  </head>
+  <body>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" accesskey="U">sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>  
+
+    <div class="document">
+      <div class="documentwrapper">
+        <div class="bodywrapper">
+          <div class="body">
+            
+  <h1>Source code for sas.guiframe.local_perspectives.plotting.masking</h1><div class="highlight"><pre>
+<span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Mask editor</span>
+<span class="sd">&quot;&quot;&quot;</span>
+<span class="c">################################################################################</span>
+<span class="c">#This software was developed by the University of Tennessee as part of the</span>
+<span class="c">#Distributed Data Analysis of Neutron Scattering Experiments (DANSE)</span>
+<span class="c">#project funded by the US National Science Foundation. </span>
+<span class="c">#</span>
+<span class="c">#If you use DANSE applications to do scientific research that leads to </span>
+<span class="c">#publication, we ask that you acknowledge the use of the software with the </span>
+<span class="c">#following sentence:</span>
+<span class="c">#</span>
+<span class="c">#This work benefited from DANSE software developed under NSF award DMR-0520547. </span>
+<span class="c">#</span>
+<span class="c">#copyright 2008, University of Tennessee</span>
+<span class="c">################################################################################</span>
+
+
+<span class="c">##Todo: cleaning up, improving the maskplotpanel initialization, and testing.</span>
+<span class="kn">import</span> <span class="nn">wx</span>
+<span class="kn">import</span> <span class="nn">sys</span>
+<span class="kn">import</span> <span class="nn">time</span>
+<span class="kn">import</span> <span class="nn">matplotlib.cm</span> <span class="kn">as</span> <span class="nn">cm</span>
+<span class="kn">import</span> <span class="nn">math</span>
+<span class="kn">import</span> <span class="nn">copy</span>
+<span class="kn">import</span> <span class="nn">numpy</span>
+<span class="kn">from</span> <span class="nn">sas.plottools.PlotPanel</span> <span class="kn">import</span> <span class="n">PlotPanel</span>
+<span class="kn">from</span> <span class="nn">sas.plottools.plottables</span> <span class="kn">import</span> <span class="n">Graph</span>
+<span class="kn">from</span> <span class="nn">binder</span> <span class="kn">import</span> <span class="n">BindArtist</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.dataFitting</span> <span class="kn">import</span> <span class="n">Data1D</span><span class="p">,</span> <span class="n">Data2D</span>
+<span class="kn">from</span> <span class="nn">boxMask</span> <span class="kn">import</span> <span class="n">BoxMask</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">SlicerEvent</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">StatusEvent</span>
+<span class="p">(</span><span class="n">InternalEvent</span><span class="p">,</span> <span class="n">EVT_INTERNAL</span><span class="p">)</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">lib</span><span class="o">.</span><span class="n">newevent</span><span class="o">.</span><span class="n">NewEvent</span><span class="p">()</span>
+
+<span class="n">DEFAULT_CMAP</span> <span class="o">=</span> <span class="n">cm</span><span class="o">.</span><span class="n">get_cmap</span><span class="p">(</span><span class="s">&#39;jet&#39;</span><span class="p">)</span>
+<span class="n">_BOX_WIDTH</span> <span class="o">=</span> <span class="mi">76</span>
+<span class="n">_SCALE</span> <span class="o">=</span> <span class="mf">1e-6</span>
+<span class="n">_STATICBOX_WIDTH</span> <span class="o">=</span> <span class="mi">380</span>
+
+<span class="c">#SLD panel size </span>
+<span class="k">if</span> <span class="n">sys</span><span class="o">.</span><span class="n">platform</span><span class="o">.</span><span class="n">count</span><span class="p">(</span><span class="s">&quot;win32&quot;</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
+    <span class="n">PANEL_SIZE</span> <span class="o">=</span> <span class="mi">350</span>
+    <span class="n">FONT_VARIANT</span> <span class="o">=</span> <span class="mi">0</span>
+<span class="k">else</span><span class="p">:</span>
+    <span class="n">PANEL_SIZE</span> <span class="o">=</span> <span class="mi">300</span>
+    <span class="n">FONT_VARIANT</span> <span class="o">=</span> <span class="mi">1</span>
+    
+<span class="kn">from</span> <span class="nn">sas.data_util.calcthread</span> <span class="kn">import</span> <span class="n">CalcThread</span>
+
+<div class="viewcode-block" id="CalcPlot"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.CalcPlot">[docs]</a><span class="k">class</span> <span class="nc">CalcPlot</span><span class="p">(</span><span class="n">CalcThread</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Compute Resolution</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
+                 <span class="nb">id</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span>
+                 <span class="n">panel</span> <span class="o">=</span> <span class="bp">None</span><span class="p">,</span>
+                 <span class="n">image</span> <span class="o">=</span> <span class="bp">None</span><span class="p">,</span>
+                 <span class="n">completefn</span> <span class="o">=</span> <span class="bp">None</span><span class="p">,</span>
+                 <span class="n">updatefn</span>   <span class="o">=</span> <span class="bp">None</span><span class="p">,</span>
+                 <span class="n">elapsed</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span>
+                 <span class="n">yieldtime</span>  <span class="o">=</span> <span class="mf">0.01</span><span class="p">,</span>
+                 <span class="n">worktime</span>   <span class="o">=</span> <span class="mf">0.01</span>
+                 <span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">CalcThread</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">completefn</span><span class="p">,</span>
+                 <span class="n">updatefn</span><span class="p">,</span>
+                 <span class="n">yieldtime</span><span class="p">,</span>
+                 <span class="n">worktime</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">starttime</span> <span class="o">=</span> <span class="mi">0</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">id</span> <span class="o">=</span> <span class="nb">id</span> 
+        <span class="bp">self</span><span class="o">.</span><span class="n">panel</span> <span class="o">=</span> <span class="n">panel</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">image</span> <span class="o">=</span> <span class="n">image</span>
+        
+        
+<div class="viewcode-block" id="CalcPlot.compute"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.CalcPlot.compute">[docs]</a>    <span class="k">def</span> <span class="nf">compute</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        excuting computation</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">elapsed</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">starttime</span>
+       
+        <span class="bp">self</span><span class="o">.</span><span class="n">complete</span><span class="p">(</span><span class="n">panel</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">panel</span><span class="p">,</span> <span class="n">image</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">image</span><span class="p">,</span> <span class="n">elapsed</span><span class="o">=</span><span class="n">elapsed</span><span class="p">)</span>
+        
+        </div></div>
+<div class="viewcode-block" id="MaskPanel"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.MaskPanel">[docs]</a><span class="k">class</span> <span class="nc">MaskPanel</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">Dialog</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Provides the Mask Editor GUI.</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="c">## Internal nickname for the window, used by the AUI manager</span>
+    <span class="n">window_name</span> <span class="o">=</span> <span class="s">&quot;Mask Editor&quot;</span>
+    <span class="c">## Name to appear on the window title bar</span>
+    <span class="n">window_caption</span> <span class="o">=</span> <span class="s">&quot;Mask Editor&quot;</span>
+    <span class="c">## Flag to tell the AUI manager to put this panel in the center pane</span>
+    <span class="n">CENTER_PANE</span> <span class="o">=</span> <span class="bp">True</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">base</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> 
+                 <span class="n">data</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="nb">id</span><span class="o">=-</span><span class="mi">1</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwds</span><span class="p">):</span>
+        <span class="n">kwds</span><span class="p">[</span><span class="s">&quot;style&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">DEFAULT_DIALOG_STYLE</span>
+        <span class="n">kwds</span><span class="p">[</span><span class="s">&quot;size&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Size</span><span class="p">(</span><span class="n">_STATICBOX_WIDTH</span><span class="o">*</span><span class="mf">0.8</span><span class="p">,</span> <span class="n">PANEL_SIZE</span><span class="p">)</span> 
+        <span class="n">wx</span><span class="o">.</span><span class="n">Dialog</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="nb">id</span><span class="o">=</span><span class="nb">id</span><span class="p">,</span>  <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwds</span><span class="p">)</span>
+        
+        <span class="k">if</span> <span class="n">data</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="c">#Font size </span>
+            <span class="n">kwds</span> <span class="o">=</span> <span class="p">[]</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">SetWindowVariant</span><span class="p">(</span><span class="n">variant</span><span class="o">=</span><span class="n">FONT_VARIANT</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">SetTitle</span><span class="p">(</span><span class="s">&quot;Mask Editor for &quot;</span> <span class="o">+</span> <span class="n">data</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="n">base</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">data</span> <span class="o">=</span> <span class="n">data</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">str</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">__str__</span><span class="p">()</span>
+            <span class="c">## mask for 2D</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">mask</span> <span class="o">=</span> <span class="n">data</span><span class="o">.</span><span class="n">mask</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">default_mask</span> <span class="o">=</span> <span class="n">copy</span><span class="o">.</span><span class="n">deepcopy</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">mask</span><span class="p">)</span>
+            <span class="c">## masked data from GUI</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">slicer_mask</span> <span class="o">=</span> <span class="bp">None</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span> <span class="o">=</span> <span class="bp">None</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">slicer_z</span> <span class="o">=</span> <span class="mi">5</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">interactive</span> <span class="o">=</span> <span class="bp">True</span>
+            <span class="c">## when 2 data have the same id override the 1 st plotted</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">name</span>
+            <span class="c"># Panel for 2D plot</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span> <span class="o">=</span> <span class="n">Maskplotpanel</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span>
+                                           <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">TRANSPARENT_WINDOW</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">cmap</span> <span class="o">=</span> <span class="n">DEFAULT_CMAP</span>
+            <span class="c">## Create Artist and bind it</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">subplot</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">connect</span> <span class="o">=</span> <span class="n">BindArtist</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">figure</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">_setup_layout</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">newplot</span> <span class="o">=</span> <span class="n">Data2D</span><span class="p">(</span><span class="n">image</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">data</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">newplot</span><span class="o">.</span><span class="n">setValues</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">add_image</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">newplot</span><span class="p">)</span> 
+            <span class="bp">self</span><span class="o">.</span><span class="n">_update_mask</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">mask</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">Centre</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">Layout</span><span class="p">()</span>
+            <span class="c"># bind evt_close to _draw in fitpage</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_CLOSE</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">OnClose</span><span class="p">)</span>
+            
+<div class="viewcode-block" id="MaskPanel.ShowMessage"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.MaskPanel.ShowMessage">[docs]</a>    <span class="k">def</span> <span class="nf">ShowMessage</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">msg</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Show error message when mask covers whole data area</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">mssg</span> <span class="o">=</span> <span class="s">&#39;Erase, redraw or clear the mask. </span><span class="se">\n\r</span><span class="s">&#39;</span>
+        <span class="n">mssg</span> <span class="o">+=</span> <span class="s">&#39;The data range can not be completely masked... </span><span class="se">\n\r</span><span class="s">&#39;</span>
+        <span class="n">mssg</span> <span class="o">+=</span> <span class="n">msg</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">MessageBox</span><span class="p">(</span><span class="n">mssg</span><span class="p">,</span> <span class="s">&#39;Error&#39;</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">OK</span> <span class="o">|</span> <span class="n">wx</span><span class="o">.</span><span class="n">ICON_ERROR</span><span class="p">)</span>
+    </div>
+    <span class="k">def</span> <span class="nf">_setup_layout</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Set up the layout</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">note</span> <span class="o">=</span> <span class="s">&quot;Note: This masking applies</span><span class="se">\n</span><span class="s">     only to </span><span class="si">%s</span><span class="s">.&quot;</span> <span class="o">%</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">name</span>
+        <span class="n">note_txt</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">note</span><span class="p">)</span> 
+        <span class="n">note_txt</span><span class="o">.</span><span class="n">SetForegroundColour</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">RED</span><span class="p">)</span>
+        <span class="n">shape</span> <span class="o">=</span> <span class="s">&quot;Select a Shape for Masking:&quot;</span>
+        <span class="c">#  panel</span>
+        <span class="n">sizer</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">GridBagSizer</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span>
+        <span class="c">#---------inputs----------------</span>
+        <span class="n">shape_txt</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">shape</span><span class="p">)</span>  
+        <span class="n">sizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">shape_txt</span><span class="p">,</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">TOP</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">LEFT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">BOTTOM</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">innersector_rb</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">RadioButton</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s">&quot;Double Wings&quot;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_RADIOBUTTON</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onInnerSectorMask</span><span class="p">,</span>
+                  <span class="nb">id</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">innersector_rb</span><span class="o">.</span><span class="n">GetId</span><span class="p">())</span>
+        <span class="n">sizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">innersector_rb</span><span class="p">,</span> <span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> 
+                  <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">RIGHT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">BOTTOM</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">innercircle_rb</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">RadioButton</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s">&quot;Circular Disk&quot;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_RADIOBUTTON</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onInnerRingMask</span><span class="p">,</span>
+                  <span class="nb">id</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">innercircle_rb</span><span class="o">.</span><span class="n">GetId</span><span class="p">())</span>
+        <span class="n">sizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">innercircle_rb</span><span class="p">,</span> <span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span>
+                   <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">RIGHT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">BOTTOM</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
+        
+        <span class="bp">self</span><span class="o">.</span><span class="n">innerbox_rb</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">RadioButton</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s">&quot;Rectangular Disk&quot;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_RADIOBUTTON</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onInnerBoxMask</span><span class="p">,</span>
+                  <span class="nb">id</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">innerbox_rb</span><span class="o">.</span><span class="n">GetId</span><span class="p">())</span>
+        <span class="n">sizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">innerbox_rb</span><span class="p">,</span> <span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">RIGHT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">BOTTOM</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
+
+        <span class="bp">self</span><span class="o">.</span><span class="n">outersector_rb</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">RadioButton</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s">&quot;Double Wing Window&quot;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_RADIOBUTTON</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onOuterSectorMask</span><span class="p">,</span> 
+                  <span class="nb">id</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">outersector_rb</span><span class="o">.</span><span class="n">GetId</span><span class="p">())</span>
+        <span class="n">sizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">outersector_rb</span><span class="p">,</span> <span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span>
+                  <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">RIGHT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">BOTTOM</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
+        
+        <span class="c">#outersector_y_txt = wx.StaticText(self, -1, &#39;Outer Sector&#39;)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">outercircle_rb</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">RadioButton</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s">&quot;Circular Window&quot;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_RADIOBUTTON</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onOuterRingMask</span><span class="p">,</span>
+                  <span class="nb">id</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">outercircle_rb</span><span class="o">.</span><span class="n">GetId</span><span class="p">())</span>
+        <span class="n">sizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">outercircle_rb</span><span class="p">,</span> <span class="p">(</span><span class="mi">6</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> 
+                  <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">RIGHT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">BOTTOM</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
+        <span class="c">#outerbox_txt = wx.StaticText(self, -1, &#39;Outer Box&#39;)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">outerbox_rb</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">RadioButton</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s">&quot;Rectangular Window&quot;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_RADIOBUTTON</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onOuterBoxMask</span><span class="p">,</span> 
+                  <span class="nb">id</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">outerbox_rb</span><span class="o">.</span><span class="n">GetId</span><span class="p">())</span>
+        <span class="n">sizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">outerbox_rb</span><span class="p">,</span> <span class="p">(</span><span class="mi">7</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">RIGHT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">BOTTOM</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
+        <span class="n">sizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">note_txt</span><span class="p">,</span> <span class="p">(</span><span class="mi">8</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">RIGHT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">BOTTOM</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">innercircle_rb</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="bp">False</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">outercircle_rb</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="bp">False</span><span class="p">)</span>        
+        <span class="bp">self</span><span class="o">.</span><span class="n">innerbox_rb</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="bp">False</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">outerbox_rb</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="bp">False</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">innersector_rb</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="bp">False</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">outersector_rb</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="bp">False</span><span class="p">)</span>
+        <span class="n">sizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="p">,</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="mi">13</span><span class="p">,</span> <span class="mi">13</span><span class="p">),</span> 
+                  <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">LEFT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">RIGHT</span><span class="p">,</span> <span class="mi">15</span><span class="p">)</span>
+
+        <span class="c">#-----Buttons------------1</span>
+        <span class="n">id_button</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+        <span class="n">button_add</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Button</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">id_button</span><span class="p">,</span> <span class="s">&quot;Add&quot;</span><span class="p">)</span>
+        <span class="n">button_add</span><span class="o">.</span><span class="n">SetToolTipString</span><span class="p">(</span><span class="s">&quot;Add the mask drawn.&quot;</span><span class="p">)</span>
+        <span class="n">button_add</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_BUTTON</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onAddMask</span><span class="p">,</span> <span class="nb">id</span><span class="o">=</span><span class="n">button_add</span><span class="o">.</span><span class="n">GetId</span><span class="p">())</span> 
+        <span class="n">sizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">button_add</span><span class="p">,</span> <span class="p">(</span><span class="mi">13</span><span class="p">,</span> <span class="mi">7</span><span class="p">))</span>
+        <span class="n">id_button</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+        <span class="n">button_erase</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Button</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">id_button</span><span class="p">,</span> <span class="s">&quot;Erase&quot;</span><span class="p">)</span>
+        <span class="n">button_erase</span><span class="o">.</span><span class="n">SetToolTipString</span><span class="p">(</span><span class="s">&quot;Erase the mask drawn.&quot;</span><span class="p">)</span>
+        <span class="n">button_erase</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_BUTTON</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onEraseMask</span><span class="p">,</span>
+                          <span class="nb">id</span><span class="o">=</span><span class="n">button_erase</span><span class="o">.</span><span class="n">GetId</span><span class="p">())</span> 
+        <span class="n">sizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">button_erase</span><span class="p">,</span> <span class="p">(</span><span class="mi">13</span><span class="p">,</span> <span class="mi">8</span><span class="p">))</span>
+        <span class="n">id_button</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+        <span class="n">button_reset</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Button</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">id_button</span><span class="p">,</span> <span class="s">&quot;Reset&quot;</span><span class="p">)</span>
+        <span class="n">button_reset</span><span class="o">.</span><span class="n">SetToolTipString</span><span class="p">(</span><span class="s">&quot;Reset the mask.&quot;</span><span class="p">)</span>
+        <span class="n">button_reset</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_BUTTON</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onResetMask</span><span class="p">,</span>
+                          <span class="nb">id</span><span class="o">=</span><span class="n">button_reset</span><span class="o">.</span><span class="n">GetId</span><span class="p">())</span> 
+        <span class="n">sizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">button_reset</span><span class="p">,</span> <span class="p">(</span><span class="mi">13</span><span class="p">,</span> <span class="mi">9</span><span class="p">),</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">RIGHT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">BOTTOM</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">15</span><span class="p">)</span>
+        <span class="n">id_button</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+        <span class="n">button_reset</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Button</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">id_button</span><span class="p">,</span> <span class="s">&quot;Clear&quot;</span><span class="p">)</span>
+        <span class="n">button_reset</span><span class="o">.</span><span class="n">SetToolTipString</span><span class="p">(</span><span class="s">&quot;Clear all mask.&quot;</span><span class="p">)</span>
+        <span class="n">button_reset</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_BUTTON</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onClearMask</span><span class="p">,</span>
+                          <span class="nb">id</span><span class="o">=</span><span class="n">button_reset</span><span class="o">.</span><span class="n">GetId</span><span class="p">())</span> 
+        <span class="n">sizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">button_reset</span><span class="p">,</span> <span class="p">(</span><span class="mi">13</span><span class="p">,</span> <span class="mi">10</span><span class="p">),</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">RIGHT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">BOTTOM</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">15</span><span class="p">)</span>
+        <span class="n">sizer</span><span class="o">.</span><span class="n">AddGrowableCol</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span>
+        <span class="n">sizer</span><span class="o">.</span><span class="n">AddGrowableRow</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">SetSizerAndFit</span><span class="p">(</span><span class="n">sizer</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">Centre</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">Show</span><span class="p">(</span><span class="bp">True</span><span class="p">)</span>
+
+<div class="viewcode-block" id="MaskPanel.onInnerBoxMask"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.MaskPanel.onInnerBoxMask">[docs]</a>    <span class="k">def</span> <span class="nf">onInnerBoxMask</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Call Draw Box Slicer and get mask inside of the box</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c">#get ready for next evt</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">Skip</span><span class="p">()</span>        
+        <span class="c">#from boxMask import BoxMask</span>
+        <span class="k">if</span> <span class="n">event</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">onClearSlicer</span><span class="p">(</span><span class="n">event</span><span class="p">)</span>         
+        <span class="bp">self</span><span class="o">.</span><span class="n">slicer_z</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span> <span class="o">=</span>  <span class="n">BoxMask</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="p">,</span>
+                               <span class="n">zorder</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">slicer_z</span><span class="p">,</span> <span class="n">side</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">set_ylim</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">ymin</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">ymax</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">set_xlim</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmin</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmax</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">slicer_mask</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        </div>
+<div class="viewcode-block" id="MaskPanel.onOuterBoxMask"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.MaskPanel.onOuterBoxMask">[docs]</a>    <span class="k">def</span> <span class="nf">onOuterBoxMask</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Call Draw Box Slicer and get mask outside of the box</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">Skip</span><span class="p">()</span>        
+        <span class="c">#from boxMask import BoxMask</span>
+        <span class="k">if</span> <span class="n">event</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">onClearSlicer</span><span class="p">(</span><span class="n">event</span><span class="p">)</span>      
+        <span class="bp">self</span><span class="o">.</span><span class="n">slicer_z</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span> <span class="o">=</span>  <span class="n">BoxMask</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="p">,</span>
+                               <span class="n">zorder</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">slicer_z</span><span class="p">,</span> <span class="n">side</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">set_ylim</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">ymin</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">ymax</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">set_xlim</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmin</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmax</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">slicer_mask</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+</div>
+<div class="viewcode-block" id="MaskPanel.onInnerSectorMask"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.MaskPanel.onInnerSectorMask">[docs]</a>    <span class="k">def</span> <span class="nf">onInnerSectorMask</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Call Draw Sector Slicer and get mask inside of the sector</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">Skip</span><span class="p">()</span>
+        <span class="kn">from</span> <span class="nn">sectorMask</span> <span class="kn">import</span> <span class="n">SectorMask</span>
+        <span class="k">if</span> <span class="n">event</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">onClearSlicer</span><span class="p">(</span><span class="n">event</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">slicer_z</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span> <span class="o">=</span>  <span class="n">SectorMask</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="p">,</span>
+                                  <span class="n">zorder</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">slicer_z</span><span class="p">,</span> <span class="n">side</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">set_ylim</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">ymin</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">ymax</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">set_xlim</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmin</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmax</span><span class="p">)</span>   
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">slicer_mask</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span><span class="o">.</span><span class="n">update</span><span class="p">()</span> 
+</div>
+<div class="viewcode-block" id="MaskPanel.onOuterSectorMask"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.MaskPanel.onOuterSectorMask">[docs]</a>    <span class="k">def</span> <span class="nf">onOuterSectorMask</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Call Draw Sector Slicer and get mask outside of the sector</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">Skip</span><span class="p">()</span>
+        <span class="kn">from</span> <span class="nn">sectorMask</span> <span class="kn">import</span> <span class="n">SectorMask</span>
+        <span class="k">if</span> <span class="n">event</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">onClearSlicer</span><span class="p">(</span><span class="n">event</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">slicer_z</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span> <span class="o">=</span>  <span class="n">SectorMask</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="p">,</span>
+                                  <span class="n">zorder</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">slicer_z</span><span class="p">,</span> <span class="n">side</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">set_ylim</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">ymin</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">ymax</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">set_xlim</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmin</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmax</span><span class="p">)</span>    
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>     
+        <span class="bp">self</span><span class="o">.</span><span class="n">slicer_mask</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>   
+</div>
+<div class="viewcode-block" id="MaskPanel.onInnerRingMask"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.MaskPanel.onInnerRingMask">[docs]</a>    <span class="k">def</span> <span class="nf">onInnerRingMask</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Perform inner circular cut on Phi and draw circular slicer</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">Skip</span><span class="p">()</span>
+        <span class="kn">from</span> <span class="nn">AnnulusSlicer</span> <span class="kn">import</span> <span class="n">CircularMask</span>
+        <span class="k">if</span> <span class="n">event</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">onClearSlicer</span><span class="p">(</span><span class="n">event</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">slicer_z</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span> <span class="o">=</span> <span class="n">CircularMask</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="p">,</span>
+                                   <span class="n">zorder</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">slicer_z</span><span class="p">,</span> <span class="n">side</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">set_ylim</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">ymin</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">ymax</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">set_xlim</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmin</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmax</span><span class="p">)</span>   
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">slicer_mask</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span><span class="o">.</span><span class="n">update</span><span class="p">()</span> 
+</div>
+<div class="viewcode-block" id="MaskPanel.onOuterRingMask"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.MaskPanel.onOuterRingMask">[docs]</a>    <span class="k">def</span> <span class="nf">onOuterRingMask</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Perform outer circular cut on Phi and draw circular slicer</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">Skip</span><span class="p">()</span>
+        <span class="kn">from</span> <span class="nn">AnnulusSlicer</span> <span class="kn">import</span> <span class="n">CircularMask</span>
+        <span class="k">if</span> <span class="n">event</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">onClearSlicer</span><span class="p">(</span><span class="n">event</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">slicer_z</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span> <span class="o">=</span> <span class="n">CircularMask</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="p">,</span>
+                                   <span class="n">zorder</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">slicer_z</span><span class="p">,</span> <span class="n">side</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>   
+        <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">set_ylim</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">ymin</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">ymax</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">set_xlim</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmin</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmax</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">slicer_mask</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>     
+        </div>
+<div class="viewcode-block" id="MaskPanel.onAddMask"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.MaskPanel.onAddMask">[docs]</a>    <span class="k">def</span> <span class="nf">onAddMask</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Add new mask to old mask </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="n">data</span> <span class="o">=</span> <span class="n">Data2D</span><span class="p">()</span>
+            <span class="n">data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">slicer_mask</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+            <span class="n">data</span><span class="o">.</span><span class="n">mask</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">mask</span> <span class="o">&amp;</span> <span class="bp">self</span><span class="o">.</span><span class="n">slicer_mask</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">_check_display_mask</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">mask</span><span class="p">,</span> <span class="n">event</span><span class="p">)</span>
+            </div>
+    <span class="k">def</span> <span class="nf">_check_display_mask</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">mask</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        check if the mask valid and update the plot</span>
+<span class="sd">        </span>
+<span class="sd">        :param mask: mask data</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c">## Redraw the current image</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_update_mask</span><span class="p">(</span><span class="n">mask</span><span class="p">)</span>
+
+<div class="viewcode-block" id="MaskPanel.onEraseMask"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.MaskPanel.onEraseMask">[docs]</a>    <span class="k">def</span> <span class="nf">onEraseMask</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Erase new mask from old mask</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">slicer_mask</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+            <span class="n">mask</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">mask</span>
+            <span class="n">mask</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">slicer_mask</span> <span class="o">==</span> <span class="bp">False</span><span class="p">]</span> <span class="o">=</span> <span class="bp">True</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">_check_display_mask</span><span class="p">(</span><span class="n">mask</span><span class="p">,</span> <span class="n">event</span><span class="p">)</span>
+            </div>
+<div class="viewcode-block" id="MaskPanel.onResetMask"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.MaskPanel.onResetMask">[docs]</a>    <span class="k">def</span> <span class="nf">onResetMask</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Reset mask to the original mask </span>
+<span class="sd">        &quot;&quot;&quot;</span>        
+        <span class="bp">self</span><span class="o">.</span><span class="n">slicer_z</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span> <span class="o">=</span>  <span class="n">BoxMask</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="p">,</span> 
+                               <span class="n">zorder</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">slicer_z</span><span class="p">,</span> <span class="n">side</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">set_ylim</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">ymin</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">ymax</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">set_xlim</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmin</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmax</span><span class="p">)</span>   
+        <span class="n">mask</span> <span class="o">=</span> <span class="n">copy</span><span class="o">.</span><span class="n">deepcopy</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">default_mask</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">mask</span> <span class="o">=</span> <span class="n">mask</span>
+        <span class="c"># update mask plot</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_check_display_mask</span><span class="p">(</span><span class="n">mask</span><span class="p">,</span> <span class="n">event</span><span class="p">)</span>
+        </div>
+<div class="viewcode-block" id="MaskPanel.onClearMask"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.MaskPanel.onClearMask">[docs]</a>    <span class="k">def</span> <span class="nf">onClearMask</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Clear mask</span>
+<span class="sd">        &quot;&quot;&quot;</span>            
+        <span class="bp">self</span><span class="o">.</span><span class="n">slicer_z</span> <span class="o">+=</span> <span class="mi">1</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span> <span class="o">=</span>  <span class="n">BoxMask</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="p">,</span>
+                               <span class="n">zorder</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">slicer_z</span><span class="p">,</span> <span class="n">side</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">set_ylim</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">ymin</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">ymax</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">set_xlim</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmin</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmax</span><span class="p">)</span>   
+        <span class="c">#mask = copy.deepcopy(self.default_mask)</span>
+        <span class="n">mask</span> <span class="o">=</span> <span class="n">numpy</span><span class="o">.</span><span class="n">ones</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">mask</span><span class="p">),</span> <span class="n">dtype</span><span class="o">=</span><span class="nb">bool</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">mask</span> <span class="o">=</span> <span class="n">mask</span>
+        <span class="c"># update mask plot</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_check_display_mask</span><span class="p">(</span><span class="n">mask</span><span class="p">,</span> <span class="n">event</span><span class="p">)</span>
+        </div>
+<div class="viewcode-block" id="MaskPanel.onClearSlicer"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.MaskPanel.onClearSlicer">[docs]</a>    <span class="k">def</span> <span class="nf">onClearSlicer</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Clear the slicer on the plot</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">figure</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">draw</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span> <span class="o">=</span> <span class="bp">None</span>
+</div>
+<div class="viewcode-block" id="MaskPanel.update"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.MaskPanel.update">[docs]</a>    <span class="k">def</span> <span class="nf">update</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">draw</span><span class="o">=</span><span class="bp">True</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Respond to changes in the model by recalculating the </span>
+<span class="sd">        profiles and resetting the widgets.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">draw</span><span class="p">()</span>
+        </div>
+    <span class="k">def</span> <span class="nf">_set_mask</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">mask</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Set mask</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">mask</span> <span class="o">=</span> <span class="n">mask</span>
+        
+<div class="viewcode-block" id="MaskPanel.set_plot_unfocus"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.MaskPanel.set_plot_unfocus">[docs]</a>    <span class="k">def</span> <span class="nf">set_plot_unfocus</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Not implemented</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">pass</span>
+    </div>
+    <span class="k">def</span> <span class="nf">_update_mask</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">mask</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Respond to changes in masking</span>
+<span class="sd">        &quot;&quot;&quot;</span> 
+        <span class="c"># the case of liitle numbers of True points</span>
+        <span class="k">if</span> <span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">mask</span><span class="p">[</span><span class="n">mask</span><span class="p">])</span> <span class="o">&lt;</span> <span class="mi">10</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">):</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">ShowMessage</span><span class="p">()</span>
+            <span class="n">mask</span> <span class="o">=</span> <span class="n">copy</span><span class="o">.</span><span class="n">deepcopy</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">mask</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">mask</span> <span class="o">=</span> <span class="n">mask</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">mask</span> <span class="o">=</span> <span class="n">mask</span>
+        <span class="c"># make temperary data to plot</span>
+        <span class="n">temp_mask</span> <span class="o">=</span> <span class="n">numpy</span><span class="o">.</span><span class="n">zeros</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">mask</span><span class="p">))</span>
+        <span class="n">temp_data</span> <span class="o">=</span> <span class="n">copy</span><span class="o">.</span><span class="n">deepcopy</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="p">)</span>
+        <span class="c"># temp_data default is None</span>
+        <span class="c"># This method is to distinguish between masked point and data point = 0.</span>
+        <span class="n">temp_mask</span> <span class="o">=</span> <span class="n">temp_mask</span><span class="o">/</span><span class="n">temp_mask</span>
+        <span class="n">temp_mask</span><span class="p">[</span><span class="n">mask</span><span class="p">]</span> <span class="o">=</span> <span class="n">temp_data</span><span class="o">.</span><span class="n">data</span><span class="p">[</span><span class="n">mask</span><span class="p">]</span>
+        <span class="c"># set temp_data value for self.mask==True, else still None </span>
+        <span class="c">#temp_mask[mask] = temp_data[mask]</span>
+        
+        <span class="c">#TODO: refactor this horrible logic </span>
+        <span class="n">temp_data</span><span class="o">.</span><span class="n">data</span><span class="p">[</span><span class="n">mask</span> <span class="o">==</span> <span class="bp">False</span><span class="p">]</span> <span class="o">=</span> <span class="n">temp_mask</span><span class="p">[</span><span class="n">mask</span> <span class="o">==</span> <span class="bp">False</span><span class="p">]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">slicer</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="c"># Post slicer None event</span>
+        <span class="n">event</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_getEmptySlicerEvent</span><span class="p">()</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">)</span>
+       
+        <span class="c">##use this method</span>
+        <span class="c">#set zmax and zmin to plot: Fix it w/ data.</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">scale</span> <span class="o">==</span> <span class="s">&#39;log_{10}&#39;</span><span class="p">:</span>
+            <span class="n">zmax</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="nb">max</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">data</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">data</span><span class="o">&gt;</span><span class="mi">0</span><span class="p">]))</span>
+            <span class="n">zmin</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">log10</span><span class="p">(</span><span class="nb">min</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">data</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">data</span><span class="o">&gt;</span><span class="mi">0</span><span class="p">]))</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="n">zmax</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">data</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">data</span><span class="o">&gt;</span><span class="mi">0</span><span class="p">])</span>
+            <span class="n">zmin</span> <span class="o">=</span> <span class="nb">min</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">data</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">data</span><span class="o">&gt;</span><span class="mi">0</span><span class="p">])</span>
+        <span class="c">#plot    </span>
+        <span class="n">plot</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">image</span><span class="p">(</span><span class="n">data</span><span class="o">=</span><span class="n">temp_mask</span><span class="p">,</span>
+                       <span class="n">qx_data</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">qx_data</span><span class="p">,</span>
+                       <span class="n">qy_data</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">qy_data</span><span class="p">,</span>
+                       <span class="n">xmin</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmin</span><span class="p">,</span>
+                       <span class="n">xmax</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmax</span><span class="p">,</span>
+                       <span class="n">ymin</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">ymin</span><span class="p">,</span>
+                       <span class="n">ymax</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">ymax</span><span class="p">,</span>
+                       <span class="n">zmin</span><span class="o">=</span><span class="n">zmin</span><span class="p">,</span>
+                       <span class="n">zmax</span><span class="o">=</span><span class="n">zmax</span><span class="p">,</span>
+                       <span class="n">cmap</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">cmap</span><span class="p">,</span>
+                       <span class="n">color</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">symbol</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
+        <span class="c"># axis labels</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">axes</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">set_xlabel</span><span class="p">(</span><span class="s">&#39;$</span><span class="se">\\</span><span class="s">rm{Q}_{x}(A^{-1})$&#39;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">axes</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">set_ylabel</span><span class="p">(</span><span class="s">&#39;$</span><span class="se">\\</span><span class="s">rm{Q}_{y}(A^{-1})$&#39;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">render</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">figure</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">draw_idle</span><span class="p">()</span>
+        
+    <span class="k">def</span> <span class="nf">_getEmptySlicerEvent</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        create an empty slicervent </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">innerbox_rb</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="bp">False</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">outerbox_rb</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="bp">False</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">innersector_rb</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="bp">False</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">outersector_rb</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="bp">False</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">innercircle_rb</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="bp">False</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">outercircle_rb</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="bp">False</span><span class="p">)</span>
+        <span class="k">return</span> <span class="n">SlicerEvent</span><span class="p">(</span><span class="nb">type</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
+                           <span class="n">params</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
+                           <span class="n">obj_class</span><span class="o">=</span><span class="bp">None</span><span class="p">)</span> 
+             
+    <span class="k">def</span> <span class="nf">_draw_model</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">         on_close, update the model2d plot</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">pass</span>
+        
+<div class="viewcode-block" id="MaskPanel.freeze_axes"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.MaskPanel.freeze_axes">[docs]</a>    <span class="k">def</span> <span class="nf">freeze_axes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        freeze axes</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">axes_frozen</span> <span class="o">=</span> <span class="bp">True</span>
+        </div>
+<div class="viewcode-block" id="MaskPanel.thaw_axes"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.MaskPanel.thaw_axes">[docs]</a>    <span class="k">def</span> <span class="nf">thaw_axes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        thaw axes</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">axes_frozen</span> <span class="o">=</span> <span class="bp">False</span>       
+         </div>
+<div class="viewcode-block" id="MaskPanel.onMouseMotion"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.MaskPanel.onMouseMotion">[docs]</a>    <span class="k">def</span> <span class="nf">onMouseMotion</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        onMotion event</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">pass</span>
+    </div>
+<div class="viewcode-block" id="MaskPanel.onWheel"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.MaskPanel.onWheel">[docs]</a>    <span class="k">def</span> <span class="nf">onWheel</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        on wheel event</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">pass</span>  
+    </div>
+<div class="viewcode-block" id="MaskPanel.OnClose"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.MaskPanel.OnClose">[docs]</a>    <span class="k">def</span> <span class="nf">OnClose</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">            Processing close event</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">try</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">_draw_masked_model</span><span class="p">(</span><span class="n">event</span><span class="p">)</span>
+        <span class="k">except</span><span class="p">:</span>
+            <span class="c"># when called by data panel</span>
+            <span class="n">event</span><span class="o">.</span><span class="n">Skip</span><span class="p">()</span>
+            <span class="k">pass</span>   
+</div></div>
+<div class="viewcode-block" id="FloatPanel"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.FloatPanel">[docs]</a><span class="k">class</span> <span class="nc">FloatPanel</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">Dialog</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Provides the Mask Editor GUI.</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="c">## Internal nickname for the window, used by the AUI manager</span>
+    <span class="n">window_name</span> <span class="o">=</span> <span class="s">&quot;Plot&quot;</span>
+    <span class="c">## Name to appear on the window title bar</span>
+    <span class="n">window_caption</span> <span class="o">=</span> <span class="s">&quot;Plot&quot;</span>
+    <span class="c">## Flag to tell the AUI manager to put this panel in the center pane</span>
+    <span class="n">CENTER_PANE</span> <span class="o">=</span> <span class="bp">False</span>
+    <span class="n">ID</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">base</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> 
+                 <span class="n">data</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">dimension</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="nb">id</span><span class="o">=</span><span class="n">ID</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwds</span><span class="p">):</span>
+        <span class="n">kwds</span><span class="p">[</span><span class="s">&quot;style&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">DEFAULT_DIALOG_STYLE</span>
+        <span class="n">kwds</span><span class="p">[</span><span class="s">&quot;size&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Size</span><span class="p">(</span><span class="n">PANEL_SIZE</span><span class="o">*</span><span class="mf">1.5</span><span class="p">,</span> <span class="n">PANEL_SIZE</span><span class="o">*</span><span class="mf">1.5</span><span class="p">)</span> 
+        <span class="n">wx</span><span class="o">.</span><span class="n">Dialog</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="nb">id</span><span class="o">=</span><span class="nb">id</span><span class="p">,</span>  <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwds</span><span class="p">)</span>
+        
+        <span class="k">if</span> <span class="n">data</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="c">#Font size </span>
+            <span class="n">kwds</span> <span class="o">=</span> <span class="p">[]</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">SetWindowVariant</span><span class="p">(</span><span class="n">variant</span><span class="o">=</span><span class="n">FONT_VARIANT</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">SetTitle</span><span class="p">(</span><span class="s">&quot;Plot &quot;</span> <span class="o">+</span> <span class="n">data</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="n">base</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">data</span> <span class="o">=</span> <span class="n">data</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">str</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">__str__</span><span class="p">()</span>
+            <span class="c">## when 2 data have the same id override the 1 st plotted</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">name</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">dimension</span> <span class="o">=</span> <span class="n">dimension</span>
+            <span class="c"># Panel for 2D plot</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span> <span class="o">=</span> <span class="n">Maskplotpanel</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">dimension</span><span class="p">,</span>
+                                           <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">TRANSPARENT_WINDOW</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">_SetInitialSize</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">prevXtrans</span> <span class="o">=</span> <span class="s">&quot;x&quot;</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">prevYtrans</span> <span class="o">=</span> <span class="s">&quot;y&quot;</span>
+            
+            <span class="bp">self</span><span class="o">.</span><span class="n">cmap</span> <span class="o">=</span> <span class="n">DEFAULT_CMAP</span>
+            <span class="c">## Create Artist and bind it</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">subplot</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">_setup_layout</span><span class="p">()</span>
+            <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">dimension</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">newplot</span> <span class="o">=</span> <span class="n">Data1D</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="n">data</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="n">data</span><span class="o">.</span><span class="n">y</span><span class="p">,</span> 
+                                      <span class="n">dx</span><span class="o">=</span><span class="n">data</span><span class="o">.</span><span class="n">dx</span><span class="p">,</span> <span class="n">dy</span><span class="o">=</span><span class="n">data</span><span class="o">.</span><span class="n">dy</span><span class="p">)</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">newplot</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="n">data</span><span class="o">.</span><span class="n">name</span>
+            <span class="k">else</span><span class="p">:</span>    
+                <span class="bp">self</span><span class="o">.</span><span class="n">newplot</span> <span class="o">=</span> <span class="n">Data2D</span><span class="p">(</span><span class="n">image</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">data</span><span class="p">)</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">newplot</span><span class="o">.</span><span class="n">setValues</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="p">)</span>
+                    <span class="c"># Compute and get the image plot</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">get_plot</span><span class="p">()</span>
+            <span class="c">#self.plotpanel.add_image(self.newplot) </span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">Centre</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">Layout</span><span class="p">()</span>
+    
+<div class="viewcode-block" id="FloatPanel.get_plot"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.FloatPanel.get_plot">[docs]</a>    <span class="k">def</span> <span class="nf">get_plot</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Get Plot panel</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">cal_plot</span> <span class="o">=</span> <span class="n">CalcPlot</span><span class="p">(</span><span class="n">panel</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="p">,</span> 
+                                   <span class="n">image</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">newplot</span><span class="p">,</span> 
+                                   <span class="n">completefn</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">complete</span><span class="p">)</span>
+        <span class="n">cal_plot</span><span class="o">.</span><span class="n">queue</span><span class="p">()</span>
+    </div>
+<div class="viewcode-block" id="FloatPanel.complete"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.FloatPanel.complete">[docs]</a>    <span class="k">def</span> <span class="nf">complete</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">panel</span><span class="p">,</span> <span class="n">image</span><span class="p">,</span> <span class="n">elapsed</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Plot image</span>
+<span class="sd">        </span>
+<span class="sd">        :param image: newplot [plotpanel]</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">CallAfter</span><span class="p">(</span><span class="n">panel</span><span class="o">.</span><span class="n">add_image</span><span class="p">,</span> <span class="n">image</span><span class="p">)</span> 
+        </div>
+    <span class="k">def</span> <span class="nf">_setup_layout</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Set up the layout</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c">#  panel</span>
+        <span class="n">sizer</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">GridBagSizer</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">dimension</span> <span class="o">==</span> <span class="mi">3</span><span class="p">:</span>
+            <span class="n">note</span> <span class="o">=</span> <span class="s">&quot;Note: I am very SLOW.     Please be PATIENT...</span><span class="se">\n</span><span class="s">&quot;</span>
+            <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">data</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">3600</span><span class="p">:</span>
+                <span class="n">note</span> <span class="o">+=</span> <span class="s">&quot;Rotation disabled for pixels &gt; 60x60.&quot;</span>
+            <span class="n">note_txt</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">note</span><span class="p">)</span> 
+            <span class="n">note_txt</span><span class="o">.</span><span class="n">SetForegroundColour</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">RED</span><span class="p">)</span>
+            <span class="n">sizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">note_txt</span><span class="p">,</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">RIGHT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">TOP</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
+        
+        <span class="n">sizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="p">,</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">9</span><span class="p">,</span> <span class="mi">9</span><span class="p">),</span> 
+                  <span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ALL</span><span class="p">,</span> <span class="mi">15</span><span class="p">)</span>
+
+        <span class="n">sizer</span><span class="o">.</span><span class="n">AddGrowableCol</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span>
+        <span class="n">sizer</span><span class="o">.</span><span class="n">AddGrowableRow</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
+        
+        <span class="bp">self</span><span class="o">.</span><span class="n">SetSizerAndFit</span><span class="p">(</span><span class="n">sizer</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">Centre</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">Show</span><span class="p">(</span><span class="bp">True</span><span class="p">)</span>
+        
+<div class="viewcode-block" id="FloatPanel.set_plot_unfocus"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.FloatPanel.set_plot_unfocus">[docs]</a>    <span class="k">def</span> <span class="nf">set_plot_unfocus</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Not implemented</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">pass</span>
+    
+</div>
+    <span class="k">def</span> <span class="nf">_draw_model</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">         on_close, update the model2d plot</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">pass</span>
+        
+<div class="viewcode-block" id="FloatPanel.freeze_axes"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.FloatPanel.freeze_axes">[docs]</a>    <span class="k">def</span> <span class="nf">freeze_axes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        freeze axes</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">axes_frozen</span> <span class="o">=</span> <span class="bp">True</span>
+        </div>
+<div class="viewcode-block" id="FloatPanel.thaw_axes"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.FloatPanel.thaw_axes">[docs]</a>    <span class="k">def</span> <span class="nf">thaw_axes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        thaw axes</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">axes_frozen</span> <span class="o">=</span> <span class="bp">False</span>       
+    </div>
+<div class="viewcode-block" id="FloatPanel.OnClose"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.FloatPanel.OnClose">[docs]</a>    <span class="k">def</span> <span class="nf">OnClose</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">try</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">figure</span><span class="o">.</span><span class="n">clf</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">Close</span><span class="p">()</span>
+        <span class="k">except</span><span class="p">:</span>
+            <span class="c"># when called by data panel</span>
+            <span class="n">event</span><span class="o">.</span><span class="n">Skip</span><span class="p">()</span>
+            <span class="k">pass</span>
+
+                </div></div>
+<div class="viewcode-block" id="Maskplotpanel"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.Maskplotpanel">[docs]</a><span class="k">class</span> <span class="nc">Maskplotpanel</span><span class="p">(</span><span class="n">PlotPanel</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    PlotPanel for Quick plot and masking plot</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="nb">id</span><span class="o">=-</span><span class="mi">1</span><span class="p">,</span> <span class="n">dimension</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> 
+                                            <span class="n">dpi</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">PlotPanel</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="nb">id</span><span class="o">=</span><span class="nb">id</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="n">color</span><span class="p">,</span> <span class="n">dpi</span><span class="o">=</span><span class="n">dpi</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
+        
+        <span class="c"># Keep track of the parent Frame</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="n">parent</span>
+        <span class="c"># Internal list of plottable names (because graph </span>
+        <span class="c"># doesn&#39;t have a dictionary of handles for the plottables)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">dimension</span> <span class="o">=</span> <span class="n">dimension</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plots</span> <span class="o">=</span> <span class="p">{}</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">graph</span> <span class="o">=</span> <span class="n">Graph</span><span class="p">()</span>
+        <span class="c">#add axis labels</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">xaxis</span><span class="p">(</span><span class="s">&#39;</span><span class="se">\\</span><span class="s">rm{x} &#39;</span><span class="p">,</span> <span class="s">&#39;&#39;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">yaxis</span><span class="p">(</span><span class="s">&#39;</span><span class="se">\\</span><span class="s">rm{y} &#39;</span><span class="p">,</span> <span class="s">&#39;&#39;</span><span class="p">)</span>
+        
+<div class="viewcode-block" id="Maskplotpanel.add_toolbar"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.Maskplotpanel.add_toolbar">[docs]</a>    <span class="k">def</span> <span class="nf">add_toolbar</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot; </span>
+<span class="sd">        Add toolbar</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># Not implemented</span>
+        <span class="k">pass</span>
+    </div>
+<div class="viewcode-block" id="Maskplotpanel.on_set_focus"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.Maskplotpanel.on_set_focus">[docs]</a>    <span class="k">def</span> <span class="nf">on_set_focus</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        send to the parenet the current panel on focus</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">dimension</span> <span class="o">==</span> <span class="mi">3</span><span class="p">:</span>
+            <span class="k">pass</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">draw</span><span class="p">()</span>   
+         </div>
+<div class="viewcode-block" id="Maskplotpanel.add_image"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.Maskplotpanel.add_image">[docs]</a>    <span class="k">def</span> <span class="nf">add_image</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">plot</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Add Image</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">[</span><span class="n">plot</span><span class="o">.</span><span class="n">name</span><span class="p">]</span> <span class="o">=</span> <span class="n">plot</span>
+        <span class="c">#init graph</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">graph</span> <span class="o">=</span> <span class="n">Graph</span><span class="p">()</span>
+        <span class="c">#add plot</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">plot</span><span class="p">)</span>
+        <span class="c">#add axes</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">dimension</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_label</span> <span class="o">=</span> <span class="s">&#39;</span><span class="se">\\</span><span class="s">rm{x} &#39;</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_unit</span> <span class="o">=</span> <span class="s">&#39;&#39;</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_label</span> <span class="o">=</span> <span class="s">&#39;</span><span class="se">\\</span><span class="s">rm{y} &#39;</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_unit</span> <span class="o">=</span> <span class="s">&#39;&#39;</span>
+        <span class="c">#draw</span>
+        <span class="c"># message</span>
+        <span class="n">status_type</span> <span class="o">=</span> <span class="s">&#39;progress&#39;</span> 
+        <span class="n">msg</span> <span class="o">=</span> <span class="s">&#39;Plotting...&#39;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_status_info</span><span class="p">(</span><span class="n">msg</span><span class="p">,</span> <span class="n">status_type</span><span class="p">)</span>
+        <span class="n">status_type</span> <span class="o">=</span> <span class="s">&#39;stop&#39;</span>           
+        <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">render</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">figure</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">resizing</span> <span class="o">=</span> <span class="bp">False</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">dimension</span> <span class="o">&lt;</span> <span class="mi">3</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">render</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">figure</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">draw</span><span class="p">()</span>
+        <span class="k">elif</span> <span class="n">FONT_VARIANT</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">figure</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">draw</span><span class="p">()</span>
+        <span class="n">msg</span> <span class="o">=</span> <span class="s">&#39;Plotting Completed.&#39;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_status_info</span><span class="p">(</span><span class="n">msg</span><span class="p">,</span> <span class="n">status_type</span><span class="p">)</span>
+        </div>
+<div class="viewcode-block" id="Maskplotpanel.onMouseMotion"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.Maskplotpanel.onMouseMotion">[docs]</a>    <span class="k">def</span> <span class="nf">onMouseMotion</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Disable dragging 2D image</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">pass</span>
+    </div>
+<div class="viewcode-block" id="Maskplotpanel.onWheel"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.Maskplotpanel.onWheel">[docs]</a>    <span class="k">def</span> <span class="nf">onWheel</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">pass</span> 
+     </div>
+<div class="viewcode-block" id="Maskplotpanel.onLeftDown"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.Maskplotpanel.onLeftDown">[docs]</a>    <span class="k">def</span> <span class="nf">onLeftDown</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Disables LeftDown</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">pass</span>
+    </div>
+<div class="viewcode-block" id="Maskplotpanel.onPick"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.Maskplotpanel.onPick">[docs]</a>    <span class="k">def</span> <span class="nf">onPick</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Disables OnPick</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">pass</span>
+    </div>
+<div class="viewcode-block" id="Maskplotpanel.draw"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.Maskplotpanel.draw">[docs]</a>    <span class="k">def</span> <span class="nf">draw</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Draw</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># message</span>
+        <span class="n">status_type</span> <span class="o">=</span> <span class="s">&#39;progress&#39;</span> 
+        <span class="n">msg</span> <span class="o">=</span> <span class="s">&#39;Plotting...&#39;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_status_info</span><span class="p">(</span><span class="n">msg</span><span class="p">,</span> <span class="n">status_type</span><span class="p">)</span>
+        <span class="n">status_type</span> <span class="o">=</span> <span class="s">&#39;stop&#39;</span>           
+        
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">dimension</span> <span class="o">==</span> <span class="mi">3</span><span class="p">:</span>
+            <span class="k">pass</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">figure</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">draw_idle</span><span class="p">()</span> 
+        
+        <span class="n">msg</span> <span class="o">=</span> <span class="s">&#39;Plotting Completed.&#39;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_status_info</span><span class="p">(</span><span class="n">msg</span><span class="p">,</span> <span class="n">status_type</span><span class="p">)</span>
+       </div>
+<div class="viewcode-block" id="Maskplotpanel.onContextMenu"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.Maskplotpanel.onContextMenu">[docs]</a>    <span class="k">def</span> <span class="nf">onContextMenu</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Default context menu for a plot panel</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># Selective Slicer plot popup menu</span>
+        <span class="n">slicerpop</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Menu</span><span class="p">()</span>
+        
+        <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+        <span class="n">slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Print Image&#39;</span><span class="p">,</span> <span class="s">&#39;Print image&#39;</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onPrint</span><span class="p">)</span>
+
+        <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+        <span class="n">slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Copy to Clipboard&#39;</span><span class="p">,</span> <span class="s">&#39;Copy to the clipboard&#39;</span><span class="p">)</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">OnCopyFigureMenu</span><span class="p">)</span>
+        
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">dimension</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
+            <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+            <span class="n">slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="nb">id</span><span class="p">,</span> <span class="s">&#39;&amp;Change Scale&#39;</span><span class="p">)</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_onProperties</span><span class="p">)</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="n">slicerpop</span><span class="o">.</span><span class="n">AppendSeparator</span><span class="p">()</span>
+            <span class="n">id_cm</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+            <span class="n">slicerpop</span><span class="o">.</span><span class="n">Append</span><span class="p">(</span><span class="n">id_cm</span><span class="p">,</span> <span class="s">&#39;&amp;Toggle Linear/Log scale&#39;</span><span class="p">)</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">EVT_MENU</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">id_cm</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_onToggleScale</span><span class="p">)</span>
+               
+        <span class="n">pos</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">GetPosition</span><span class="p">()</span>
+        <span class="n">pos</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">ScreenToClient</span><span class="p">(</span><span class="n">pos</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">PopupMenu</span><span class="p">(</span><span class="n">slicerpop</span><span class="p">,</span> <span class="n">pos</span><span class="p">)</span>
+        </div>
+    <span class="k">def</span> <span class="nf">_status_info</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">msg</span> <span class="o">=</span> <span class="s">&#39;&#39;</span><span class="p">,</span> <span class="nb">type</span> <span class="o">=</span> <span class="s">&quot;update&quot;</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Status msg</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">if</span> <span class="nb">type</span> <span class="o">==</span> <span class="s">&quot;stop&quot;</span><span class="p">:</span>
+            <span class="n">label</span> <span class="o">=</span> <span class="s">&quot;Plotting...&quot;</span>
+            <span class="n">able</span> <span class="o">=</span> <span class="bp">True</span>
+        <span class="k">else</span><span class="p">:</span>   
+            <span class="n">label</span> <span class="o">=</span> <span class="s">&quot;Wait...&quot;</span>
+            <span class="n">able</span> <span class="o">=</span> <span class="bp">False</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">parent</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+                <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> 
+                             <span class="n">StatusEvent</span><span class="p">(</span><span class="n">status</span> <span class="o">=</span> <span class="n">msg</span><span class="p">,</span> <span class="nb">type</span> <span class="o">=</span> <span class="nb">type</span> <span class="p">))</span>
+</div>
+<div class="viewcode-block" id="ViewerFrame"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.ViewerFrame">[docs]</a><span class="k">class</span> <span class="nc">ViewerFrame</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">Frame</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Add comment</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">title</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        comment</span>
+<span class="sd">        :param parent: parent panel/container</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># Initialize the Frame object</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">Frame</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">title</span><span class="p">,</span>
+                          <span class="n">wx</span><span class="o">.</span><span class="n">DefaultPosition</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">Size</span><span class="p">(</span><span class="mi">950</span><span class="p">,</span> <span class="mi">850</span><span class="p">))</span>
+        <span class="c"># Panel for 1D plot</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span> <span class="o">=</span> <span class="n">Maskplotpanel</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">RAISED_BORDER</span><span class="p">)</span>
+</div>
+<div class="viewcode-block" id="ViewApp"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.ViewApp">[docs]</a><span class="k">class</span> <span class="nc">ViewApp</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">App</span><span class="p">):</span>
+<div class="viewcode-block" id="ViewApp.OnInit"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.masking.ViewApp.OnInit">[docs]</a>    <span class="k">def</span> <span class="nf">OnInit</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="n">frame</span> <span class="o">=</span> <span class="n">ViewerFrame</span><span class="p">(</span><span class="bp">None</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s">&#39;testView&#39;</span><span class="p">)</span>    
+        <span class="n">frame</span><span class="o">.</span><span class="n">Show</span><span class="p">(</span><span class="bp">True</span><span class="p">)</span>
+        <span class="c">#self.SetTopWindow(frame)</span>
+        
+        <span class="k">return</span> <span class="bp">True</span>
+               </div></div>
+<span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&quot;__main__&quot;</span><span class="p">:</span> 
+    <span class="n">app</span> <span class="o">=</span> <span class="n">ViewApp</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
+    <span class="n">app</span><span class="o">.</span><span class="n">MainLoop</span><span class="p">()</span>     
+</pre></div>
+
+          </div>
+        </div>
+      </div>
+      <div class="sphinxsidebar">
+        <div class="sphinxsidebarwrapper">
+<div id="searchbox" style="display: none">
+  <h3>Quick search</h3>
+    <form class="search" action="../../../../../search.html" method="get">
+      <input type="text" name="q" />
+      <input type="submit" value="Go" />
+      <input type="hidden" name="check_keywords" value="yes" />
+      <input type="hidden" name="area" value="default" />
+    </form>
+    <p class="searchtip" style="font-size: 90%">
+    Enter search terms or a module, class or function name.
+    </p>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+        </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" >sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>
+    <div class="footer">
+        &copy; Copyright 2013, The SasView Project.
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
+    </div>
+  </body>
+</html>
Index: _modules/sas/guiframe/local_perspectives/plotting/plotting.html
===================================================================
--- _modules/sas/guiframe/local_perspectives/plotting/plotting.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
+++ _modules/sas/guiframe/local_perspectives/plotting/plotting.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
@@ -0,0 +1,443 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>sas.guiframe.local_perspectives.plotting.plotting &mdash; SasView 3.0.0 documentation</title>
+    
+    <link rel="stylesheet" href="../../../../../_static/default.css" type="text/css" />
+    <link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '../../../../../',
+        VERSION:     '3.0.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="../../../../../_static/jquery.js"></script>
+    <script type="text/javascript" src="../../../../../_static/underscore.js"></script>
+    <script type="text/javascript" src="../../../../../_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <link rel="top" title="SasView 3.0.0 documentation" href="../../../../../index.html" />
+    <link rel="up" title="sas.guiframe" href="../../../guiframe.html" /> 
+  </head>
+  <body>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" accesskey="U">sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>  
+
+    <div class="document">
+      <div class="documentwrapper">
+        <div class="bodywrapper">
+          <div class="body">
+            
+  <h1>Source code for sas.guiframe.local_perspectives.plotting.plotting</h1><div class="highlight"><pre>
+<span class="c">################################################################################</span>
+<span class="c">#This software was developed by the University of Tennessee as part of the</span>
+<span class="c">#Distributed Data Analysis of Neutron Scattering Experiments (DANSE)</span>
+<span class="c">#project funded by the US National Science Foundation. </span>
+<span class="c">#</span>
+<span class="c">#See the license text in license.txt</span>
+<span class="c">#</span>
+<span class="c">#copyright 2008, University of Tennessee</span>
+<span class="c">################################################################################</span>
+
+<span class="kn">import</span> <span class="nn">wx</span>
+<span class="kn">import</span> <span class="nn">sys</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">EVT_NEW_PLOT</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">EVT_PLOT_QRANGE</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">StatusEvent</span> 
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">DeletePlotPanelEvent</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.plugin_base</span> <span class="kn">import</span> <span class="n">PluginBase</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.dataFitting</span> <span class="kn">import</span> <span class="n">Data1D</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.dataFitting</span> <span class="kn">import</span> <span class="n">Data2D</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.gui_manager</span> <span class="kn">import</span> <span class="n">MDIFrame</span>
+<span class="n">DEFAULT_MENU_ITEM_LABEL</span> <span class="o">=</span> <span class="s">&quot;No graph available&quot;</span>
+<span class="n">DEFAULT_MENU_ITEM_ID</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+
+<span class="n">IS_WIN</span> <span class="o">=</span> <span class="bp">True</span>    
+<span class="k">if</span> <span class="n">sys</span><span class="o">.</span><span class="n">platform</span><span class="o">.</span><span class="n">count</span><span class="p">(</span><span class="s">&quot;win32&quot;</span><span class="p">)</span><span class="o">==</span><span class="mi">0</span><span class="p">:</span>
+    <span class="k">if</span> <span class="nb">int</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">__version__</span><span class="p">)</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">&#39;.&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">])</span> <span class="o">==</span> <span class="mi">2</span><span class="p">:</span>
+        <span class="k">if</span> <span class="nb">int</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">__version__</span><span class="p">)</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">&#39;.&#39;</span><span class="p">)[</span><span class="mi">1</span><span class="p">])</span> <span class="o">&lt;</span> <span class="mi">9</span><span class="p">:</span>
+            <span class="n">IS_WIN</span> <span class="o">=</span> <span class="bp">False</span>
+
+
+<span class="k">class</span> <span class="nc">Plugin</span><span class="p">(</span><span class="n">PluginBase</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Plug-in class to be instantiated by the GUI manager</span>
+<div class="viewcode-block" id="Plugin"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.plotting.Plugin">[docs]</a><span class="sd">    &quot;&quot;&quot;</span>
+    
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">standalone</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
+        <span class="n">PluginBase</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="s">&quot;Plotting&quot;</span><span class="p">,</span> <span class="n">standalone</span><span class="o">=</span><span class="n">standalone</span><span class="p">)</span>
+      
+        <span class="c">## Plot panels</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plot_panels</span> <span class="o">=</span> <span class="p">{}</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_panel_on_focus</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">menu_default_id</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="c"># Plot menu</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">menu</span> <span class="o">=</span> <span class="bp">None</span>
+
+     
+    <span class="k">def</span> <span class="nf">set_panel_on_focus</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">panel</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+<div class="viewcode-block" id="Plugin.set_panel_on_focus"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.plotting.Plugin.set_panel_on_focus">[docs]</a>        <span class="bp">self</span><span class="o">.</span><span class="n">_panel_on_focus</span> <span class="o">=</span> <span class="n">panel</span>
+        
+    <span class="k">def</span> <span class="nf">is_always_active</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        return True is this plugin is always active even if the user is </span></div>
+<div class="viewcode-block" id="Plugin.is_always_active"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.plotting.Plugin.is_always_active">[docs]</a><span class="sd">        switching between perspectives</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">return</span> <span class="bp">True</span>
+    
+    <span class="k">def</span> <span class="nf">populate_menu</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Create a &#39;Plot&#39; menu to list the panels</span></div>
+<div class="viewcode-block" id="Plugin.populate_menu"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.plotting.Plugin.populate_menu">[docs]</a><span class="sd">        available for displaying</span>
+<span class="sd">        </span>
+<span class="sd">        :param id: next available unique ID for wx events</span>
+<span class="sd">        :param parent: parent window</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">return</span> <span class="p">[]</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        self.menu = wx.Menu()</span>
+<span class="sd">        self.menu.Append(DEFAULT_MENU_ITEM_ID, DEFAULT_MENU_ITEM_LABEL, </span>
+<span class="sd">                             &quot;No graph available&quot;)</span>
+<span class="sd">        self.menu.FindItemByPosition(0).Enable(False)</span>
+<span class="sd">        return [(self.menu, &quot;Show&quot;)]</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+    
+    <span class="k">def</span> <span class="nf">get_panels</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Create and return a list of panel objects</span></div>
+<div class="viewcode-block" id="Plugin.get_panels"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.plotting.Plugin.get_panels">[docs]</a><span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c">## Save a reference to the parent</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="n">parent</span>
+        <span class="c"># Connect to plotting events</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">EVT_NEW_PLOT</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_on_plot_event</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">EVT_PLOT_QRANGE</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_on_plot_qrange</span><span class="p">)</span>
+        <span class="c"># We have no initial panels for this plug-in</span>
+        <span class="k">return</span> <span class="p">[]</span>
+    
+    <span class="k">def</span> <span class="nf">_on_plot_qrange</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="o">=</span> <span class="bp">None</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        On Qmin Qmax vertical line event</span></div>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">if</span> <span class="n">event</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="k">return</span>
+        <span class="k">if</span> <span class="n">event</span><span class="o">.</span><span class="n">id</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">plot_panels</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
+            <span class="n">panel</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">plot_panels</span><span class="p">[</span><span class="n">event</span><span class="o">.</span><span class="n">id</span><span class="p">]</span>
+        <span class="k">elif</span> <span class="n">event</span><span class="o">.</span><span class="n">group_id</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">plot_panels</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
+            <span class="n">panel</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">plot_panels</span><span class="p">[</span><span class="n">event</span><span class="o">.</span><span class="n">group_id</span><span class="p">]</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="k">return</span>
+        <span class="n">panel</span><span class="o">.</span><span class="n">on_plot_qrange</span><span class="p">(</span><span class="n">event</span><span class="p">)</span>
+            
+    <span class="k">def</span> <span class="nf">_on_show_panel</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;show plug-in panel&quot;&quot;&quot;</span>
+        <span class="k">pass</span>
+    
+    <span class="k">def</span> <span class="nf">remove_plot</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">group_id</span><span class="p">,</span> <span class="nb">id</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        remove plot of ID = id from a panel of group ID =group_id</span>
+<div class="viewcode-block" id="Plugin.remove_plot"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.plotting.Plugin.remove_plot">[docs]</a><span class="sd">        &quot;&quot;&quot;</span>
+        
+        <span class="k">if</span> <span class="n">group_id</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">plot_panels</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
+            <span class="n">panel</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">plot_panels</span><span class="p">[</span><span class="n">group_id</span><span class="p">]</span>
+            <span class="n">panel</span><span class="o">.</span><span class="n">remove_data_by_id</span><span class="p">(</span><span class="nb">id</span><span class="o">=</span><span class="nb">id</span><span class="p">)</span>
+            
+            <span class="k">return</span> <span class="bp">True</span>
+        <span class="k">return</span> <span class="bp">False</span>
+        
+    <span class="k">def</span> <span class="nf">clear_panel</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Clear and Hide all plot panels, and remove them from menu</span></div>
+<div class="viewcode-block" id="Plugin.clear_panel"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.plotting.Plugin.clear_panel">[docs]</a><span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">for</span> <span class="n">group_id</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">plot_panels</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
+            <span class="n">panel</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">plot_panels</span><span class="p">[</span><span class="n">group_id</span><span class="p">]</span>
+            <span class="n">panel</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">reset</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">hide_panel</span><span class="p">(</span><span class="n">group_id</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plot_panels</span> <span class="o">=</span> <span class="p">{}</span>
+    
+    <span class="k">def</span> <span class="nf">clear_panel_by_id</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">group_id</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        clear the graph</span></div>
+<div class="viewcode-block" id="Plugin.clear_panel_by_id"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.plotting.Plugin.clear_panel_by_id">[docs]</a><span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">if</span> <span class="n">group_id</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">plot_panels</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
+            <span class="n">panel</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">plot_panels</span><span class="p">[</span><span class="n">group_id</span><span class="p">]</span>
+            <span class="k">for</span> <span class="n">plottable</span> <span class="ow">in</span> <span class="n">panel</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">plottables</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
+                <span class="bp">self</span><span class="o">.</span><span class="n">remove_plot</span><span class="p">(</span><span class="n">group_id</span><span class="p">,</span> <span class="n">plottable</span><span class="o">.</span><span class="n">id</span><span class="p">)</span>
+            <span class="n">panel</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">reset</span><span class="p">()</span>
+            <span class="k">return</span> <span class="bp">True</span>
+        <span class="k">return</span> <span class="bp">False</span>
+            
+    <span class="k">def</span> <span class="nf">hide_panel</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">group_id</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        hide panel with group ID = group_id</span></div>
+<div class="viewcode-block" id="Plugin.hide_panel"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.plotting.Plugin.hide_panel">[docs]</a><span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># Not implemeted</span>
+        <span class="k">return</span> <span class="bp">False</span>
+    
+    <span class="k">def</span> <span class="nf">create_panel_helper</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">new_panel</span><span class="p">,</span> <span class="n">data</span><span class="p">,</span> <span class="n">group_id</span><span class="p">,</span> <span class="n">title</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="Plugin.create_panel_helper"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.plotting.Plugin.create_panel_helper">[docs]</a>        <span class="c">## Set group ID if available</span>
+        <span class="c">## Assign data properties to the new create panel</span>
+        <span class="n">new_panel</span><span class="o">.</span><span class="n">set_manager</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
+        <span class="n">new_panel</span><span class="o">.</span><span class="n">group_id</span> <span class="o">=</span> <span class="n">group_id</span>
+        <span class="k">if</span> <span class="n">group_id</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">data</span><span class="o">.</span><span class="n">list_group_id</span><span class="p">:</span>
+            <span class="n">data</span><span class="o">.</span><span class="n">list_group_id</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">group_id</span><span class="p">)</span>
+        <span class="k">if</span> <span class="n">title</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="n">title</span> <span class="o">=</span> <span class="n">data</span><span class="o">.</span><span class="n">title</span>
+        <span class="n">new_panel</span><span class="o">.</span><span class="n">window_caption</span> <span class="o">=</span> <span class="n">title</span>
+        <span class="n">new_panel</span><span class="o">.</span><span class="n">window_name</span> <span class="o">=</span> <span class="n">data</span><span class="o">.</span><span class="n">title</span>
+        <span class="n">event_id</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">popup_panel</span><span class="p">(</span><span class="n">new_panel</span><span class="p">)</span>
+
+        <span class="c"># Set UID to allow us to reference the panel later</span>
+        <span class="n">new_panel</span><span class="o">.</span><span class="n">uid</span> <span class="o">=</span> <span class="n">event_id</span>
+        <span class="c"># Ship the plottable to its panel</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">CallAfter</span><span class="p">(</span><span class="n">new_panel</span><span class="o">.</span><span class="n">plot_data</span><span class="p">,</span> <span class="n">data</span><span class="p">)</span> 
+        <span class="c">#new_panel.canvas.set_resizing(new_panel.resizing)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plot_panels</span><span class="p">[</span><span class="n">new_panel</span><span class="o">.</span><span class="n">group_id</span><span class="p">]</span> <span class="o">=</span> <span class="n">new_panel</span>
+        
+        <span class="c"># Set Graph menu and help string        </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">help_string</span> <span class="o">=</span> <span class="s">&#39; Graph: &#39;</span>
+        <span class="k">for</span> <span class="n">plot</span> <span class="ow">in</span>  <span class="n">new_panel</span><span class="o">.</span><span class="n">plots</span><span class="o">.</span><span class="n">itervalues</span><span class="p">():</span>
+            <span class="n">help_string</span> <span class="o">+=</span> <span class="p">(</span><span class="s">&#39; &#39;</span> <span class="o">+</span> <span class="n">plot</span><span class="o">.</span><span class="n">label</span> <span class="o">+</span> <span class="s">&#39;;&#39;</span><span class="p">)</span>
+        <span class="c">#self.menu.AppendCheckItem(event_id, new_panel.window_caption, </span>
+        <span class="c">#                          helpString)</span>
+        <span class="c">#self.menu.Check(event_id, IS_WIN)</span>
+        <span class="c">#wx.EVT_MENU(self.parent, event_id, self._on_check_menu)</span>
+
+        
+    <span class="k">def</span> <span class="nf">create_1d_panel</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">,</span> <span class="n">group_id</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="Plugin.create_1d_panel"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.plotting.Plugin.create_1d_panel">[docs]</a>        <span class="c"># Create a new plot panel if none was available        </span>
+        <span class="k">if</span> <span class="nb">issubclass</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">__class__</span><span class="p">,</span> <span class="n">Data1D</span><span class="p">):</span>
+            <span class="kn">from</span> <span class="nn">Plotter1D</span> <span class="kn">import</span> <span class="n">ModelPanel1D</span>
+            <span class="c">## get the data representation label of the data to plot</span>
+            <span class="c">## when even the user select &quot;change scale&quot;</span>
+            <span class="n">xtransform</span> <span class="o">=</span> <span class="n">data</span><span class="o">.</span><span class="n">xtransform</span>
+            <span class="n">ytransform</span> <span class="o">=</span> <span class="n">data</span><span class="o">.</span><span class="n">ytransform</span>
+            <span class="c">## create a plotpanel for 1D Data</span>
+            <span class="n">win</span> <span class="o">=</span> <span class="n">MDIFrame</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> <span class="bp">None</span><span class="p">,</span> <span class="s">&#39;None&#39;</span><span class="p">,</span> <span class="p">(</span><span class="mi">100</span><span class="p">,</span> <span class="mi">200</span><span class="p">))</span>
+            <span class="n">new_panel</span> <span class="o">=</span> <span class="n">ModelPanel1D</span><span class="p">(</span><span class="n">win</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">xtransform</span><span class="o">=</span><span class="n">xtransform</span><span class="p">,</span>
+                     <span class="n">ytransform</span><span class="o">=</span><span class="n">ytransform</span><span class="p">,</span> <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">RAISED_BORDER</span><span class="p">)</span>
+            <span class="n">win</span><span class="o">.</span><span class="n">set_panel</span><span class="p">(</span><span class="n">new_panel</span><span class="p">)</span>
+            <span class="n">win</span><span class="o">.</span><span class="n">Show</span><span class="p">(</span><span class="bp">False</span><span class="p">)</span>
+            <span class="n">new_panel</span><span class="o">.</span><span class="n">frame</span> <span class="o">=</span> <span class="n">win</span>
+            <span class="c">#win.Show(True)</span>
+            <span class="k">return</span>  <span class="n">new_panel</span>
+        
+        <span class="n">msg</span> <span class="o">=</span> <span class="s">&quot;1D Panel of group ID </span><span class="si">%s</span><span class="s"> could not be created&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">group_id</span><span class="p">)</span>
+        <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">,</span> <span class="n">msg</span>
+    
+    <span class="k">def</span> <span class="nf">create_2d_panel</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">,</span> <span class="n">group_id</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="Plugin.create_2d_panel"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.plotting.Plugin.create_2d_panel">[docs]</a>        <span class="k">if</span> <span class="nb">issubclass</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">__class__</span><span class="p">,</span> <span class="n">Data2D</span><span class="p">):</span>
+            <span class="c">##Create a new plotpanel for 2D data</span>
+            <span class="kn">from</span> <span class="nn">Plotter2D</span> <span class="kn">import</span> <span class="n">ModelPanel2D</span>
+            <span class="n">scale</span> <span class="o">=</span> <span class="n">data</span><span class="o">.</span><span class="n">scale</span>
+            <span class="n">win</span> <span class="o">=</span> <span class="n">MDIFrame</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> <span class="bp">None</span><span class="p">,</span> <span class="s">&#39;None&#39;</span><span class="p">,</span> <span class="p">(</span><span class="mi">200</span><span class="p">,</span> <span class="mi">150</span><span class="p">))</span>
+            <span class="n">win</span><span class="o">.</span><span class="n">Show</span><span class="p">(</span><span class="bp">False</span><span class="p">)</span>
+            <span class="n">new_panel</span> <span class="o">=</span> <span class="n">ModelPanel2D</span><span class="p">(</span><span class="n">win</span><span class="p">,</span> <span class="nb">id</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span>
+                                <span class="n">data2d</span><span class="o">=</span><span class="n">data</span><span class="p">,</span> <span class="n">scale</span> <span class="o">=</span> <span class="n">scale</span><span class="p">,</span> 
+                                <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">RAISED_BORDER</span><span class="p">)</span>
+            <span class="n">win</span><span class="o">.</span><span class="n">set_panel</span><span class="p">(</span><span class="n">new_panel</span><span class="p">)</span>
+            <span class="n">new_panel</span><span class="o">.</span><span class="n">frame</span> <span class="o">=</span> <span class="n">win</span>
+            <span class="c">#win.Show(True)</span>
+            <span class="k">return</span> <span class="n">new_panel</span>
+        <span class="n">msg</span> <span class="o">=</span> <span class="s">&quot;2D Panel of group ID </span><span class="si">%s</span><span class="s"> could not be created&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">group_id</span><span class="p">)</span>
+        <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">,</span> <span class="n">msg</span>
+    
+    <span class="k">def</span> <span class="nf">update_panel</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">,</span> <span class="n">panel</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        update the graph of a given panel</span></div>
+<div class="viewcode-block" id="Plugin.update_panel"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.plotting.Plugin.update_panel">[docs]</a><span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># Check whether we already have a graph with the same units</span>
+        <span class="c"># as the plottable we just received. </span>
+        <span class="n">_</span><span class="p">,</span> <span class="n">x_unit</span> <span class="o">=</span>  <span class="n">data</span><span class="o">.</span><span class="n">get_xaxis</span><span class="p">()</span>
+        <span class="n">_</span><span class="p">,</span> <span class="n">y_unit</span> <span class="o">=</span>  <span class="n">data</span><span class="o">.</span><span class="n">get_yaxis</span><span class="p">()</span>
+        <span class="n">flag_x</span> <span class="o">=</span> <span class="p">(</span><span class="n">panel</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">prop</span><span class="p">[</span><span class="s">&quot;xunit&quot;</span><span class="p">]</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">)</span> <span class="ow">and</span> \
+                    <span class="p">(</span><span class="n">panel</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">prop</span><span class="p">[</span><span class="s">&quot;xunit&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span> <span class="o">!=</span> <span class="s">&quot;&quot;</span><span class="p">)</span> <span class="ow">and</span>\
+                    <span class="p">(</span><span class="n">x_unit</span> <span class="o">!=</span> <span class="n">panel</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">prop</span><span class="p">[</span><span class="s">&quot;xunit&quot;</span><span class="p">])</span> <span class="ow">and</span> <span class="bp">False</span>
+        <span class="n">flag_y</span> <span class="o">=</span> <span class="p">(</span><span class="n">panel</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">prop</span><span class="p">[</span><span class="s">&quot;yunit&quot;</span><span class="p">]</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">)</span> <span class="ow">and</span> \
+                    <span class="p">(</span><span class="n">panel</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">prop</span><span class="p">[</span><span class="s">&quot;yunit&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span> <span class="o">!=</span> <span class="s">&quot;&quot;</span><span class="p">)</span> <span class="ow">and</span>\
+                    <span class="p">(</span><span class="n">y_unit</span> <span class="o">!=</span> <span class="n">panel</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">prop</span><span class="p">[</span><span class="s">&quot;yunit&quot;</span><span class="p">])</span> <span class="ow">and</span> <span class="bp">False</span>
+        <span class="k">if</span> <span class="p">(</span><span class="n">flag_x</span> <span class="ow">and</span> <span class="n">flag_y</span><span class="p">):</span>
+            <span class="n">msg</span> <span class="o">=</span> <span class="s">&quot;Cannot add </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
+            <span class="n">msg</span> <span class="o">+=</span> <span class="s">&quot; to panel </span><span class="si">%s</span><span class="se">\n</span><span class="s">&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">panel</span><span class="o">.</span><span class="n">window_caption</span><span class="p">)</span>
+            <span class="n">msg</span> <span class="o">+=</span> <span class="s">&quot;Please edit </span><span class="si">%s</span><span class="s">&#39;s units, labels&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
+            <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">,</span> <span class="n">msg</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="k">if</span> <span class="n">panel</span><span class="o">.</span><span class="n">group_id</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">data</span><span class="o">.</span><span class="n">list_group_id</span><span class="p">:</span>
+                <span class="n">data</span><span class="o">.</span><span class="n">list_group_id</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">panel</span><span class="o">.</span><span class="n">group_id</span><span class="p">)</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">CallAfter</span><span class="p">(</span><span class="n">panel</span><span class="o">.</span><span class="n">plot_data</span><span class="p">,</span> <span class="n">data</span><span class="p">)</span>
+
+    <span class="k">def</span> <span class="nf">delete_panel</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">group_id</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="Plugin.delete_panel"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.plotting.Plugin.delete_panel">[docs]</a>        <span class="k">if</span> <span class="n">group_id</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">plot_panels</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
+            <span class="n">panel</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">plot_panels</span><span class="p">[</span><span class="n">group_id</span><span class="p">]</span>
+            <span class="n">uid</span> <span class="o">=</span> <span class="n">panel</span><span class="o">.</span><span class="n">uid</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> 
+                         <span class="n">DeletePlotPanelEvent</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="n">panel</span><span class="o">.</span><span class="n">window_caption</span><span class="p">,</span>
+                                    <span class="n">caption</span><span class="o">=</span><span class="n">panel</span><span class="o">.</span><span class="n">window_caption</span><span class="p">))</span>
+            <span class="c">#remove menu item</span>
+            <span class="c">#self.delete_menu_item(panel.window_caption, panel.uid)</span>
+            <span class="k">del</span> <span class="bp">self</span><span class="o">.</span><span class="n">plot_panels</span><span class="p">[</span><span class="n">group_id</span><span class="p">]</span>
+            <span class="k">if</span> <span class="n">uid</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">plot_panels</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
+                <span class="k">del</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">plot_panels</span><span class="p">[</span><span class="n">uid</span><span class="p">]</span>
+                <span class="n">panel</span><span class="o">.</span><span class="n">frame</span><span class="o">.</span><span class="n">Destroy</span><span class="p">()</span>
+            <span class="k">return</span> <span class="bp">True</span>
+
+        <span class="k">return</span> <span class="bp">False</span>
+    
+    <span class="k">def</span> <span class="nf">_on_plot_event</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        A new plottable is being shipped to the plotting plug-in.</span></div>
+<span class="sd">        Check whether we have a panel to put in on, or create</span>
+<span class="sd">        a new one</span>
+<span class="sd">        </span>
+<span class="sd">        :param event: EVT_NEW_PLOT event</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">action_check</span> <span class="o">=</span> <span class="bp">False</span>
+        <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">event</span><span class="p">,</span> <span class="s">&#39;action&#39;</span><span class="p">):</span>
+            <span class="n">action_string</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">action</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>
+            <span class="k">if</span> <span class="n">action_string</span> <span class="o">==</span> <span class="s">&#39;check&#39;</span><span class="p">:</span>
+                <span class="n">action_check</span> <span class="o">=</span> <span class="bp">True</span>
+            <span class="k">else</span><span class="p">:</span>
+                <span class="n">group_id</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">group_id</span>
+                <span class="k">if</span> <span class="n">group_id</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">plot_panels</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
+                    <span class="c">#remove data from panel</span>
+                    <span class="k">if</span> <span class="n">action_string</span> <span class="o">==</span> <span class="s">&#39;remove&#39;</span><span class="p">:</span>
+                        <span class="nb">id</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">id</span>
+                        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">remove_plot</span><span class="p">(</span><span class="n">group_id</span><span class="p">,</span> <span class="nb">id</span><span class="p">)</span>
+                    <span class="k">if</span> <span class="n">action_string</span> <span class="o">==</span> <span class="s">&#39;hide&#39;</span><span class="p">:</span>
+                        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">hide_panel</span><span class="p">(</span><span class="n">group_id</span><span class="p">)</span>
+                    <span class="k">if</span> <span class="n">action_string</span> <span class="o">==</span> <span class="s">&#39;delete&#39;</span><span class="p">:</span>
+                        <span class="n">panel</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">plot_panels</span><span class="p">[</span><span class="n">group_id</span><span class="p">]</span>
+                        <span class="n">uid</span> <span class="o">=</span> <span class="n">panel</span><span class="o">.</span><span class="n">uid</span>
+                        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">delete_panel</span><span class="p">(</span><span class="n">uid</span><span class="p">)</span>
+                    <span class="k">if</span> <span class="n">action_string</span> <span class="o">==</span> <span class="s">&quot;clear&quot;</span><span class="p">:</span>
+                        <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">clear_panel_by_id</span><span class="p">(</span><span class="n">group_id</span><span class="p">)</span>
+                    
+        <span class="k">if</span> <span class="ow">not</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">event</span><span class="p">,</span> <span class="s">&#39;plot&#39;</span><span class="p">):</span>    
+            <span class="k">return</span>
+        <span class="n">title</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">event</span><span class="p">,</span> <span class="s">&#39;title&#39;</span><span class="p">):</span>
+            <span class="n">title</span> <span class="o">=</span> <span class="s">&#39;Graph&#39;</span><span class="c">#event.title      </span>
+        <span class="n">data</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">plot</span>
+        <span class="n">group_id</span> <span class="o">=</span> <span class="n">data</span><span class="o">.</span><span class="n">group_id</span>    
+        <span class="k">if</span> <span class="n">group_id</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">plot_panels</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
+            <span class="k">if</span> <span class="n">action_check</span><span class="p">:</span>
+                <span class="c"># Check if the plot already exist. if it does, do nothing.</span>
+                <span class="k">if</span> <span class="n">data</span><span class="o">.</span><span class="n">id</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">plot_panels</span><span class="p">[</span><span class="n">group_id</span><span class="p">]</span><span class="o">.</span><span class="n">plots</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
+                    <span class="k">return</span> 
+            <span class="c">#update a panel graph </span>
+            <span class="n">panel</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">plot_panels</span><span class="p">[</span><span class="n">group_id</span><span class="p">]</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">update_panel</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">panel</span><span class="p">)</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="c">#create a new panel</span>
+            <span class="k">if</span> <span class="nb">issubclass</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">__class__</span><span class="p">,</span> <span class="n">Data1D</span><span class="p">):</span>
+                <span class="n">new_panel</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">create_1d_panel</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">group_id</span><span class="p">)</span>
+            <span class="k">else</span><span class="p">:</span>
+                <span class="c"># Need to make the group_id consistent with 1D thus no if below</span>
+                <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">plot_panels</span><span class="o">.</span><span class="n">values</span><span class="p">())</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
+                    <span class="k">for</span> <span class="n">p_group_id</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">plot_panels</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
+                        <span class="n">p_plot</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">plot_panels</span><span class="p">[</span><span class="n">p_group_id</span><span class="p">]</span>
+                        <span class="k">if</span> <span class="n">data</span><span class="o">.</span><span class="n">id</span> <span class="ow">in</span> <span class="n">p_plot</span><span class="o">.</span><span class="n">plots</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
+                            <span class="n">p_plot</span><span class="o">.</span><span class="n">plots</span><span class="p">[</span><span class="n">data</span><span class="o">.</span><span class="n">id</span><span class="p">]</span> <span class="o">=</span> <span class="n">data</span>
+                            <span class="bp">self</span><span class="o">.</span><span class="n">plot_panels</span><span class="p">[</span><span class="n">group_id</span><span class="p">]</span> <span class="o">=</span> <span class="n">p_plot</span>
+                            <span class="k">if</span> <span class="n">group_id</span> <span class="o">!=</span> <span class="n">p_group_id</span><span class="p">:</span>
+                                <span class="k">del</span> <span class="bp">self</span><span class="o">.</span><span class="n">plot_panels</span><span class="p">[</span><span class="n">p_group_id</span><span class="p">]</span>
+                                <span class="k">if</span> <span class="n">p_group_id</span> <span class="ow">in</span> <span class="n">data</span><span class="o">.</span><span class="n">list_group_id</span><span class="p">:</span>
+                                    <span class="n">data</span><span class="o">.</span><span class="n">list_group_id</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">p_group_id</span><span class="p">)</span>
+                                <span class="k">if</span> <span class="n">group_id</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">data</span><span class="o">.</span><span class="n">list_group_id</span><span class="p">:</span>
+                                    <span class="n">data</span><span class="o">.</span><span class="n">list_group_id</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">group_id</span><span class="p">)</span>
+                            <span class="n">p_plot</span><span class="o">.</span><span class="n">group_id</span> <span class="o">=</span> <span class="n">group_id</span>
+                            <span class="k">return</span>
+                
+                <span class="n">new_panel</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">create_2d_panel</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">group_id</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">create_panel_helper</span><span class="p">(</span><span class="n">new_panel</span><span class="p">,</span> <span class="n">data</span><span class="p">,</span> <span class="n">group_id</span><span class="p">,</span> <span class="n">title</span><span class="p">)</span> 
+        <span class="k">return</span>
+       
+    <span class="k">def</span> <span class="nf">help</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">evt</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Show a general help dialog. </span>
+<div class="viewcode-block" id="Plugin.help"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.plotting.Plugin.help">[docs]</a><span class="sd">        &quot;&quot;&quot;</span>
+        <span class="kn">from</span> <span class="nn">help_panel</span> <span class="kn">import</span>  <span class="n">HelpWindow</span>
+        <span class="n">frame</span> <span class="o">=</span> <span class="n">HelpWindow</span><span class="p">(</span><span class="bp">None</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span> 
+        <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">frame</span><span class="p">,</span> <span class="s">&quot;IsIconized&quot;</span><span class="p">):</span>
+            <span class="k">if</span> <span class="ow">not</span> <span class="n">frame</span><span class="o">.</span><span class="n">IsIconized</span><span class="p">():</span>
+                <span class="k">try</span><span class="p">:</span>
+                    <span class="n">icon</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">GetIcon</span><span class="p">()</span>
+                    <span class="n">frame</span><span class="o">.</span><span class="n">SetIcon</span><span class="p">(</span><span class="n">icon</span><span class="p">)</span>
+                <span class="k">except</span><span class="p">:</span>
+                    <span class="k">pass</span>  
+        <span class="n">frame</span><span class="o">.</span><span class="n">Show</span><span class="p">(</span><span class="bp">True</span><span class="p">)</span>
+</pre></div></div></div>
+
+          </div>
+        </div>
+      </div>
+      <div class="sphinxsidebar">
+        <div class="sphinxsidebarwrapper">
+<div id="searchbox" style="display: none">
+  <h3>Quick search</h3>
+    <form class="search" action="../../../../../search.html" method="get">
+      <input type="text" name="q" />
+      <input type="submit" value="Go" />
+      <input type="hidden" name="check_keywords" value="yes" />
+      <input type="hidden" name="area" value="default" />
+    </form>
+    <p class="searchtip" style="font-size: 90%">
+    Enter search terms or a module, class or function name.
+    </p>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+        </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" >sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>
+    <div class="footer">
+        &copy; Copyright 2013, The SasView Project.
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
+    </div>
+  </body>
+</html>
Index: _modules/sas/guiframe/local_perspectives/plotting/profile_dialog.html
===================================================================
--- _modules/sas/guiframe/local_perspectives/plotting/profile_dialog.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
+++ _modules/sas/guiframe/local_perspectives/plotting/profile_dialog.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
@@ -0,0 +1,424 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>sas.guiframe.local_perspectives.plotting.profile_dialog &mdash; SasView 3.0.0 documentation</title>
+    
+    <link rel="stylesheet" href="../../../../../_static/default.css" type="text/css" />
+    <link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '../../../../../',
+        VERSION:     '3.0.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="../../../../../_static/jquery.js"></script>
+    <script type="text/javascript" src="../../../../../_static/underscore.js"></script>
+    <script type="text/javascript" src="../../../../../_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <link rel="top" title="SasView 3.0.0 documentation" href="../../../../../index.html" />
+    <link rel="up" title="sas.guiframe" href="../../../guiframe.html" /> 
+  </head>
+  <body>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" accesskey="U">sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>  
+
+    <div class="document">
+      <div class="documentwrapper">
+        <div class="bodywrapper">
+          <div class="body">
+            
+  <h1>Source code for sas.guiframe.local_perspectives.plotting.profile_dialog</h1><div class="highlight"><pre>
+<span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">SLD Profile Dialog for multifunctional models</span>
+<span class="sd">&quot;&quot;&quot;</span>
+<span class="kn">import</span> <span class="nn">wx</span>
+<span class="kn">import</span> <span class="nn">os</span>
+<span class="kn">import</span> <span class="nn">sys</span>
+<span class="kn">from</span> <span class="nn">copy</span> <span class="kn">import</span> <span class="n">deepcopy</span>
+<span class="kn">from</span> <span class="nn">sas.plottools.plottables</span> <span class="kn">import</span> <span class="n">Graph</span>
+<span class="kn">from</span> <span class="nn">Plotter1D</span> <span class="kn">import</span> <span class="n">ModelPanel1D</span> <span class="k">as</span> <span class="n">PlotPanel</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.dataFitting</span> <span class="kn">import</span> <span class="n">Data1D</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.gui_style</span> <span class="kn">import</span> <span class="n">GUIFRAME_ID</span>
+<span class="kn">import</span> <span class="nn">pylab</span>
+
+<span class="n">DEFAULT_CMAP</span> <span class="o">=</span> <span class="bp">None</span><span class="c">#pylab.cm.jet</span>
+<span class="n">_BOX_WIDTH</span> <span class="o">=</span> <span class="mi">76</span>
+<span class="n">_STATICBOX_WIDTH</span> <span class="o">=</span> <span class="mi">400</span>
+<span class="c"># X Y offset on plot</span>
+<span class="n">_X_OFF</span> <span class="o">=</span> <span class="mi">15</span>
+<span class="n">_Y_OFF</span> <span class="o">=</span> <span class="mf">0.5</span>
+
+<span class="c">#SLD panel size </span>
+<span class="k">if</span> <span class="n">sys</span><span class="o">.</span><span class="n">platform</span><span class="o">.</span><span class="n">count</span><span class="p">(</span><span class="s">&quot;win32&quot;</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
+    <span class="n">_STATICBOX_WIDTH</span> <span class="o">=</span> <span class="mi">563</span>
+    <span class="n">PANEL_SIZE</span> <span class="o">=</span> <span class="mi">425</span>
+    <span class="n">FONT_VARIANT</span> <span class="o">=</span> <span class="mi">0</span>
+<span class="k">else</span><span class="p">:</span>
+    <span class="n">_STATICBOX_WIDTH</span> <span class="o">=</span> <span class="mi">605</span>
+    <span class="n">PANEL_SIZE</span> <span class="o">=</span> <span class="mi">500</span>
+    <span class="n">FONT_VARIANT</span> <span class="o">=</span> <span class="mi">1</span>
+    
+     
+<div class="viewcode-block" id="SLDPanel"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.profile_dialog.SLDPanel">[docs]</a><span class="k">class</span> <span class="nc">SLDPanel</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">Dialog</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Provides the SLD profile plot panel.</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="c">## Internal nickname for the window, used by the AUI manager</span>
+    <span class="n">window_name</span> <span class="o">=</span> <span class="s">&quot;Scattering Length Density Profile&quot;</span>
+    <span class="c">## Name to appear on the window title bar</span>
+    <span class="n">window_caption</span> <span class="o">=</span> <span class="s">&quot;Scattering Length Density Profile&quot;</span>
+    <span class="c">## Flag to tell the AUI manager to put this panel in the center pane</span>
+    <span class="n">CENTER_PANE</span> <span class="o">=</span> <span class="bp">True</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">base</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">data</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">axes</span> <span class="o">=</span><span class="p">[</span><span class="s">&#39;Radius&#39;</span><span class="p">],</span> 
+                 <span class="nb">id</span><span class="o">=-</span><span class="mi">1</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwds</span><span class="p">):</span>
+        <span class="n">kwds</span><span class="p">[</span><span class="s">&quot;style&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">DEFAULT_DIALOG_STYLE</span>
+        <span class="n">kwds</span><span class="p">[</span><span class="s">&quot;size&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Size</span><span class="p">(</span><span class="n">_STATICBOX_WIDTH</span><span class="p">,</span> <span class="n">PANEL_SIZE</span><span class="p">)</span> 
+        <span class="n">wx</span><span class="o">.</span><span class="n">Dialog</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="nb">id</span><span class="o">=</span><span class="nb">id</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwds</span><span class="p">)</span>
+
+        <span class="k">if</span> <span class="n">data</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="c">#Font size </span>
+            <span class="n">kwds</span> <span class="o">=</span> <span class="p">[]</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">SetWindowVariant</span><span class="p">(</span><span class="n">variant</span><span class="o">=</span><span class="n">FONT_VARIANT</span><span class="p">)</span>
+
+            <span class="bp">self</span><span class="o">.</span><span class="n">SetTitle</span><span class="p">(</span><span class="s">&quot;Scattering Length Density Profile&quot;</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="n">parent</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">_mgr</span> <span class="o">=</span> <span class="bp">None</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">data</span> <span class="o">=</span> <span class="n">data</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">str</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">__str__</span><span class="p">()</span>
+            <span class="c">## when 2 data have the same id override the 1 st plotted</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">name</span>
+            <span class="c"># Panel for plot</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span> <span class="o">=</span> <span class="n">SLDplotpanel</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> 
+                                             <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">TRANSPARENT_WINDOW</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">cmap</span> <span class="o">=</span> <span class="n">DEFAULT_CMAP</span>
+            <span class="c">## Create Artist and bind it</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">subplot</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">subplot</span>
+            <span class="c"># layout</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">_setup_layout</span><span class="p">()</span>
+            
+            <span class="c"># plot</span>
+            <span class="n">data_plot</span> <span class="o">=</span> <span class="n">deepcopy</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="p">)</span>
+            <span class="n">data_plot</span><span class="o">.</span><span class="n">dy</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_set_dy_data</span><span class="p">()</span>
+            <span class="c"># unit increase to M times for users</span>
+            <span class="n">data_plot</span><span class="o">.</span><span class="n">y</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_set_y_data</span><span class="p">()</span>
+            
+            <span class="bp">self</span><span class="o">.</span><span class="n">newplot</span> <span class="o">=</span> <span class="n">Data1D</span><span class="p">(</span><span class="n">data_plot</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="n">data_plot</span><span class="o">.</span><span class="n">y</span><span class="p">,</span> <span class="n">data_plot</span><span class="o">.</span><span class="n">dy</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">newplot</span><span class="o">.</span><span class="n">symbol</span> <span class="o">=</span> <span class="n">GUIFRAME_ID</span><span class="o">.</span><span class="n">CURVE_SYMBOL_NUM</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">newplot</span><span class="o">.</span><span class="n">dy</span> <span class="o">=</span> <span class="bp">None</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">newplot</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="s">&#39;SLD&#39;</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">newplot</span><span class="o">.</span><span class="n">is_data</span> <span class="o">=</span> <span class="bp">False</span>
+            
+            <span class="bp">self</span><span class="o">.</span><span class="n">newplot</span><span class="o">.</span><span class="n">id</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">newplot</span><span class="o">.</span><span class="n">name</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">add_image</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">newplot</span><span class="p">)</span> 
+            
+            <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">resizing</span> <span class="o">=</span> <span class="bp">False</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">set_resizing</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">resizing</span><span class="p">)</span>
+            
+            <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">set_ylim</span><span class="p">(</span><span class="nb">min</span><span class="p">(</span><span class="n">data_plot</span><span class="o">.</span><span class="n">y</span><span class="p">)</span> <span class="o">-</span> <span class="n">_Y_OFF</span> <span class="p">,</span> 
+                                                <span class="nb">max</span><span class="p">(</span><span class="n">data_plot</span><span class="o">.</span><span class="n">y</span><span class="p">)</span> <span class="o">+</span> <span class="n">_Y_OFF</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">subplot</span><span class="o">.</span><span class="n">set_xlim</span><span class="p">(</span><span class="nb">min</span><span class="p">(</span><span class="n">data_plot</span><span class="o">.</span><span class="n">x</span><span class="p">)</span> <span class="o">-</span> <span class="n">_X_OFF</span><span class="p">,</span> 
+                                                <span class="nb">max</span><span class="p">(</span><span class="n">data_plot</span><span class="o">.</span><span class="n">x</span><span class="p">)</span> <span class="o">+</span> <span class="n">_X_OFF</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">render</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="o">.</span><span class="n">canvas</span><span class="o">.</span><span class="n">draw</span><span class="p">()</span>
+
+    <span class="k">def</span> <span class="nf">_set_dy_data</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> 
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        make fake dy data</span>
+<span class="sd">        </span>
+<span class="sd">        :return dy: </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># set dy as zero</span>
+        <span class="n">dy</span> <span class="o">=</span> <span class="p">[</span><span class="mi">0</span> <span class="k">for</span> <span class="n">y</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">y</span><span class="p">]</span>
+        <span class="k">return</span> <span class="n">dy</span>      
+
+    <span class="k">def</span> <span class="nf">_set_y_data</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> 
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        make y data unit Mega times</span>
+<span class="sd">        </span>
+<span class="sd">        :return y_value: </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># changes the unit</span>
+        <span class="n">y_value</span> <span class="o">=</span> <span class="p">[</span><span class="n">yvalue</span> <span class="o">*</span> <span class="mf">1e+006</span> <span class="k">for</span> <span class="n">yvalue</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">y</span><span class="p">]</span>
+        
+        <span class="k">return</span> <span class="n">y_value</span>     
+    
+    <span class="k">def</span> <span class="nf">_setup_layout</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Set up the layout</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># panel sizer</span>
+        <span class="n">sizer</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">BoxSizer</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">VERTICAL</span><span class="p">)</span>
+        <span class="n">sizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">LEFT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">RIGHT</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
+        <span class="n">sizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">StaticLine</span><span class="p">(</span><span class="bp">self</span><span class="p">),</span> <span class="mi">0</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">ALL</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">EXPAND</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
+        <span class="n">sizer</span><span class="o">.</span><span class="n">Add</span><span class="p">((</span><span class="mi">0</span><span class="p">,</span> <span class="mi">5</span><span class="p">))</span>
+        <span class="c">#-----Button------------1</span>
+        <span class="nb">id</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">NewId</span><span class="p">()</span>
+        <span class="n">button_reset</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">Button</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="s">&quot;Close&quot;</span><span class="p">)</span>
+        <span class="n">button_reset</span><span class="o">.</span><span class="n">SetToolTipString</span><span class="p">(</span><span class="s">&quot;Close...&quot;</span><span class="p">)</span>
+        <span class="n">button_reset</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_BUTTON</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_close</span><span class="p">,</span> 
+                          <span class="nb">id</span><span class="o">=</span><span class="n">button_reset</span><span class="o">.</span><span class="n">GetId</span><span class="p">())</span> 
+        <span class="n">sizer</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">button_reset</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">LEFT</span><span class="p">,</span> <span class="n">_STATICBOX_WIDTH</span> <span class="o">-</span> <span class="mi">80</span><span class="p">)</span> 
+        <span class="n">sizer</span><span class="o">.</span><span class="n">Add</span><span class="p">((</span><span class="mi">0</span><span class="p">,</span> <span class="mi">10</span><span class="p">))</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">SetSizerAndFit</span><span class="p">(</span><span class="n">sizer</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">Centre</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">Show</span><span class="p">(</span><span class="bp">True</span><span class="p">)</span>
+        <span class="n">button_reset</span><span class="o">.</span><span class="n">SetFocus</span><span class="p">()</span>
+        
+    <span class="k">def</span> <span class="nf">_close</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Close the dialog</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">Close</span><span class="p">(</span><span class="bp">True</span><span class="p">)</span>
+
+    <span class="k">def</span> <span class="nf">_draw_model</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">         on_close, update the model2d plot</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">pass</span>
+
+<div class="viewcode-block" id="SLDPanel.get_current_context_menu"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.profile_dialog.SLDPanel.get_current_context_menu">[docs]</a>    <span class="k">def</span> <span class="nf">get_current_context_menu</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">graph</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        When the context menu of a plot is rendered, the </span>
+<span class="sd">        get_context_menu method will be called to give you a </span>
+<span class="sd">        chance to add a menu item to the context menu.</span>
+<span class="sd">        :param graph: the Graph object to which we attach the context menu</span>
+<span class="sd">        </span>
+<span class="sd">        :return: a list of menu items with call-back function</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">return</span> <span class="p">[]</span>
+    </div>
+<div class="viewcode-block" id="SLDPanel.set_schedule_full_draw"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.profile_dialog.SLDPanel.set_schedule_full_draw">[docs]</a>    <span class="k">def</span> <span class="nf">set_schedule_full_draw</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">panel</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">func</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Set_schedule for full draw</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># Not implemented</span>
+        <span class="k">pass</span>
+    </div>
+<div class="viewcode-block" id="SLDPanel.set_schedule"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.profile_dialog.SLDPanel.set_schedule">[docs]</a>    <span class="k">def</span> <span class="nf">set_schedule</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">schedule</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Set schedule for redraw</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># Not implemented</span>
+        <span class="k">pass</span>
+        </div>
+<div class="viewcode-block" id="SLDPanel.set_plot_unfocus"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.profile_dialog.SLDPanel.set_plot_unfocus">[docs]</a>    <span class="k">def</span> <span class="nf">set_plot_unfocus</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Set_plot unfocus</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># NOt implemented</span>
+        <span class="k">pass</span>
+    </div>
+<div class="viewcode-block" id="SLDPanel.on_change_caption"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.profile_dialog.SLDPanel.on_change_caption">[docs]</a>    <span class="k">def</span> <span class="nf">on_change_caption</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">old_caption</span><span class="p">,</span> <span class="n">new_caption</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">on_change_caption</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">old_caption</span><span class="p">,</span> <span class="n">new_caption</span><span class="p">)</span>
+    </div>
+<div class="viewcode-block" id="SLDPanel.disable_app_menu"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.profile_dialog.SLDPanel.disable_app_menu">[docs]</a>    <span class="k">def</span> <span class="nf">disable_app_menu</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">panel</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Disable menu bar</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># Not implemented!</span>
+        <span class="k">return</span>
+    </div>
+<div class="viewcode-block" id="SLDPanel.show_data1d"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.profile_dialog.SLDPanel.show_data1d">[docs]</a>    <span class="k">def</span> <span class="nf">show_data1d</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">,</span> <span class="n">name</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Show data dialog</span>
+<span class="sd">        &quot;&quot;&quot;</span>   
+        <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">_manager</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">show_data1d</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">name</span><span class="p">)</span>
+        </div></div>
+<div class="viewcode-block" id="SLDplotpanel"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.profile_dialog.SLDplotpanel">[docs]</a><span class="k">class</span> <span class="nc">SLDplotpanel</span><span class="p">(</span><span class="n">PlotPanel</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Panel</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">axes</span><span class="o">=</span><span class="p">[],</span> <span class="nb">id</span><span class="o">=-</span><span class="mi">1</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">dpi</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
+                  <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">PlotPanel</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="nb">id</span><span class="o">=</span><span class="nb">id</span><span class="p">,</span> <span class="n">xtransform</span><span class="o">=</span><span class="s">&#39;x&#39;</span><span class="p">,</span> <span class="n">ytransform</span><span class="o">=</span><span class="s">&#39;y&#39;</span><span class="p">,</span> 
+                           <span class="n">color</span><span class="o">=</span><span class="n">color</span><span class="p">,</span> <span class="n">dpi</span><span class="o">=</span><span class="n">dpi</span><span class="p">,</span> 
+                           <span class="n">size</span><span class="o">=</span><span class="p">(</span><span class="n">_STATICBOX_WIDTH</span><span class="p">,</span> <span class="n">PANEL_SIZE</span><span class="o">-</span><span class="mi">100</span><span class="p">),</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
+
+        <span class="c"># Keep track of the parent Frame</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="n">parent</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">window_name</span> <span class="o">=</span> <span class="s">&quot;Scattering Length Density Profile&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">window_caption</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">window_name</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">prevXtrans</span> <span class="o">=</span> <span class="s">&quot;x&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">prevYtrans</span> <span class="o">=</span> <span class="s">&quot;y&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">viewModel</span> <span class="o">=</span> <span class="s">&quot;--&quot;</span>
+        <span class="c"># Internal list of plottable names (because graph </span>
+        <span class="c"># doesn&#39;t have a dictionary of handles for the plottables)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plots</span> <span class="o">=</span> <span class="p">{}</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">graph</span> <span class="o">=</span> <span class="n">Graph</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">axes_label</span> <span class="o">=</span> <span class="p">[]</span>
+        <span class="k">for</span> <span class="n">idx</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">axes</span><span class="p">)):</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">axes_label</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">axes</span><span class="p">[</span><span class="n">idx</span><span class="p">])</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_label</span> <span class="o">=</span> <span class="s">&#39;&#39;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_unit</span> <span class="o">=</span> <span class="s">&#39;&#39;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_label</span> <span class="o">=</span> <span class="s">&#39;&#39;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_unit</span> <span class="o">=</span> <span class="s">&#39;&#39;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">resizing</span> <span class="o">=</span> <span class="bp">True</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">xcolor</span> <span class="o">=</span> <span class="s">&#39;black&#39;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">ycolor</span> <span class="o">=</span> <span class="s">&#39;black&#39;</span>
+        
+<div class="viewcode-block" id="SLDplotpanel.add_image"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.profile_dialog.SLDplotpanel.add_image">[docs]</a>    <span class="k">def</span> <span class="nf">add_image</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">plot</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Add image(Theory1D)</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">[</span><span class="n">plot</span><span class="o">.</span><span class="n">id</span><span class="p">]</span> <span class="o">=</span> <span class="n">plot</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">[</span><span class="n">plot</span><span class="o">.</span><span class="n">id</span><span class="p">]</span><span class="o">.</span><span class="n">is_data</span> <span class="o">=</span> <span class="bp">True</span>
+        <span class="c">#add plot</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">plot</span><span class="p">)</span>
+        <span class="c">#add axes</span>
+        <span class="n">x1_label</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">axes_label</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_label</span> <span class="o">=</span> <span class="s">&#39;</span><span class="se">\\</span><span class="s">rm{</span><span class="si">%s</span><span class="s">} &#39;</span><span class="o">%</span> <span class="n">x1_label</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_unit</span> <span class="o">=</span> <span class="s">&#39;A&#39;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">xaxis</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">xaxis_label</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">xaxis_unit</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_label</span> <span class="o">=</span> <span class="s">&#39;</span><span class="se">\\</span><span class="s">rm{SLD} &#39;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_unit</span> <span class="o">=</span> <span class="s">&#39;10^{-6}A^{-2}&#39;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">yaxis</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">yaxis_label</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">yaxis_unit</span><span class="p">)</span>
+        <span class="c">#self.subplot.figure.canvas.draw_idle()</span>
+        <span class="c"># For latter scale changes </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">[</span><span class="n">plot</span><span class="o">.</span><span class="n">id</span><span class="p">]</span><span class="o">.</span><span class="n">xaxis</span><span class="p">(</span><span class="s">&#39;</span><span class="se">\\</span><span class="s">rm{</span><span class="si">%s</span><span class="s">} &#39;</span><span class="o">%</span> <span class="n">x1_label</span><span class="p">,</span> <span class="s">&#39;A&#39;</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">[</span><span class="n">plot</span><span class="o">.</span><span class="n">id</span><span class="p">]</span><span class="o">.</span><span class="n">yaxis</span><span class="p">(</span><span class="s">&#39;</span><span class="se">\\</span><span class="s">rm{SLD} &#39;</span><span class="p">,</span> <span class="s">&#39;10^{-6}A^{-2}&#39;</span><span class="p">)</span>
+        <span class="c">#draw</span>
+        <span class="c">#self.graph.render(self)</span>
+        </div>
+<div class="viewcode-block" id="SLDplotpanel.on_set_focus"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.profile_dialog.SLDplotpanel.on_set_focus">[docs]</a>    <span class="k">def</span> <span class="nf">on_set_focus</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        send to the parenet the current panel on focus</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c">#Not implemented</span>
+        <span class="k">pass</span>
+</div>
+<div class="viewcode-block" id="SLDplotpanel.on_kill_focus"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.profile_dialog.SLDplotpanel.on_kill_focus">[docs]</a>    <span class="k">def</span> <span class="nf">on_kill_focus</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        reset the panel color</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c">#Not implemented</span>
+        <span class="k">pass</span>
+    </div>
+    <span class="k">def</span> <span class="nf">_add_more_tool</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Not implemented</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">pass</span> 
+    
+<div class="viewcode-block" id="SLDplotpanel.onChangeCaption"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.profile_dialog.SLDplotpanel.onChangeCaption">[docs]</a>    <span class="k">def</span> <span class="nf">onChangeCaption</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Not implemented</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">pass</span>
+                           </div>
+    <span class="k">def</span> <span class="nf">_onSave</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">evt</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Save a data set to a text file</span>
+<span class="sd">        </span>
+<span class="sd">        :param evt: Menu event</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">menu</span> <span class="o">=</span> <span class="n">evt</span><span class="o">.</span><span class="n">GetEventObject</span><span class="p">()</span>
+        <span class="nb">id</span> <span class="o">=</span> <span class="n">evt</span><span class="o">.</span><span class="n">GetId</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">set_selected_from_menu</span><span class="p">(</span><span class="n">menu</span><span class="p">,</span> <span class="nb">id</span><span class="p">)</span>
+        <span class="n">data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">plots</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">graph</span><span class="o">.</span><span class="n">selected_plottable</span><span class="p">]</span>
+        <span class="n">default_name</span> <span class="o">=</span> <span class="n">data</span><span class="o">.</span><span class="n">label</span>
+        <span class="k">if</span> <span class="n">default_name</span><span class="o">.</span><span class="n">count</span><span class="p">(</span><span class="s">&#39;.&#39;</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
+            <span class="n">default_name</span> <span class="o">=</span> <span class="n">default_name</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">&#39;.&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+        <span class="n">default_name</span> <span class="o">+=</span> <span class="s">&quot;_out&quot;</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="c"># What an ancestor!</span>
+            <span class="n">fit_panel</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">parent</span>
+            <span class="n">fit_panel</span><span class="o">.</span><span class="n">_manager</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">save_data1d</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">default_name</span><span class="p">)</span>
+             </div>
+<div class="viewcode-block" id="ViewerFrame"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.profile_dialog.ViewerFrame">[docs]</a><span class="k">class</span> <span class="nc">ViewerFrame</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">Frame</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Add comment</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">title</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        comment</span>
+<span class="sd">        :param parent: parent panel/container</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># Initialize the Frame object</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">Frame</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">title</span><span class="p">,</span> <span class="n">wx</span><span class="o">.</span><span class="n">DefaultPosition</span><span class="p">,</span> 
+                          <span class="n">wx</span><span class="o">.</span><span class="n">Size</span><span class="p">(</span><span class="n">_STATICBOX_WIDTH</span><span class="p">,</span> <span class="n">PANEL_SIZE</span><span class="p">))</span>
+        <span class="c"># Panel for 1D plot</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">plotpanel</span>    <span class="o">=</span> <span class="n">SLDplotpanel</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">RAISED_BORDER</span><span class="p">)</span>
+</div>
+<div class="viewcode-block" id="ViewApp"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.profile_dialog.ViewApp">[docs]</a><span class="k">class</span> <span class="nc">ViewApp</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">App</span><span class="p">):</span>
+<div class="viewcode-block" id="ViewApp.OnInit"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.profile_dialog.ViewApp.OnInit">[docs]</a>    <span class="k">def</span> <span class="nf">OnInit</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+        <span class="n">frame</span> <span class="o">=</span> <span class="n">ViewerFrame</span><span class="p">(</span><span class="bp">None</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s">&#39;testView&#39;</span><span class="p">)</span>    
+        <span class="n">frame</span><span class="o">.</span><span class="n">Show</span><span class="p">(</span><span class="bp">True</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">SetTopWindow</span><span class="p">(</span><span class="n">frame</span><span class="p">)</span>
+        
+        <span class="k">return</span> <span class="bp">True</span>
+               </div></div>
+<span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">&quot;__main__&quot;</span><span class="p">:</span> 
+    <span class="n">app</span> <span class="o">=</span> <span class="n">ViewApp</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
+    <span class="n">app</span><span class="o">.</span><span class="n">MainLoop</span><span class="p">()</span>     
+</pre></div>
+
+          </div>
+        </div>
+      </div>
+      <div class="sphinxsidebar">
+        <div class="sphinxsidebarwrapper">
+<div id="searchbox" style="display: none">
+  <h3>Quick search</h3>
+    <form class="search" action="../../../../../search.html" method="get">
+      <input type="text" name="q" />
+      <input type="submit" value="Go" />
+      <input type="hidden" name="check_keywords" value="yes" />
+      <input type="hidden" name="area" value="default" />
+    </form>
+    <p class="searchtip" style="font-size: 90%">
+    Enter search terms or a module, class or function name.
+    </p>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+        </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" >sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>
+    <div class="footer">
+        &copy; Copyright 2013, The SasView Project.
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
+    </div>
+  </body>
+</html>
Index: _modules/sas/guiframe/local_perspectives/plotting/sectorMask.html
===================================================================
--- _modules/sas/guiframe/local_perspectives/plotting/sectorMask.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
+++ _modules/sas/guiframe/local_perspectives/plotting/sectorMask.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
@@ -0,0 +1,314 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>sas.guiframe.local_perspectives.plotting.sectorMask &mdash; SasView 3.0.0 documentation</title>
+    
+    <link rel="stylesheet" href="../../../../../_static/default.css" type="text/css" />
+    <link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '../../../../../',
+        VERSION:     '3.0.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="../../../../../_static/jquery.js"></script>
+    <script type="text/javascript" src="../../../../../_static/underscore.js"></script>
+    <script type="text/javascript" src="../../../../../_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <link rel="top" title="SasView 3.0.0 documentation" href="../../../../../index.html" />
+    <link rel="up" title="sas.guiframe" href="../../../guiframe.html" /> 
+  </head>
+  <body>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" accesskey="U">sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>  
+
+    <div class="document">
+      <div class="documentwrapper">
+        <div class="bodywrapper">
+          <div class="body">
+            
+  <h1>Source code for sas.guiframe.local_perspectives.plotting.sectorMask</h1><div class="highlight"><pre>
+<span class="kn">import</span> <span class="nn">math</span>
+<span class="kn">import</span> <span class="nn">wx</span>
+<span class="c">#from copy import deepcopy</span>
+<span class="kn">from</span> <span class="nn">BaseInteractor</span> <span class="kn">import</span> <span class="n">_BaseInteractor</span>
+<span class="kn">from</span> <span class="nn">SectorSlicer</span> <span class="kn">import</span> <span class="n">SideInteractor</span>
+<span class="kn">from</span> <span class="nn">SectorSlicer</span> <span class="kn">import</span> <span class="n">LineInteractor</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">SlicerParameterEvent</span>
+
+<span class="k">class</span> <span class="nc">SectorMask</span><span class="p">(</span><span class="n">_BaseInteractor</span><span class="p">):</span>
+<div class="viewcode-block" id="SectorMask"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.sectorMask.SectorMask">[docs]</a>    <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">    Draw a sector slicer.Allow to find the data 2D inside of the sector lines</span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s">&#39;gray&#39;</span><span class="p">,</span> <span class="n">zorder</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="n">side</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">_BaseInteractor</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">base</span><span class="p">,</span> <span class="n">axes</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="n">color</span><span class="p">)</span>
+        <span class="c">## Class initialization</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">markers</span> <span class="o">=</span> <span class="p">[]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">axes</span> <span class="o">=</span> <span class="n">axes</span>   
+        <span class="bp">self</span><span class="o">.</span><span class="n">is_inside</span> <span class="o">=</span> <span class="n">side</span>
+        <span class="c">## connect the plot to event </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">connect</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">connect</span>
+        
+        <span class="c">## compute qmax limit to reset the graph     </span>
+        <span class="n">x</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">pow</span><span class="p">(</span><span class="nb">max</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmax</span><span class="p">,</span> 
+                         <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">xmin</span><span class="p">)),</span> <span class="mi">2</span><span class="p">)</span>
+        <span class="n">y</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">pow</span><span class="p">(</span><span class="nb">max</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">ymax</span><span class="p">,</span> 
+                         <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">ymin</span><span class="p">)),</span> <span class="mi">2</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">qmax</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">sqrt</span><span class="p">(</span><span class="n">x</span> <span class="o">+</span> <span class="n">y</span><span class="p">)</span>
+        <span class="c">## Number of points on the plot</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">nbins</span> <span class="o">=</span> <span class="mi">20</span>
+        <span class="c">## Angle of the middle line</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">theta2</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="o">/</span><span class="mi">3</span>
+        <span class="c">## Absolute value of the Angle between the middle line and any side line</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">phi</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="o">/</span><span class="mi">12</span>
+        
+        <span class="c">## Middle line</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">main_line</span> <span class="o">=</span> <span class="n">LineInteractor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">subplot</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s">&#39;blue&#39;</span><span class="p">,</span>
+                                <span class="n">zorder</span><span class="o">=</span><span class="n">zorder</span><span class="p">,</span> <span class="n">r</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">qmax</span><span class="p">,</span> <span class="n">theta</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">theta2</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="o">.</span><span class="n">qmax</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">qmax</span>
+        <span class="c">## Right Side line</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">right_line</span> <span class="o">=</span> <span class="n">SideInteractor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">subplot</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s">&#39;gray&#39;</span><span class="p">,</span>
+                            <span class="n">zorder</span><span class="o">=</span><span class="n">zorder</span><span class="p">,</span> <span class="n">r</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">qmax</span><span class="p">,</span> <span class="n">phi</span><span class="o">=</span> <span class="o">-</span><span class="mi">1</span><span class="o">*</span><span class="bp">self</span><span class="o">.</span><span class="n">phi</span><span class="p">,</span>
+                                                            <span class="n">theta2</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">theta2</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">right_line</span><span class="o">.</span><span class="n">qmax</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">qmax</span>
+        <span class="c">## Left Side line </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">left_line</span> <span class="o">=</span> <span class="n">SideInteractor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">subplot</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s">&#39;gray&#39;</span><span class="p">,</span> 
+                                    <span class="n">zorder</span><span class="o">=</span><span class="n">zorder</span><span class="p">,</span> <span class="n">r</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">qmax</span><span class="p">,</span> <span class="n">phi</span><span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">phi</span><span class="p">,</span>
+                                                        <span class="n">theta2</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">theta2</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">qmax</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">qmax</span>
+        <span class="c">## draw the sector               </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_post_data</span><span class="p">()</span>
+        
+    <span class="k">def</span> <span class="nf">clear</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+<div class="viewcode-block" id="SectorMask.clear"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.sectorMask.SectorMask.clear">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Clear the slicer and all connected events related to this slicer</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">clear_markers</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">right_line</span><span class="o">.</span><span class="n">clear</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">connect</span><span class="o">.</span><span class="n">clearall</span><span class="p">()</span>
+        <span class="c">#self.base.Unbind(EVT_SLICER_PARS)</span>
+        
+    <span class="k">def</span> <span class="nf">update</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></div>
+<div class="viewcode-block" id="SectorMask.update"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.sectorMask.SectorMask.update">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Respond to changes in the model by recalculating the profiles and</span>
+<span class="sd">        resetting the widgets.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># Update locations  </span>
+        <span class="c">## Check if the middle line was dragged and </span>
+        <span class="c">#update the picture accordingly     </span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="o">.</span><span class="n">has_move</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">right_line</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">delta</span><span class="o">=-</span><span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">phi</span><span class="o">/</span><span class="mi">2</span><span class="p">,</span>
+                                    <span class="n">mline</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="o">.</span><span class="n">theta</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">delta</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">phi</span><span class="o">/</span><span class="mi">2</span><span class="p">,</span>
+                                   <span class="n">mline</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="o">.</span><span class="n">theta</span><span class="p">)</span>
+        <span class="c">## Check if the left side has moved and update the slicer accordingly  </span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">has_move</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">phi</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">delta</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">mline</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">main_line</span> <span class="p">,</span>
+                                  <span class="n">side</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="n">left</span><span class="o">=</span><span class="bp">True</span> <span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">right_line</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">phi</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">phi</span><span class="p">,</span> <span class="n">delta</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
+                                     <span class="n">mline</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="p">,</span> <span class="n">side</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span>
+                                     <span class="n">left</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">right</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
+        <span class="c">## Check if the right side line has moved and </span>
+        <span class="c">#update the slicer accordingly</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">right_line</span><span class="o">.</span><span class="n">has_move</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">right_line</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">phi</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">delta</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">mline</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="p">,</span>
+                                   <span class="n">side</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="n">left</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">right</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">phi</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">right_line</span><span class="o">.</span><span class="n">phi</span><span class="p">,</span> <span class="n">delta</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
+                                    <span class="n">mline</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="p">,</span> <span class="n">side</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="n">left</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>
+        <span class="c">#if self.is_inside != None:</span>
+        <span class="n">out</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_post_data</span><span class="p">()</span>
+        <span class="k">return</span> <span class="n">out</span>
+
+    <span class="k">def</span> <span class="nf">save</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span></div>
+<div class="viewcode-block" id="SectorMask.save"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.sectorMask.SectorMask.save">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Remember the roughness for this layer and the next so that we</span>
+<span class="sd">        can restore on Esc.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">freeze_axes</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="o">.</span><span class="n">save</span><span class="p">(</span><span class="n">ev</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">right_line</span><span class="o">.</span><span class="n">save</span><span class="p">(</span><span class="n">ev</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">save</span><span class="p">(</span><span class="n">ev</span><span class="p">)</span>
+
+    <span class="k">def</span> <span class="nf">_post_data</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></div>
+        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        compute sector averaging of data into data1D</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c">## get the data to average</span>
+        <span class="n">data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">data</span>
+        <span class="c"># If we have no data, just return</span>
+        <span class="k">if</span> <span class="n">data</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="k">return</span>
+
+        <span class="n">mask</span> <span class="o">=</span> <span class="n">data</span><span class="o">.</span><span class="n">mask</span>
+        <span class="c">## Averaging</span>
+        <span class="kn">from</span> <span class="nn">sas.dataloader.manipulations</span> <span class="kn">import</span> <span class="n">Sectorcut</span>
+        <span class="n">radius</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">qmax</span> 
+        <span class="n">phimin</span> <span class="o">=</span>  <span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">phi</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="o">.</span><span class="n">theta</span>
+        <span class="n">phimax</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">phi</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="o">.</span><span class="n">theta</span>
+         
+        <span class="n">mask</span> <span class="o">=</span> <span class="n">Sectorcut</span><span class="p">(</span><span class="n">phi_min</span><span class="o">=</span><span class="n">phimin</span><span class="p">,</span> <span class="n">phi_max</span><span class="o">=</span><span class="n">phimax</span><span class="p">)</span>
+        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_inside</span><span class="p">:</span>
+            <span class="n">out</span> <span class="o">=</span> <span class="p">(</span><span class="n">mask</span><span class="p">(</span><span class="n">data</span><span class="p">)</span> <span class="o">==</span> <span class="bp">False</span><span class="p">)</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="n">out</span> <span class="o">=</span> <span class="p">(</span><span class="n">mask</span><span class="p">(</span><span class="n">data</span><span class="p">))</span>
+        <span class="c">#self.base.data.mask=out</span>
+        <span class="k">return</span> <span class="n">out</span>       
+
+    <span class="k">def</span> <span class="nf">moveend</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span>
+<div class="viewcode-block" id="SectorMask.moveend"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.sectorMask.SectorMask.moveend">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Called a dragging motion ends.Get slicer event </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">thaw_axes</span><span class="p">()</span>
+        <span class="c">## Post parameters</span>
+        <span class="n">event</span> <span class="o">=</span> <span class="n">SlicerParameterEvent</span><span class="p">()</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">type</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">__class__</span><span class="o">.</span><span class="n">__name__</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">params</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_params</span><span class="p">()</span>
+        <span class="c">## Send slicer paramers to plotter2D</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="p">,</span> <span class="n">event</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_post_data</span><span class="p">()</span>
+            
+    <span class="k">def</span> <span class="nf">restore</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></div>
+<div class="viewcode-block" id="SectorMask.restore"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.sectorMask.SectorMask.restore">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Restore the roughness for this layer.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="o">.</span><span class="n">restore</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">restore</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">right_line</span><span class="o">.</span><span class="n">restore</span><span class="p">()</span>
+
+    <span class="k">def</span> <span class="nf">move</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">ev</span><span class="p">):</span></div>
+<div class="viewcode-block" id="SectorMask.move"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.sectorMask.SectorMask.move">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Process move to a new position, making sure that the move is allowed.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="k">pass</span>
+        
+    <span class="k">def</span> <span class="nf">set_cursor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">):</span></div>
+<div class="viewcode-block" id="SectorMask.set_cursor"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.sectorMask.SectorMask.set_cursor">[docs]</a>        <span class="k">pass</span>
+        
+    <span class="k">def</span> <span class="nf">get_params</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></div>
+<div class="viewcode-block" id="SectorMask.get_params"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.sectorMask.SectorMask.get_params">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Store a copy of values of parameters of the slicer into a dictionary.</span>
+<span class="sd">        </span>
+<span class="sd">        :return params: the dictionary created</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">params</span> <span class="o">=</span> <span class="p">{}</span>
+        <span class="c">## Always make sure that the left and the right line are at phi </span>
+        <span class="c">## angle of the middle line</span>
+        <span class="k">if</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">phi</span><span class="p">)</span> <span class="o">!=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">right_line</span><span class="o">.</span><span class="n">phi</span><span class="p">):</span>
+            <span class="n">msg</span> <span class="o">=</span> <span class="s">&quot;Phi left and phi right are &quot;</span>
+            <span class="n">msg</span> <span class="o">+=</span> <span class="s">&quot;different </span><span class="si">%f</span><span class="s">, </span><span class="si">%f</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">phi</span><span class="p">,</span> 
+                                         <span class="bp">self</span><span class="o">.</span><span class="n">right_line</span><span class="o">.</span><span class="n">phi</span><span class="p">)</span>
+            <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">,</span> <span class="n">msg</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;Phi&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="o">.</span><span class="n">theta</span>
+        <span class="n">params</span><span class="p">[</span><span class="s">&quot;Delta_Phi&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">phi</span><span class="p">)</span>
+        <span class="k">return</span> <span class="n">params</span>
+    
+    <span class="k">def</span> <span class="nf">set_params</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">params</span><span class="p">):</span></div>
+<div class="viewcode-block" id="SectorMask.set_params"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.sectorMask.SectorMask.set_params">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        Receive a dictionary and reset the slicer with values contained </span>
+<span class="sd">        in the values of the dictionary.</span>
+<span class="sd">        </span>
+<span class="sd">        :param params: a dictionary containing name of slicer parameters and </span>
+<span class="sd">            values the user assigned to the slicer.</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">main</span> <span class="o">=</span> <span class="n">params</span><span class="p">[</span><span class="s">&quot;Phi&quot;</span><span class="p">]</span> 
+        <span class="n">phi</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">fabs</span><span class="p">(</span><span class="n">params</span><span class="p">[</span><span class="s">&quot;Delta_Phi&quot;</span><span class="p">])</span>
+        
+        <span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="o">.</span><span class="n">theta</span> <span class="o">=</span> <span class="n">main</span>
+        <span class="c">## Reset the slicer parameters</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">right_line</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">phi</span><span class="o">=</span><span class="n">phi</span><span class="p">,</span> <span class="n">delta</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">mline</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="p">,</span>
+                               <span class="n">side</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="n">right</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">left_line</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">phi</span><span class="o">=</span><span class="n">phi</span><span class="p">,</span> <span class="n">delta</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
+                              <span class="n">mline</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">main_line</span><span class="p">,</span> <span class="n">side</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
+        <span class="c">## post the new corresponding data</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">_post_data</span><span class="p">()</span>
+        
+    <span class="k">def</span> <span class="nf">freeze_axes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></div>
+<div class="viewcode-block" id="SectorMask.freeze_axes"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.sectorMask.SectorMask.freeze_axes">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">freeze_axes</span><span class="p">()</span>
+        
+    <span class="k">def</span> <span class="nf">thaw_axes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></div>
+<div class="viewcode-block" id="SectorMask.thaw_axes"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.sectorMask.SectorMask.thaw_axes">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">thaw_axes</span><span class="p">()</span>
+
+    <span class="k">def</span> <span class="nf">draw</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span></div>
+<div class="viewcode-block" id="SectorMask.draw"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.sectorMask.SectorMask.draw">[docs]</a>        <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="o">.</span><span class="n">update</span><span class="p">()</span>
+        
+</pre></div></div></div>
+
+          </div>
+        </div>
+      </div>
+      <div class="sphinxsidebar">
+        <div class="sphinxsidebarwrapper">
+<div id="searchbox" style="display: none">
+  <h3>Quick search</h3>
+    <form class="search" action="../../../../../search.html" method="get">
+      <input type="text" name="q" />
+      <input type="submit" value="Go" />
+      <input type="hidden" name="check_keywords" value="yes" />
+      <input type="hidden" name="area" value="default" />
+    </form>
+    <p class="searchtip" style="font-size: 90%">
+    Enter search terms or a module, class or function name.
+    </p>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+        </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" >sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>
+    <div class="footer">
+        &copy; Copyright 2013, The SasView Project.
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
+    </div>
+  </body>
+</html>
Index: _modules/sas/guiframe/local_perspectives/plotting/slicerpanel.html
===================================================================
--- _modules/sas/guiframe/local_perspectives/plotting/slicerpanel.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
+++ _modules/sas/guiframe/local_perspectives/plotting/slicerpanel.html	(revision a462c6a6616628a6536b55fc2886d9ab1224149a)
@@ -0,0 +1,268 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>sas.guiframe.local_perspectives.plotting.slicerpanel &mdash; SasView 3.0.0 documentation</title>
+    
+    <link rel="stylesheet" href="../../../../../_static/default.css" type="text/css" />
+    <link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    '../../../../../',
+        VERSION:     '3.0.0',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="../../../../../_static/jquery.js"></script>
+    <script type="text/javascript" src="../../../../../_static/underscore.js"></script>
+    <script type="text/javascript" src="../../../../../_static/doctools.js"></script>
+    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <link rel="top" title="SasView 3.0.0 documentation" href="../../../../../index.html" />
+    <link rel="up" title="sas.guiframe" href="../../../guiframe.html" /> 
+  </head>
+  <body>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             accesskey="I">index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" accesskey="U">sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>  
+
+    <div class="document">
+      <div class="documentwrapper">
+        <div class="bodywrapper">
+          <div class="body">
+            
+  <h1>Source code for sas.guiframe.local_perspectives.plotting.slicerpanel</h1><div class="highlight"><pre>
+<span class="kn">import</span> <span class="nn">wx</span>
+<span class="kn">import</span> <span class="nn">wx.lib.newevent</span>
+<span class="c">#from copy import deepcopy</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.utils</span> <span class="kn">import</span> <span class="n">format_number</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">SlicerParameterEvent</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">EVT_SLICER_PARS</span>
+<span class="kn">from</span> <span class="nn">sas.guiframe.events</span> <span class="kn">import</span> <span class="n">EVT_SLICER</span>
+
+<span class="kn">from</span> <span class="nn">sas.guiframe.panel_base</span> <span class="kn">import</span> <span class="n">PanelBase</span>
+
+<span class="k">class</span> <span class="nc">SlicerPanel</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">Panel</span><span class="p">,</span> <span class="n">PanelBase</span><span class="p">):</span>
+    <span class="sd">&quot;&quot;&quot;</span>
+<div class="viewcode-block" id="SlicerPanel"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.slicerpanel.SlicerPanel">[docs]</a><span class="sd">    Panel class to show the slicer parameters </span>
+<span class="sd">    &quot;&quot;&quot;</span>
+    <span class="c">#TODO: show units</span>
+    <span class="c">#TODO: order parameters properly</span>
+     <span class="c">## Internal name for the AUI manager</span>
+    <span class="n">window_name</span> <span class="o">=</span> <span class="s">&quot;Slicer panel&quot;</span>
+    <span class="c">## Title to appear on top of the window</span>
+    <span class="n">window_caption</span> <span class="o">=</span> <span class="s">&quot;Slicer Panel&quot;</span>
+    <span class="n">CENTER_PANE</span> <span class="o">=</span> <span class="bp">False</span>
+    
+    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="nb">id</span><span class="o">=-</span><span class="mi">1</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">base</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
+                <span class="n">params</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">Panel</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
+        <span class="n">PanelBase</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
+        <span class="c">##  Initialization of the class     </span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">base</span> <span class="o">=</span> <span class="n">base</span>
+        <span class="k">if</span> <span class="n">params</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="n">params</span> <span class="o">=</span> <span class="p">{}</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">params</span> <span class="o">=</span> <span class="n">params</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="n">base</span><span class="o">.</span><span class="n">parent</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">frame</span> <span class="o">=</span> <span class="bp">None</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">type</span> <span class="o">=</span> <span class="nb">type</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">listeners</span> <span class="o">=</span> <span class="p">[]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">parameters</span> <span class="o">=</span> <span class="p">[]</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">bck</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">GridBagSizer</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">SetSizer</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">bck</span><span class="p">)</span>
+        <span class="k">if</span> <span class="nb">type</span> <span class="o">==</span> <span class="bp">None</span> <span class="ow">and</span> <span class="n">params</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>  
+            <span class="n">label</span> <span class="o">=</span> <span class="s">&quot;Right-click on 2D plot for slicer options&quot;</span>  
+            <span class="n">title</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">label</span><span class="p">,</span> <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_LEFT</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">bck</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">title</span><span class="p">,</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> 
+                         <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">LEFT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">15</span><span class="p">)</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">set_slicer</span><span class="p">(</span><span class="nb">type</span><span class="p">,</span> <span class="n">params</span><span class="p">)</span>
+        <span class="c">## Bindings</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">EVT_SLICER</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onEVT_SLICER</span><span class="p">)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">EVT_SLICER_PARS</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onParamChange</span><span class="p">)</span>
+
+    <span class="k">def</span> <span class="nf">onEVT_SLICER</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span>
+<div class="viewcode-block" id="SlicerPanel.onEVT_SLICER"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.slicerpanel.SlicerPanel.onEVT_SLICER">[docs]</a><span class="sd">        Process EVT_SLICER events</span>
+<span class="sd">        When the slicer changes, update the panel</span>
+<span class="sd">        </span>
+<span class="sd">        :param event: EVT_SLICER event</span>
+<span class="sd">        </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">event</span><span class="o">.</span><span class="n">Skip</span><span class="p">()</span>
+        <span class="k">if</span> <span class="n">event</span><span class="o">.</span><span class="n">obj_class</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">set_slicer</span><span class="p">(</span><span class="bp">None</span><span class="p">,</span> <span class="bp">None</span><span class="p">)</span> 
+        <span class="k">else</span><span class="p">:</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">set_slicer</span><span class="p">(</span><span class="n">event</span><span class="o">.</span><span class="n">type</span><span class="p">,</span> <span class="n">event</span><span class="o">.</span><span class="n">params</span><span class="p">)</span>
+        
+    <span class="k">def</span> <span class="nf">set_slicer</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">type</span><span class="p">,</span> <span class="n">params</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="SlicerPanel.set_slicer"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.slicerpanel.SlicerPanel.set_slicer">[docs]</a><span class="sd">        Rebuild the panel</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">bck</span><span class="o">.</span><span class="n">Clear</span><span class="p">(</span><span class="bp">True</span><span class="p">)</span>  
+        <span class="bp">self</span><span class="o">.</span><span class="n">type</span> <span class="o">=</span> <span class="nb">type</span>  
+        <span class="k">if</span> <span class="nb">type</span> <span class="o">==</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="n">label</span> <span class="o">=</span> <span class="s">&quot;Right-click on 2D plot for slicer options&quot;</span>
+            <span class="n">title</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">label</span><span class="p">,</span> <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_LEFT</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">bck</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">title</span><span class="p">,</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> 
+                         <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">LEFT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">15</span><span class="p">)</span>
+        <span class="k">else</span><span class="p">:</span>
+            <span class="n">title</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s">&quot;Slicer Parameters&quot;</span><span class="p">,</span> 
+                                  <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_LEFT</span><span class="p">)</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">bck</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">title</span><span class="p">,</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> 
+                         <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">LEFT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">15</span><span class="p">)</span>
+            <span class="n">n</span> <span class="o">=</span> <span class="mi">1</span>
+            <span class="bp">self</span><span class="o">.</span><span class="n">parameters</span> <span class="o">=</span> <span class="p">[]</span>
+            <span class="n">keys</span> <span class="o">=</span> <span class="n">params</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span>
+            <span class="n">keys</span><span class="o">.</span><span class="n">sort</span><span class="p">()</span>
+            <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">keys</span><span class="p">:</span>
+                <span class="k">if</span> <span class="ow">not</span> <span class="n">item</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="ow">in</span> <span class="p">[</span><span class="s">&quot;num_points&quot;</span><span class="p">,</span> <span class="s">&quot;avg&quot;</span><span class="p">,</span> <span class="s">&quot;avg_error&quot;</span><span class="p">,</span> <span class="s">&quot;sum&quot;</span><span class="p">,</span>
+                                         <span class="s">&quot;sum_error&quot;</span><span class="p">]:</span>
+                    <span class="n">n</span> <span class="o">+=</span> <span class="mi">1</span>
+                    <span class="n">text</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">item</span><span class="p">,</span> <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_LEFT</span><span class="p">)</span>
+                    <span class="bp">self</span><span class="o">.</span><span class="n">bck</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">text</span><span class="p">,</span> <span class="p">(</span><span class="n">n</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> 
+                            <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">LEFT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">15</span><span class="p">)</span>
+                    <span class="n">ctl</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">TextCtrl</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="p">(</span><span class="mi">80</span><span class="p">,</span> <span class="mi">20</span><span class="p">),</span> 
+                                      <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">TE_PROCESS_ENTER</span><span class="p">)</span>
+                    <span class="n">hint_msg</span> <span class="o">=</span> <span class="s">&quot;Modify the value of </span><span class="si">%s</span><span class="s"> to change &quot;</span> <span class="o">%</span> <span class="n">item</span>
+                    <span class="n">hint_msg</span> <span class="o">+=</span> <span class="s">&quot;the 2D slicer&quot;</span>
+                    <span class="n">ctl</span><span class="o">.</span><span class="n">SetToolTipString</span><span class="p">(</span><span class="n">hint_msg</span><span class="p">)</span>
+                    <span class="n">ctl</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">format_number</span><span class="p">(</span><span class="n">params</span><span class="p">[</span><span class="n">item</span><span class="p">])))</span>
+                    <span class="bp">self</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_TEXT_ENTER</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onTextEnter</span><span class="p">)</span>
+                    <span class="n">ctl</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_SET_FOCUS</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onSetFocus</span><span class="p">)</span>
+                    <span class="n">ctl</span><span class="o">.</span><span class="n">Bind</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">EVT_KILL_FOCUS</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">onTextEnter</span><span class="p">)</span>
+                    <span class="bp">self</span><span class="o">.</span><span class="n">parameters</span><span class="o">.</span><span class="n">append</span><span class="p">([</span><span class="n">item</span><span class="p">,</span> <span class="n">ctl</span><span class="p">])</span>
+                    <span class="bp">self</span><span class="o">.</span><span class="n">bck</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">ctl</span><span class="p">,</span> <span class="p">(</span><span class="n">n</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">TOP</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">BOTTOM</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span>
+            <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">keys</span><span class="p">:</span>
+                <span class="k">if</span>  <span class="n">item</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="ow">in</span> <span class="p">[</span><span class="s">&quot;num_points&quot;</span><span class="p">,</span> <span class="s">&quot;avg&quot;</span><span class="p">,</span> <span class="s">&quot;avg_error&quot;</span><span class="p">,</span> <span class="s">&quot;sum&quot;</span><span class="p">,</span>
+                                      <span class="s">&quot;sum_error&quot;</span><span class="p">]:</span>
+                    <span class="n">n</span> <span class="o">+=</span> <span class="mi">1</span>
+                    <span class="n">text</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">item</span> <span class="o">+</span> <span class="s">&quot;: &quot;</span><span class="p">,</span> 
+                                         <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_LEFT</span><span class="p">)</span>
+                    <span class="bp">self</span><span class="o">.</span><span class="n">bck</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">text</span><span class="p">,</span> <span class="p">(</span><span class="n">n</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> 
+                                 <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">LEFT</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_CENTER_VERTICAL</span><span class="p">,</span> 
+                                 <span class="n">border</span><span class="o">=</span><span class="mi">15</span><span class="p">)</span>
+                    <span class="n">ctl</span> <span class="o">=</span> <span class="n">wx</span><span class="o">.</span><span class="n">StaticText</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> 
+                                        <span class="nb">str</span><span class="p">(</span><span class="n">format_number</span><span class="p">(</span><span class="n">params</span><span class="p">[</span><span class="n">item</span><span class="p">])),</span>
+                                        <span class="n">style</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">ALIGN_LEFT</span><span class="p">)</span>
+                    <span class="n">ctl</span><span class="o">.</span><span class="n">SetToolTipString</span><span class="p">(</span><span class="s">&quot;Result </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">item</span><span class="p">)</span>
+                    <span class="bp">self</span><span class="o">.</span><span class="n">bck</span><span class="o">.</span><span class="n">Add</span><span class="p">(</span><span class="n">ctl</span><span class="p">,</span> <span class="p">(</span><span class="n">n</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">),</span> <span class="n">flag</span><span class="o">=</span><span class="n">wx</span><span class="o">.</span><span class="n">TOP</span><span class="o">|</span><span class="n">wx</span><span class="o">.</span><span class="n">BOTTOM</span><span class="p">,</span> <span class="n">border</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span>       
+        <span class="bp">self</span><span class="o">.</span><span class="n">bck</span><span class="o">.</span><span class="n">Layout</span><span class="p">()</span>
+        <span class="c">#self.bck.Fit(self)</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">Layout</span><span class="p">()</span>
+        <span class="n">psizer</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">GetSizer</span><span class="p">()</span>
+        <span class="k">if</span> <span class="n">psizer</span> <span class="o">!=</span> <span class="bp">None</span><span class="p">:</span>
+            <span class="n">psizer</span><span class="o">.</span><span class="n">Layout</span><span class="p">()</span>
+        
+    <span class="k">def</span> <span class="nf">onSetFocus</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">evt</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="SlicerPanel.onSetFocus"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.slicerpanel.SlicerPanel.onSetFocus">[docs]</a><span class="sd">        Hightlight the textcrtl</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="c"># Get a handle to the TextCtrl</span>
+        <span class="n">widget</span> <span class="o">=</span> <span class="n">evt</span><span class="o">.</span><span class="n">GetEventObject</span><span class="p">()</span>
+        <span class="c"># Select the whole control, after this event resolves</span>
+        <span class="n">wx</span><span class="o">.</span><span class="n">CallAfter</span><span class="p">(</span><span class="n">widget</span><span class="o">.</span><span class="n">SetSelection</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
+        <span class="k">return</span>
+    
+    <span class="k">def</span> <span class="nf">onParamChange</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">evt</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="SlicerPanel.onParamChange"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.slicerpanel.SlicerPanel.onParamChange">[docs]</a><span class="sd">        Receive and event and reset the text field contained in self.parameters</span>
+<span class="sd">            </span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">evt</span><span class="o">.</span><span class="n">Skip</span><span class="p">()</span>
+        <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">parameters</span><span class="p">:</span>              
+            <span class="k">if</span> <span class="n">item</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="ow">in</span> <span class="n">evt</span><span class="o">.</span><span class="n">params</span><span class="p">:</span>
+                <span class="n">item</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">SetValue</span><span class="p">(</span><span class="n">format_number</span><span class="p">(</span><span class="n">evt</span><span class="o">.</span><span class="n">params</span><span class="p">[</span><span class="n">item</span><span class="p">[</span><span class="mi">0</span><span class="p">]]))</span>
+                <span class="n">item</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">Refresh</span><span class="p">()</span>
+   
+    <span class="k">def</span> <span class="nf">onTextEnter</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">evt</span><span class="p">):</span> 
+        <span class="sd">&quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="SlicerPanel.onTextEnter"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.slicerpanel.SlicerPanel.onTextEnter">[docs]</a><span class="sd">        Parameters have changed</span>
+<span class="sd">        &quot;&quot;&quot;</span> 
+        <span class="n">params</span> <span class="o">=</span> <span class="p">{}</span>
+        <span class="n">has_error</span> <span class="o">=</span> <span class="bp">False</span>
+        <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">parameters</span><span class="p">:</span>
+            <span class="k">try</span><span class="p">:</span>
+                <span class="n">params</span><span class="p">[</span><span class="n">item</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">item</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">GetValue</span><span class="p">())</span>
+                <span class="n">item</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">SetBackgroundColour</span><span class="p">(</span>
+                        <span class="n">wx</span><span class="o">.</span><span class="n">SystemSettings_GetColour</span><span class="p">(</span><span class="n">wx</span><span class="o">.</span><span class="n">SYS_COLOUR_WINDOW</span><span class="p">))</span>
+                <span class="n">item</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">Refresh</span><span class="p">()</span>
+            <span class="k">except</span><span class="p">:</span>
+                <span class="n">has_error</span> <span class="o">=</span> <span class="bp">True</span>
+                <span class="n">item</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">SetBackgroundColour</span><span class="p">(</span><span class="s">&quot;pink&quot;</span><span class="p">)</span>
+                <span class="n">item</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">Refresh</span><span class="p">()</span>
+            
+        <span class="k">if</span> <span class="n">has_error</span> <span class="o">==</span> <span class="bp">False</span><span class="p">:</span>
+            <span class="c"># Post parameter event</span>
+            <span class="c">## base is guiframe is this case</span>
+            <span class="n">event</span> <span class="o">=</span> <span class="n">SlicerParameterEvent</span><span class="p">(</span><span class="nb">type</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">type</span><span class="p">,</span> <span class="n">params</span><span class="o">=</span><span class="n">params</span><span class="p">)</span>
+            <span class="n">wx</span><span class="o">.</span><span class="n">PostEvent</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">base</span><span class="p">,</span> <span class="n">event</span><span class="p">)</span>
+
+    <span class="k">def</span> <span class="nf">on_close</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">event</span><span class="p">):</span>
+        <span class="sd">&quot;&quot;&quot;</span></div>
+<div class="viewcode-block" id="SlicerPanel.on_close"><a class="viewcode-back" href="../../../../../dev/api/sas.guiframe.local_perspectives.plotting.html#sas.guiframe.local_perspectives.plotting.slicerpanel.SlicerPanel.on_close">[docs]</a><span class="sd">        On Close Event</span>
+<span class="sd">        &quot;&quot;&quot;</span>
+        <span class="n">ID</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">uid</span>
+        <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">delete_panel</span><span class="p">(</span><span class="n">ID</span><span class="p">)</span>            
+        <span class="bp">self</span><span class="o">.</span><span class="n">frame</span><span class="o">.</span><span class="n">Destroy</span><span class="p">()</span>
+</pre></div></div></div>
+
+          </div>
+        </div>
+      </div>
+      <div class="sphinxsidebar">
+        <div class="sphinxsidebarwrapper">
+<div id="searchbox" style="display: none">
+  <h3>Quick search</h3>
+    <form class="search" action="../../../../../search.html" method="get">
+      <input type="text" name="q" />
+      <input type="submit" value="Go" />
+      <input type="hidden" name="check_keywords" value="yes" />
+      <input type="hidden" name="area" value="default" />
+    </form>
+    <p class="searchtip" style="font-size: 90%">
+    Enter search terms or a module, class or function name.
+    </p>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+        </div>
+      </div>
+      <div class="clearer"></div>
+    </div>
+    <div class="related">
+      <h3>Navigation</h3>
+      <ul>
+        <li class="right" style="margin-right: 10px">
+          <a href="../../../../../genindex.html" title="General Index"
+             >index</a></li>
+        <li class="right" >
+          <a href="../../../../../py-modindex.html" title="Python Module Index"
+             >modules</a> |</li>
+        <li><a href="../../../../../index.html">SasView 3.0.0 documentation</a> &raquo;</li>
+          <li><a href="../../../../index.html" >Module code</a> &raquo;</li>
+          <li><a href="../../../guiframe.html" >sas.guiframe</a> &raquo;</li> 
+      </ul>
+    </div>
+    <div class="footer">
+        &copy; Copyright 2013, The SasView Project.
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
+    </div>
+  </body>
+</html>
