import math
import itertools


def make_subplot_coords(n_subplot, ncol):
    """Make subplot coords.

    Parameters
    ----------
    n_subplot : int
        number of subplots to make
    ncol : int
        Number of columns with subplots
    Returns
    x : tuple 
       (subplot_coords_x-y,nrow,ncol)
    """
    # setting up subplots
    ncol = int(ncol)
    n_subplot = int(n_subplot)
    nrow = int(math.ceil(n_subplot / float(ncol)))
    
    # subplot coords 
    coords = itertools.product(range(nrow), range(ncol))
    
    return (coords, nrow)