You can set the rotation of individual labels after they are created. Label Text objects are returned by clabel , so you can store and .set_rotation(0) over them with .set_rotation(0) to orient them horizontally.
Change the last few lines of your script to:
labels1 = plt.clabel(CS, inline=True, use_clabeltext=True, fmt=formatter, fontsize=12) labels2 = plt.clabel(CS, inline=1, fontsize=12) for l in labels1+labels2: l.set_rotation(0)

source share