@classmethod<EOL><INDENT>def from_uniform(<EOL>cls, z, origin=(<NUM_LIT:0>, <NUM_LIT:0>), step=(<NUM_LIT:1>, <NUM_LIT:1>), formatter=numpy_formatter):<DEDENT>
z = np.ma.asarray(z, dtype=np.float64)<EOL>if z.ndim != <NUM_LIT:2>:<EOL><INDENT>raise TypeError(<EOL>"<STR_LIT>".format(z.ndim))<EOL><DEDENT>if len(origin) != <NUM_LIT:2>:<EOL><INDENT>raise TypeError(<EOL>"<STR_LIT>".format(<EOL>len(origin)))<EOL><DEDENT>if len(step) != <NUM_LIT:2>:<EOL><INDENT>raise TypeError(<EOL>"<STR_LIT>".format(<EOL>len(step)))<EOL><DEDENT>if any(s == <NUM_LIT:0> for s in step):<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>".format(<EOL>str(step)))<EOL><DEDENT>y, x = np.mgrid[<EOL>origin[<NUM_LIT:0>]:(origin[<NUM_LIT:0>]+step[<NUM_LIT:0>]*z.shape[<NUM_LIT:0>]):step[<NUM_LIT:0>],<EOL>origin[<NUM_LIT:1>]:(origin[<NUM_LIT:1>]+step[<NUM_LIT:1>]*z.shape[<NUM_LIT:1>]):step[<NUM_LIT:1>]]<EOL>return cls(x, y, z, formatter)<EOL>
Construct a contour generator from a uniform grid.

        NOTE
        ----
        The default `origin` and `step` values is equivalent to calling
        :meth:`matplotlib.axes.Axes.contour` with only the `z` argument.

        Parameters
        ----------
        z : array_like
            The 2-dimensional uniform grid of data to compute contours for.
            Masked arrays are supported.
        origin : (number.Number, number.Number)
            The (x, y) coordinate of data point `z[0,0]`.
        step :  (number.Number, number.Number)
            The (x, y) distance between data points in `z`.
        formatter : callable
            A conversion function to convert from the internal `Matplotlib`_
            contour format to an external format.  See :ref:`formatters` for
            more information.

        Returns
        -------
        : :class:`QuadContourGenerator`
            Initialized contour generator.