python怎么让图片旋转45度_我能把x轴旋转45度吗?试着做温度图

我需要以y轴为中心,但将x轴旋转45度。似乎在网上找不到任何关于这个的帮助。提前为任何帮助干杯。在

代码如下t = nwp.get('T','1000 hPa')

lon,lat = nwp.grid()

a,b = common.gridij3(174.,-41.,lon,lat)

pressure=[1000,950,925,850,700,600,500,400,300,250,150,100]

tt=[]

td=[]

tw=[]

for level in pressure:

tt.append(nwp.get('T','%i hPa' %level)[a,b]) # % means add hPa to value taken from level list

td.append(nwp.get('TD','%i hPa' %level)[a,b])

tw.append(nwp.get('TW','%i hPa' %level)[a,b])

print '---Temperatures---'

for t in tt:

print t

print '---Dew points---'

for t in td:

print t

print '---Wet bulb temperatures---'

for t in tw:

print t

#invert pressure axis

plt.gca().invert_yaxis()

#need to know how to rotate x axis by 45

plt.xlabel('Temperature K')

plt.ylabel('Pressure hPa')

plt.yscale('log')

plt.plot(tt,pressure,'r',label='Temp')

plt.plot(td,pressure,label='Dew Point')

plt.plot(tw,pressure,'g',label='Wet Bulb Temperature')

plt.legend()

plt.show()

你可能感兴趣的:(python怎么让图片旋转45度_我能把x轴旋转45度吗?试着做温度图)