python 画出函数图像

sinx

python 复制代码
from matplotlib import pyplot as plt
import numpy as np
import math
x=list(np.arange(-math.pi, math.pi,0.1))#此处可调整自变量取值范围,以便选择合适的观察尺度
y=[]
for i in range(len(x)):
    y.append(math.sin(x[i]))
plt.plot(x,y)
plt.show()

arcsinx

python 复制代码
from matplotlib import pyplot as plt
import numpy as np
import math
x=list(np.arange(-1, 1,0.001))#此处可调整自变量取值范围,以便选择合适的观察尺度
y=[]
for i in range(len(x)):
    y.append(math.asin(x[i]))
plt.plot(x,y)
plt.show()

e^x

python 复制代码
from matplotlib import pyplot as plt
import numpy as np
import math
x=list(np.arange(-1, 50,1))#此处可调整自变量取值范围,以便选择合适的观察尺度
y=[]
for i in range(len(x)):
    y.append(math.exp(x[i]))
plt.plot(x,y)
plt.show()
相关推荐
铅笔侠_小龙虾11 小时前
Rust 学习(4)-函数与注释
开发语言·学习·rust
tiana_11 小时前
写了个零依赖的 Go 版本管理器,curl | bash 完事
开发语言·golang·bash
嘘嘘出差11 小时前
Python 爬虫入门实战:爬取豆瓣电影 Top 250
开发语言·爬虫·python
爱写代码的倒霉蛋11 小时前
实现协程的三种方式
开发语言·python
崖边看雾12 小时前
记录Python学习——第一章环境安装下载(Windows)
windows·python·学习·pycharm
CS创新实验室12 小时前
NumPy数组的C风格和Fortran风格
c语言·开发语言·numpy
用户2986985301412 小时前
Python 实现 Excel 到 ODS、XPS、PostScript 及 PDF/A-1b 的格式转换
后端·python·excel
本地化文档12 小时前
xlwings-docs-l10n
python·github·excel·gitcode·sphinx
逝水无殇13 小时前
C# 正则表达式详解
开发语言·后端·正则表达式·c#
朱永博13 小时前
使用Onnruntime实现Padim/Patchcore推理
开发语言·c#