2

I know there are similar questions out there, but I haven't managed to solve my problem. I followed the advice in this post (Shifted colorbar matplotlib) and used TwoSlopeNorm to shift my colorbar to have negative values with blue colours and positive values with red colours (example code below). But for some reason two intervals (0-5 and 5-10) are assigned white. Then two intervals have the same red (15-20 and 20-25). How do I fix this to have different colours for each interval?

fig, axes = plt.subplots()
levels = np.linspace(-5, 25, 7)
    
im0 = da6_annualtmn.plot.contourf(norm=TwoSlopeNorm(vcenter=0), 
                                  cmap='bwr', extend='max', levels=levels)

enter image description here

Jessica
  • 107
  • 6

0 Answers0