def test_apply_roi(self):
        self.client.add_layer(self.data)
        self.client.set_component(self.data.id['y'])
        # bins are -7...-1

        self.data.edit_subset = [self.data.subsets[0]]
        roi = PolygonalROI(vx=[-5.1, -4.5, -3.2], vy=[2, 3, 4])

        self.client.apply_roi(roi)
        state = self.data.subsets[0].subset_state
        assert isinstance(state, RangeSubsetState)

        # range should expand to nearest bin edge
        assert state.lo == -6
        assert state.hi == -3
dataset/ETHPy150Open glue-viz/glue/glue/viewers/histogram/tests/test_client.py/TestHistogramClient.test_apply_roi/original