sm = plt.cm.ScalarMappable(cmap=sns.cubehelix_palette(3, as_cmap=True),
    norm=plt.Normalize(vmin=0, vmax=3))
sm._A = []
How to add `colorbar` to `networkx` using a `seaborn` color palette? (Python 3)