nat*_*lng 3 unicode julia ijulia-notebook jupyter-notebook
我正在使用Julia(使用Jupyter笔记本的IJulia插件).如何在我的情节中正确显示unicode字符?
这是我的代码:
using PyPlot
? = linspace(-0.25, 1.25, 100);
f = (?.^2).*(1.0-?).^2;
figure(figsize=(8,5))
plot(?, f, color="purple", linewidth=1.8, linestyle="-")
xlabel("?")
ylabel("f(?)")
Run Code Online (Sandbox Code Playgroud)
但是,该图未正确显示unicode字符φ:
小智 7
在这种情况下,PyPlot支持LaTeX命令:
xlabel(L"$\phi$")
ylabel(L"$f(\phi)$")
Run Code Online (Sandbox Code Playgroud)