1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > python画图xlable显示中文_xlabel和ylabel超出绘图区域 无法在figu中完全显示

python画图xlable显示中文_xlabel和ylabel超出绘图区域 无法在figu中完全显示

时间:2019-02-08 04:50:10

相关推荐

python画图xlable显示中文_xlabel和ylabel超出绘图区域 无法在figu中完全显示

从图中可以看出,xlabel和ylabe超出了绘图区域,不能完全显示出来。在

有人可能会说更改字体大小,但我希望字体大小更大。在

代码如下:from numpy import *

from pylab import *

tduration=3600

if tduration<960:

time=linspace(0,tduration,120)

else:

n=(tduration-960)/480

time1=linspace(0,960,8,endpoint=False)

time2=linspace(960,tduration,n)

time=hstack((time1,time2))

timemin=time/60

T0=20

Tf=T0+345*log10(8*timemin+1)

timetem=column_stack((timemin,Tf))

savetxt("timetem.txt",timetem,newline='\r\n',fmt='%f')

heatingRate=345/(8*timemin+1)

fig,ax1 =subplots()

ax2 = ax1.twinx()

rc('font',family='Times New Roman')

ax1.plot(timemin,Tf,'k',linewidth=3,label='ISO834 fire curve')

ax2.plot(timemin,heatingRate,'b--',linewidth=3,label='heating rate')

ax1.plot(0, 0,'b--', label = 'heating rate',linewidth=3)

leg=ax1.legend(loc='best',fontsize=24)

leg.get_frame().set_alpha(0.0)

ax1.set_ylabel(r"T$(^{\circ}C)$",fontsize=24,fontname="Times New Roman")

ax2.set_ylabel(r"Heating rate($^{\circ}C$/min)",fontsize=24,fontname="Times New Roman")

ax1.set_xlabel("Time(min)",fontsize=24,fontname="Times New Roman")

ax1.tick_params(labelsize=24)

ax2.tick_params(labelsize=24)

ax1.grid()

show()

fig.savefig('iso834 with hr.png', transparent=True)

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。