Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 极坐标图-从栅格偏移θ标签?_Python_Python 3.x_Matplotlib - Fatal编程技术网

Python 极坐标图-从栅格偏移θ标签?

Python 极坐标图-从栅格偏移θ标签?,python,python-3.x,matplotlib,Python,Python 3.x,Matplotlib,有没有办法将极坐标图中的“θ”标签与网格线偏移 我有下面的图,我非常希望三个条线以网格线为边界,但标签在中间: ##log scale? ##shift gridlines by 5 deg? plt.rc('xtick', labelsize=10) plt.rc('ytick', labelsize=10) width = np.pi/180*(10/3) half_cake = np.pi/180*(10/2) rmax = 30000 rmin=-5000 #radial_line

有没有办法将极坐标图中的“θ”标签与网格线偏移

我有下面的图,我非常希望三个条线以网格线为边界,但标签在中间:

##log scale?
##shift gridlines by 5 deg?

plt.rc('xtick', labelsize=10)
plt.rc('ytick', labelsize=10)

width = np.pi/180*(10/3)
half_cake = np.pi/180*(10/2)

rmax = 30000
rmin=-5000
#radial_lines = np.full(36, rmax).tolist()

fig, ax = plt.subplots(figsize=(10, 10))
ax = plt.subplot(111, projection='polar')
ax.bar(pp_range_rad, strains_list2[0][57][:], width, label = '(1)', edgecolor='grey')
ax.bar(pp_range_rad+width, strains_list2[1][57][:], width, label = '(2)', edgecolor='grey')
ax.bar(pp_range_rad-width, strains_list2[2][57][:], width, label = '(3)', edgecolor='grey')
ax.legend(loc = 0, bbox_to_anchor = (1.1, 1.1))
ax.set_rlabel_position(30)  # Move radial labels away from plotted line
ax.set_theta_direction(-1)
ax.set_xticks(np.pi/180. * np.linspace(0, 360, 36, endpoint=False))
ax.set_rmax(rmax)
ax.set_rmin(rmin)
ax.set_xticklabels(cake_nums)
ax.set_theta_zero_location('N', offset=0)
#ax.thetagrids(pp_range_deg+5)
#ax.axes.get_xaxis().set_visible(False)
plt.show()