python回归之旅-用python学习数学---2023-009
2023-04-10 19:15 作者:一心想当网红的李老师 | 我要投稿
win7,python3.7下调试画图,没有什么问题
import math
from pylab import plot,show
x=[1,2,3]
y=[2,4,6]
plot(x,y,marker='o')
show()
---------------------------------------

-----------------------------------
import math
from pylab import plot,show
nc2000=[31.3,37.3,47.2,51.0,63.5,71.3,72.3,72.7,66.0,57.0,45.3,31.1]
nc2006=[40.9,35.7,43.1,55.7,63.1,71.0,77.9,75.8,66.6,56.2,51.9,43.6]
nc2012=[37.3,40.9,50.9,54.8,65.1,71.0,78.8,76.7,68.8,58.0,43.9,41.5]
month=range(1,13)
plot(month,nc2000,month,nc2006,month,nc2012)
show()

画图的时候x,y的维数必需一致。(标红的句子书本上是range(1,12)报错)
之后函数作图基本上可以自定义一个
def draw(x,y):