I am comparing various missions and I want the colour bar to have a max and min set by me. I am not sure how to do this, any help with this? The missions themselves will keep within a range but I want to set it, so it is easily comparable. Some missions are different and some arent so I dont want the computer to set the max and min automatically.
crs_latlon = ccrs.PlateCarree()
def make_plot(projection_name, projection_crs):
ax = plt.axes(projection=projection_crs)
#ax.set_extent((-65.0, -58, 40, 47.7), crs=crs_latlon)
ax.set_extent((-65.0, -62, 43, 45.5), crs=crs_latlon)
#Add coastlines and meridians/parallels (Cartopy-specific).
plt.gca().coastlines('10m')
ax.gridlines(crs=crs_latlon, linestyle='-')
# Add a title, legend, and display.
ax.set_title(''.join(("Mission #13: Attenuation Coeffiecient - ",
projection_name)))
cb = plt.scatter(avglonlist, avglatlist, c=klist, cmap=coolwarm)
plt.colorbar(cb, cmap=coolwarm, orientation='vertical',ticklocation='auto')
#plt.colorbar.ColorbarBase(ax=ax, cmap = coolwarm, orientation='vertical', ticklocation='auto',
# norm=plt.colors.Normalize(vmin=0, vmax=1))
iplt.show()
def main():
# Demonstrate with two different display projections.
make_plot('Equidistant Cylindrical', ccrs.PlateCarree())
graph_my_latandk(avglatlist,klist)
if __name__ == '__main__':
main()
I guess you have to create your own color bar like here:
vmin, vmax
allow to set limits of colorbar butclim
allow to set limits of color map.