# 使用Matplotlib绘制正余弦函数、抛物线

+关注继续查看

### 安装

pip install matplotlib 

### 绘制正余弦函数

import numpy as np
import matplotlib.pyplot as plt
X = np.linspace(-np.pi, np.pi, 256,endpoint=True)
C,S = np.cos(X), np.sin(X)
plt.plot(X,C)
plt.plot(X,S)
plt.show()

python plot01.py

print(X)

[
-3.14159265 -3.11695271 -3.09231277 -3.06767283 -3.04303288 -3.01839294
-2.993753   -2.96911306 -2.94447311 -2.91983317 -2.89519323 -2.87055329
-2.84591335 -2.8212734  -2.79663346 -2.77199352 -2.74735358 -2.72271363
-2.69807369 -2.67343375 -2.64879381 -2.62415386 -2.59951392 -2.57487398
-2.55023404 -2.52559409 -2.50095415 -2.47631421 -2.45167427 -2.42703432
-2.40239438 -2.37775444 -2.3531145  -2.32847456 -2.30383461 -2.27919467
-2.25455473 -2.22991479 -2.20527484 -2.1806349  -2.15599496 -2.13135502
-2.10671507 -2.08207513 -2.05743519 -2.03279525 -2.0081553  -1.98351536
-1.95887542 -1.93423548 -1.90959553 -1.88495559 -1.86031565 -1.83567571....3.11695271  3.14159265]

X1=np.linspace(-4,4,100,endpoint=True)
plt.plot(X1,(X1**2)/9)

7 0
【CheatSheets】AI速查表集合 一图胜千言
【CheatSheets】AI速查表集合 一图胜千言
6 0

4 0

7 0

4 0

4 0
python自动化办公之使用xlrd读取excel文件
python自动化办公之使用xlrd读取excel文件
5 0
Python教学资源整理
Python教学资源整理
5 0

4 0
Travis CI简介

8 0
+关注

201

0

OceanBase 入门到实战教程