我試圖在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的意思是和適合$''。 –
這個完美的作品。 –