Skip to content Skip to sidebar Skip to footer

Pyplot Contour Plot - Clabel Spacing

I have trouble with matplotlib / pyplot / basemap. I plot contour lines (air pressure) on a map. I use clabel to show the value of the contour lines. But the problem is: the paddi

Solution 1:

The "inline_spacing" parameter can be set to negative values. It gave me a warning, but trying -2 or -3 should probably fix your problem.

Solution 2:

cb = plt.clabel(S1,inline=1,inline_spacing=0,fontsize=8,fmt='%1.0f',colors='b')
[txt.set_bbox(dict(boxstyle='square,pad=0',fc='red')) for txt in cb]

Matplotlib Text class create a bbox. You need to set the pad = 0.Then inline_spacing works.

Refer to the Question!

Post a Comment for "Pyplot Contour Plot - Clabel Spacing"