Plot a custom colormap next to iterative scatterplot

I have a set of coordinates that are arranged per year, and I scatterplot them.
I create a custom colormap that reflects those years, but the issue is I can’t manage to plot the colorbar of that colormap, and replace the ticks by the values of a numpy array of datetime64. I have no idea how to do it since I don’t plot any image (and the examples online are mainly with plt.imshow).