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
畫出來的圖就是這樣了
