I'm trying to make a scatter plot with colorbar where "0" is transparent. It's important that data that is zero has a transparent scatter point, but I don't want this transparent color bin to show up in my colorbar. I would like to limit the range of my colorbar legend to (1,14). clim(0, 14) doesn't do the job for me.
plt.figure()
cmaplist = plt.get_cmap('jet')(range(256))
cmaplist[:,-1] = [0] + list(np.ones(len(cmaplist[:-1])))
map_object = mpl.colors.LinearSegmentedColormap.from_list(name='agn_map', colors=cmaplist)
plt.register_cmap(cmap=map_object)
bounds = np.linspace(0, 14, 15)
norm = mpl.colors.BoundaryNorm(bounds, 256)
x, y, z = np.random.uniform(0, 10, 50), np.random.uniform(0, 10, 50), np.random.randint(0, 14, 50)
plt.scatter(x, y, c=z, cmap='agn_map', norm=norm, s=25, marker="*")
plt.xlabel('V-J restframe mag', fontsize=12)
plt.ylabel('U-V restframe mag', fontsize=12)
plt.colorbar()
plt.show()
I'd like to cut off the lowest color bin from the bar:


