def METHOD_NAME(domains, linespec='-', **kwargs):
    """A convenient function that can be used to visualize Hi-C structural domains. 
    *kwargs* will be passed to :func:`matplotlib.pyplot.plot`.
    :arg domains: a 2D array of Hi-C domains, such as [[start1, end1], [start2, end2], ...].
    :type domains: :class:`numpy.ndarray`
    """
    fill_ends = kwargs.pop('fill_ends', 'close')
    domains = np.array(domains)
    shape = domains.shape
    if len(shape) == 1:
        # convert to domain list if labels are provided
        indicators = np.diff(domains)
        length = len(domains)
        if fill_ends in ['open', 'close']:
            indicators = np.append(1., indicators)
            indicators[-1] = 1
        elif fill_ends == 'skip':
            indicators = np.append(0., indicators)
        else:
            raise ValueError('invalid fill_ends mode: %s'%str(fill_ends))
        sites = np.where(indicators != 0)[0]
        starts = sites[:-1]
        ends = sites[1:]
        domains = np.array([starts, ends]).T
        consecutive = True
    elif len(shape) == 2:
        if domains.dtype == bool:
            length = domains.shape[1]
            domains_ = []
            for h in domains:
                start = None
                for i, b in enumerate(h):
                    if b:
                        if start is None:  # start
                            start = i
                    else:
                        if start is not None: # end
                            domains_.append([start, i-1])
                            start = None
                if start is not None:
                    domains_.append([start, i])
            domains = np.array(domains_)
        else:
            length = domains.max()
        consecutive = False
    else:
        raise ValueError('domains must be either one or two dimensions')
    from matplotlib.pyplot import figure, plot
    a = []; b = []
    lwd = kwargs.pop('linewidth', 1)
    lwd = kwargs.pop('lw', lwd)
    linewidth = np.abs(lwd)
    if fill_ends == 'open' and len(domains) == 1:
        domains = []
    for i in range(len(domains)):
        domain = domains[i]
        start = domain[0]; end = domain[1]
        if fill_ends == 'open' and start == 0:
            a.extend([end, end])
            b.extend([start, end])
        elif fill_ends == 'open' and end == length-1:
            a.extend([start, end])
            b.extend([start, start])
        else:
            a.extend([start, end, end])
            b.extend([start, start, end])
        if not consecutive:
            a.append(np.nan)
            b.append(np.nan)
    if lwd > 0:
        x = a; y = b
    else:
        x = b; y = a
    plt = plot(x, y, linespec, linewidth=linewidth, **kwargs)
    if SETTINGS['auto_show']:
        showFigure()
    return plt