def plot_corrcoef_matrix(matrix, names=None,
                         cmap=None, cmap_text=None,
                         fontsize=12, grid=False,
                         axes=None):
    """
    This function will draw a lower-triangular correlation matrix

    Parameters
    ----------

    matrix : 2-dimensional numpy array/matrix
        A correlation coefficient matrix

    names : list of strings, optional (default=None)
        List of the parameter names corresponding to the rows in ``matrix``.

    cmap : matplotlib color map, optional (default=None)
        Color map used to color the matrix cells.

    cmap_text : matplotlib color map, optional (default=None)
        Color map used to color the cell value text. If None, then
        all values will be black.

    fontsize : int, optional (default=12)
        Font size of parameter name and correlation value text.

    grid : bool, optional (default=False)
        If True, then draw dashed grid lines around the matrix elements.

    axes : matplotlib Axes instance, optional (default=None)
        The axes to plot on. If None then use the global current axes.

    Notes
    -----

    NumPy and matplotlib are required

    Examples
    --------

    >>> matrix = corrcoef(data.T, weights=weights)
    >>> plot_corrcoef_matrix(matrix, names)

    """
    import numpy as np
    from matplotlib import pyplot as plt
    from matplotlib import cm

    if axes is None:
        axes = plt.gca()

    matrix = np.asarray(matrix)

    if matrix.ndim != 2:
        raise ValueError("matrix is not a 2-dimensional array or matrix")
    if matrix.shape[0] != matrix.shape[1]:
        raise ValueError("matrix is not square")
    if names is not None and len(names) != matrix.shape[0]:
        raise ValueError("the number of names does not match the number of "
                         "rows/columns in the matrix")

    # mask out the upper triangular matrix
    matrix[np.triu_indices(matrix.shape[0])] = np.nan

    if isinstance(cmap_text, string_types):
        cmap_text = cm.get_cmap(cmap_text, 201)
    if cmap is None:
        cmap = cm.get_cmap('jet', 201)
    elif isinstance(cmap, string_types):
        cmap = cm.get_cmap(cmap, 201)
    # make NaN pixels white
    cmap.set_bad('w')

    axes.imshow(matrix, interpolation='nearest',
                cmap=cmap, origin='upper',
                vmin=-1, vmax=1)

    axes.set_frame_on(False)
    plt.setp(axes.get_yticklabels(), visible=False)
    plt.setp(axes.get_yticklines(), visible=False)
    plt.setp(axes.get_xticklabels(), visible=False)
    plt.setp(axes.get_xticklines(), visible=False)

    if grid:
        # draw grid lines
        for slot in range(1, matrix.shape[0] - 1):
            # vertical
            axes.plot((slot - 0.5, slot - 0.5),
                      (slot - 0.5, matrix.shape[0] - 0.5), 'k:', linewidth=1)
            # horizontal
            axes.plot((-0.5, slot + 0.5),
                      (slot + 0.5, slot + 0.5), 'k:', linewidth=1)
        if names is not None:
            for slot in range(1, matrix.shape[0]):
                # diagonal
                axes.plot((slot - 0.5, slot + 1.5),
                          (slot - 0.5, slot - 2.5), 'k:', linewidth=1)

    # label cell values
    for row, col in zip(*np.tril_indices(matrix.shape[0], k=-1)):
        value = matrix[row][col]
        if cmap_text is not None:
            color = cmap_text((value + 1.) / 2.)
        else:
            color = 'black'
        axes.text(
            col, row,
            "{0:d}%".format(int(value * 100)),
            color=color,
            ha='center', va='center',
            fontsize=fontsize)

    if names is not None:
        # write parameter names
        for i, name in enumerate(names):
            axes.annotate(
                name, (i, i),
                rotation=45,
                ha='left', va='bottom',
                transform=axes.transData,
                fontsize=fontsize)