julia 调用matplotlib.pyplot 须要先using pycall
先安装pycall
Pkg.add("PyCall")
然后吧。
。
。
上代码把:(应该是通俗易懂的)
x=[0.5:0.01:4.49]
y=sin(x)
using PyPlot
using PyCall
@pyimport matplotlib.pyplot as plt
fig,ax=plt.subplots()
ax[:plot](x,y,linewidth=1,label=L"$y = \sin(x)$",alpha=0.6)
plt.ylabel("sin(x)")
plt.xlabel("x")
plt.title("Fs-En Curves")
ax[:legend]()
须要注意的一点是 matplotlib 里的 import 这里要替换成 @pyimport
画出来的图就是这样了