我正在极坐标图上绘制方位角高程曲线,其中高程是径向分量.默认情况下,Matplotlib将径向值从中心的0绘制到周长的90.我想扭转局面,因此90度处于中心位置.我尝试通过调用ax.set_ylim(90,0)设置限制,但这会导致抛出LinAlgError异常. ax是从调用add_axes获得的轴对象.
可以这样做,如果是这样,我该怎么办?
编辑:这是我现在正在使用的.基本绘图代码取自Matplotlib示例中的一个
# radar green, solid grid lines
rc('grid', color='#316931', linewidth=1, linestyle='-')
rc('xtick', labelsize=10)
rc('ytick', labelsize=10)
# force square figure and square axes looks better for polar, IMO
width, height = matplotlib.rcParams['figure.figsize']
size = min(width, height)
# make a square figure
fig = figure(figsize=(size, size))
ax = fig.add_axes([0.1, 0.1, 0.8, 0.8], projection='polar', axisbg='#d5de9c')
# Adjust radius so it goes 90 at the center to 0 at the perimeter (doesn't work)
#ax.set_ylim(90, 0)
# Rotate plot so 0 degrees is due north, 180 is due south
ax.set_theta_zero_location("N")
obs.date = datetime.datetime.utcnow()
az,el = azel_calc(obs, ephem.Sun())
ax.plot(az, el, color='#ee8d18', lw=3)
obs.date = datetime.datetime.utcnow()
az,el = azel_calc(obs, ephem.Moon())
ax.plot(az, el, color='#bf7033', lw=3)
ax.set_rmax(90.)
grid(True)
ax.set_title("Solar Az-El Plot", fontsize=10)
show()
由此产生的情节是