我试图在同一个图形上创建两个单独的绘图作为子绘图。两个绘图都是极坐标的。我的尝试使他们在同一张图上作图
def GenerateTrigonometryTable(x): #Define Function
A = np.arange (0,360,x)
B = np.sin(A*np.pi/180)
C = np.cos(A*np.pi/180)
table = np.dstack(([A],[B],[C]))
return table
Theta = (GenerateTrigonometryTable(5)[:,:,0])
STheta = (GenerateTrigonometryTable(5)[:,:,1])
CTheta = (GenerateTrigonometryTable(5)[:,:,2])
ax1 = plt.subplot(111, projection='polar')
ax1.plot(Theta.flatten(), STheta.flatten())
ax2 = plt.subplot(111, projection='polar')
ax2.plot(Theta.flatten(), CTheta.flatten())
fig.show()
这将它绘制在同一个图上,我需要它是两个独立的图的图
更面向对象的方法是:
相当于谢尔多的答案,但显示了如何在matplotlib数字,轴和绘图
您需要如下:
121
表示1x2子地块网格上的第一个绘图,122
表示1x2子地块网格上的第二个绘图相关问题 更多 >
编程相关推荐