我正在计算一个分析,它是针对地球表面以上给定高度的波浪数据。虽然我的高度是一个自变量,但我想把它放在y轴上,这样更容易可视化。我不想实际翻转代码中的x和y数据,只需旋转图形。
plt3 = plt.subplot(gs[3, 0:3])
plt.title('Wave Graph')
plt.ylabel('wavelength [m]')
plt.xlabel('Altitude [km]')
WT = plt.contourf(Alt, Wavlgth, wave, 100, cmap=plt.cm.seismic, extend = 'both')
plt.xlim(xlim[:])
plt.ylim([np.min(period), np.max(period)])
ax = plt.gca().yaxis
plt.plot(time, coi, 'w')
plt3.fill_between(Alt, coi, np.max(coi), facecolor = 'white')
position2=fig.add_axes([.58, 0.03, 0.01, 0.2]) #Pos and size of colorbar
plt.colorbar(WT, cax=position2, orientation='vertical')
这将创建一个看起来像the following Imgur link的图形。我试着旋转阵列,但似乎什么也解决不了。
因为您没有提供Minimal, Complete, and Verifiable example ,所以我无法绘制结果,也无法检查代码。在
如果我没听错你的问题,你需要切换Alt和Wavlgth,并转换wave:
相关问题 更多 >
编程相关推荐