之前是有些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")

Python学习(1) - matplotlib

搞定~

相关文章:

  • 2021-05-03
  • 2021-12-26
  • 2021-04-21
  • 2021-06-23
  • 2021-07-12
  • 2021-04-06
猜你喜欢
  • 2021-04-09
  • 2021-09-07
  • 2021-10-10
  • 2021-12-27
  • 2021-07-09
  • 2021-05-27
  • 2021-10-08
相关资源
相似解决方案