所有,我正在使用 Matplotlib 绘制极坐标。但是刻度是重叠的。
有人知道如何避免这种情况吗?谢谢!
from pylab import *
import matplotlib.pyplot as plt
from cf.plot import BoundaryNorm,getBoundCmap
from matplotlib import colors
fig = figure(figsize=(8,8))
ax = fig.add_axes([0.1, 0.1, 0.8, 0.8], polar=True)
N = 8
theta = np.arange(0.0, 2*np.pi, 2*np.pi/N)
radii = ones((1,N)).squeeze()
width = 2*np.pi/N
bars = ax.bar(theta, radii, width=width, bottom=0.6)
listBnd = [0,3,6,9,12,15,18,21,24]
mcolors = plt.cm.Spectral(linspace(0,1,N))
cmap = colors.ListedColormap(mcolors)
for r,bar in zip(arange(1,N+1), bars):
bar.set_facecolor(cmap(r-1))
xlabels = array([0,21,18,15,12,9,6,3])
ax.xaxis.labelpad=50
ax.set_xticks(theta)
ax.set_xticklabels(xlabels,rotation=270,fontsize='60')
ax.xaxis.set_label_coords(0.5,-0.5)
ax.set_yticklabels([])
grid([])
show()