예제 #1
0
    def add_limit_tool(self, plot, orientation, handler=None):
        from pychron.graph.tools.limits_tool import LimitsTool
        from pychron.graph.tools.limits_tool import LimitOverlay

        t = LimitsTool(component=plot, orientation=orientation)

        o = LimitOverlay(component=plot, tool=t)

        plot.tools.insert(0, t)
        plot.overlays.append(o)
        if handler:
            t.on_trait_change(handler, 'limits_updated')
예제 #2
0
파일: graph.py 프로젝트: NMGRL/pychron
    def add_limit_tool(self, plot, orientation, handler=None):
        from pychron.graph.tools.limits_tool import LimitsTool
        from pychron.graph.tools.limits_tool import LimitOverlay

        t = LimitsTool(component=plot,
                       orientation=orientation)

        o = LimitOverlay(component=plot, tool=t)

        plot.tools.insert(0, t)
        plot.overlays.append(o)
        if handler:
            t.on_trait_change(handler, 'limits_updated')
예제 #3
0
    def _add_limit_tool(self, plot, orientation):
        t = LimitsTool(component=plot, orientation=orientation)

        o = LimitOverlay(component=plot, tool=t)

        plot.tools.append(t)
        plot.overlays.append(o)
예제 #4
0
    def _add_limit_tool(self, plot):
        """
        add tool for dragging the limits of the graph

        :param plot: Plot
        """
        t = LimitsTool(component=plot, orientation='x')

        o = LimitOverlay(component=plot, tool=t)

        plot.tools.append(t)
        plot.overlays.append(o)
예제 #5
0
from numpy import *

d = os.path.dirname(os.getcwd())
sys.path.append(d)

from pychron.core.ui import set_toolkit

set_toolkit('qt4')

from pychron.graph.graph import Graph
from pychron.graph.tools.limits_tool import LimitsTool, LimitOverlay

xs = linspace(0, pi * 2)
ys = cos(xs)

g = Graph()
p = g.new_plot()
g.new_series(xs, ys)

t = LimitsTool(component=p)
o = LimitOverlay(component=p, tool=t)
p.tools.append(t)
p.overlays.append(o)

t = LimitsTool(component=p, orientation='y')
o = LimitOverlay(component=p, tool=t)
p.tools.append(t)
p.overlays.append(o)

g.configure_traits()