# tfl.test_utils.two_dim_mesh_grid

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/lattice/blob/v2.1.1/tensorflow_lattice/python/test_utils.py#L113-L155) |

Generates uniform 2-d mesh grid for 3-d surfaces visualisation via pyplot.

    tfl.test_utils.two_dim_mesh_grid(
        num_points, x_min, y_min, x_max, y_max
    )

Uniformly distributes 'num_points' within rectangle:
(x_min, y_min) - (x_max, y_max)
'num_points' should be such that uniform distribution is possible. In other
words there should exist such integers 'x_points' and 'y_points' that:

- x_points \* y_points == num_points
- x_points / y_points == (x_max - x_min) / (y_max - y_min)

<br />

<br />

<br />

| ## Args ||
|---|---|
| `num_points` | number of points in the grid. |
| `x_min` | bounds of the grid. |
| `y_min` | bounds of the grid. |
| `x_max` | bounds of the grid. |
| `y_max` | bounds of the grid. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| Tuple containing 2 numpy arrays which represent X and Y coordinates of mesh grid ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `ValueError` | if it's impossible to uniformly distribute 'num_points' across specified grid. |

<br />