I managed to plot a colorbar for a contourplot, but the colors are displayed as discete stripes instead of a continous spectrum. The colorbar is based on the data the contourplot, which I do not want to be displayed as continous.
I have six contour-plots as subplots in one figure. The value scale for all is from 0 to 1. At the right side, the colorbar is attached to two axes of the subplots (ax3, ax6) based on the data from one of the subplots:
Z = ax6.contour(data_5["z"], extent=[0*5, 10*5, 0*5, 7*5],levels=20)
cbar = fig.colorbar(Z, ax=[ax3,ax6], shrink=0.8, pad=0.01, aspect=10)
fig.subplots_adjust(right=0.8)
Is there a parameter I can add to have the colors in the colorbar be displayed as continuum or another way to achieve this?