Example #1
0
 def test_plot_spanroi_axis_0(self):
     self.im.plot()
     p = roi.SpanROI(0.5, 0.7)
     p.add_widget(signal=self.im, axes=[
         0,
     ], color="cyan")
     return self.im._plot.navigator_plot.figure
Example #2
0
 def test_plot_spanroi_close(self):
     im = self.im
     im.plot()
     p = roi.SpanROI(0.5, 0.7)
     p.add_widget(signal=im, axes=[0, ], color="cyan")
     for widget in p.widgets:
         widget.close()
Example #3
0
 def test_plot_spanroi_axis_2(self):
     self.im.plot()
     p = roi.SpanROI(0.005, 0.007)
     p.add_widget(signal=self.im, axes=[
         2,
     ], color="cyan")
     return self.im._plot.signal_plot.figure
Example #4
0
 def test_plot_spanroi_axis_1(self, mpl_cleanup):
     self.im.plot()
     p = roi.SpanROI(0.05, 0.07)
     p.add_widget(signal=self.im, axes=[
         1,
     ], color="cyan")
     return self.im._plot.signal_plot.figure
Example #5
0
 def test_plot_spanroi_axis_1(self):
     im = self.im
     im.plot()
     p = roi.SpanROI(0.05, 0.07)
     p.add_widget(signal=im, axes=[
         1,
     ], color="cyan")
     return im._plot.signal_plot.figure
Example #6
0
def test_remove_rois():
    s = Signal1D(np.arange(10))
    s2 = s.deepcopy()
    r = roi.SpanROI(2, 4)
    s.plot()
    s2.plot()

    _ = r.interactive(s)
    _ = r.interactive(s2)

    r.remove_widget(s)
Example #7
0
def test_plot_span_roi_changed_event():
    s = Signal1D(np.arange(100))
    s.plot()
    r = roi.SpanROI()
    s_span = r.interactive(s)
    np.testing.assert_allclose(s_span.data, np.arange(25, 74))

    w = list(r.widgets)[0]
    assert w._pos == (24.5, )
    assert w._size == (50., )
    w._set_span_extents(10, 20)
    np.testing.assert_allclose(s_span.data, np.arange(9, 19))