import numpy as np
import matplotlib.pylab as plt
from matplotlib.colors import ListedColormap
x = np.arange(10)
y = np.arange(10)
# These are the colors for my data
z = np.arange(10)
# These are the alpha values for my data
alphas = np.linspace(0.1, 1, 10)
# Color map I want to use
cm = plt.cm.get_cmap('viridis')
# Get the colormap colors for my data
my_cmap = cm(z)
# Set alpha
my_cmap[:, -1] = alphas
# Create new colormap
my_cmap = ListedColormap(my_cmap)
plt.subplot(121)
plt.scatter(x, y, cmap=cm, c=z)
plt.subplot(122)
plt.scatter(x, y, cmap=my_cmap, c=z)
plt.show()