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

画出来的图就是这样了

julia/pyplot 绘图加入标签和标题

相关文章:

  • 2021-08-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
  • 2022-01-07
猜你喜欢
  • 2021-08-08
  • 2022-12-23
  • 2021-11-20
  • 2021-10-18
  • 2021-12-08
  • 2022-01-13
相关资源
相似解决方案