之前是有些Python基础
Python的学习朱啊哟为了实用
那就从matplotlib, 画图应用开始啦
首先是安装 PIP
我参考的是 https://www.makeuseof.com/tag/install-pip-for-python/
下载页面提及的 get-pip.py
在Python下运行 就好
然后就是安装 matplotlib 库
我参考的是 https://solarianprogrammer.com/2017/02/25/install-numpy-scipy-matplotlib-python-3-windows/
倒是没有碰到太多问题
pip install numpy
pip install scipy
pip install matplotlib
一路搞定
然后就是测试代码啦~
import numpy as np
import matplotlib.pyplot as plt
print ('Hello World')
print ('Test from Luke')
x=[0,1]
y=[0,1]
plt.figure()
plt.plot(x,y)
plt.legend()
# 显示图片
plt.show()
# 输出图片
plt.savefig("easyplot.png")
搞定~