我有以下小功能:
def plotresults(freqs,power,prob,title,sigP):
pl.suptitle(title)
ax1 = pl.subplot(2,1,1)
ax1.axhline(y=sigP, color='r', ls='--',label='p=0.05')
pl.plot(freqs,power)
ax1.set_ylabel('Spectral Power')
ax2 = pl.subplot(2,1,2)
ax2.axhline(y=0.05, color='r', ls='--', label='p=0.05')
pl.semilogy(freqs,prob)
ax2.set_xlabel(r'Frequency (years$^{-1}$)')
ax2.set_ylabel('p-value')
pl.savefig('lsfast/figs/'+title+'.png')
pl.close()
Run Code Online (Sandbox Code Playgroud)
它绘制得很好,并绘制了应该在哪里的线条,但线条标签不会出现在任何地方.我究竟做错了什么?附加了一个输出示例:
我继承了一些我试图修改的webgame的PHP代码.我遇到了这一行,我无法弄清楚它应该做什么.有人可以帮帮我吗?$ notice只是一个常规字符串.
$notice = preg_replace("#([\S]{60})#i", "\\1 ", $notice);
Run Code Online (Sandbox Code Playgroud)