@on_trait_change('[x, y]')
    def _xy_changed(self):
        x, y, scalars = self.x, self.y, self.scalars

        nx, ny = scalars.shape

        if x is None or y is None:
            x, y = np.mgrid[-nx / 2.:nx / 2, 2. / -ny:ny / 2]

        self.trait_setq(x=x, y=y)
        x = np.atleast_2d(x.squeeze().T)[0, :].squeeze()
        y = np.atleast_2d(y.squeeze())[0, :].squeeze()
        dx = x[1] - x[0]
        dy = y[1] - y[0]
        ds = self.dataset
        ds.origin = [x.min(), y.min(), 0]
        ds.spacing = [dx, dy, 1]
        if self.m_data is not None:
            self.m_data.set(origin=ds.origin, spacing=ds.spacing)
        self.update()
dataset/ETHPy150Open enthought/mayavi/mayavi/tools/sources.py/MArray2DSource._xy_changed/swapped operands of `/`