我试图在matplot lib中使用乳胶格式,但它并没有给我一行空间。这里是我的代码在Matplotlib中使用胶乳
plt.figure(103)
plt.title('$V_x mean and fitting$')
plt.plot(vx_mean_fit[sig_fit],Sig[sig_fit],label='$Vx mean fit$')
plt.xlabel('$V_x$')
plt.ylabel('$z/d$')
plt.legend()
我试图在matplot lib中使用乳胶格式,但它并没有给我一行空间。这里是我的代码在Matplotlib中使用胶乳
plt.figure(103)
plt.title('$V_x mean and fitting$')
plt.plot(vx_mean_fit[sig_fit],Sig[sig_fit],label='$Vx mean fit$')
plt.xlabel('$V_x$')
plt.ylabel('$z/d$')
plt.legend()
您可以使用原始字符串:
r'$V_x mean and fitting$'
或者你可以明确地转义空格:
'$V_x\ mean\ and\ fitting$'
使用原始字符串对空格不起作用。此外,你不能“逃避”空间;相反,反斜杠('\')**是乳胶数学模式中的一个空格。为了使用反斜杠,你需要使用一个原始字符串。 – ImportanceOfBeingErnest
尝试使用原始字符串为您的文字,像'r'$ V_x的意思是和适合$''。 –
这个完美的作品。 –