def matplotlib_colourmap(name, samples=16):
    """
    Import a colourmap from a matplotlib

    Parameters
    ----------
    name : str
        Name of the matplotlib colourmap preset to import
    samples : int
        Number of samples to take for LinearSegmentedColormap type

    Returns
    -------
    list
        List of colours ready to be loaded by colourmap()
    """
    try:
        import matplotlib.pyplot as plt
        cmap = plt.get_cmap(name)
        if hasattr(cmap, 'colors'):
            data = cmap.colors
            if len(data) == 256 and samples is not None:
                subsample = int(256 / samples)
                data = data[0::subsample]
            return data
        if samples == None:
            samples = 16
        colours = []
        for i in range(samples):
            pos = i / float(samples - 1)
            colours.append(cmap(pos))
        return colours
    except Exception as e:
        return name
    return []
