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
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()
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
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
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
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)
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))