当前位置:网站首页>matplotlib绘制sin函数图像
matplotlib绘制sin函数图像
2022-07-21 10:12:00 【学习中~~~】
import matplotlib.pyplot as plt
import numpy as np
# 目标:绘制sin函数图像
# 第一步:绘制x轴的刻度
x = np.linspace(0, np.pi * 2, 300) # linspace等差数列函数,x跨度从0到2pi,有300ge点连成线组成
# 第二步:绘制y轴
y = np.sin(x) # y是x的sin函数
# 第三步:添加必要说明
plt.xlabel("angle") # x轴为角度数
plt.ylabel("y_value") # sin值大小
plt.title("sin_image")
# 生成图像
plt.plot(x, y)
plt.show()
边栏推荐
猜你喜欢
通过ATL库CRegKey读注册表(简单方便)
SVD singular value decomposition matrix compression
VLAN and layer 3 switch
力扣 1260. 二维网格迁移
FastDFS高可用使用介绍
Airbnb 如何实现 Kubernetes 集群动态扩展
Grafana visual configuration chart table
我,AI博士生,在线众筹研究主题
bootloader系列三——核心初始化
This price is fragrant enough! Lingyao 142022 shadow cyan glaze spike: 12th generation core +2.8k OLED screen
随机推荐
Network security (4)
博士申请 | 香港城市大学刘晨老师组招收机器学习方向全奖博士/博后/硕士/RA...
Grafana visual configuration chart table
【微信小程序】camera系统相机(79/100)
复旦大学白悦辰课题组诚聘博士后、科研助理
Quartz simple usage and its es job
Unity2D~对周目解密小游戏练习(三天完成)
70. 爬楼梯:假设你正在爬楼梯。需要 n 阶你才能到达楼顶。 每次你可以爬 1 或 2 个台阶。你有多少种不同的方法可以爬到楼顶呢?
three hundred and thirteen billion one hundred and thirty-one million three hundred and thirteen thousand one hundred and twenty-three
bootloader系列二——arm920t--bootloader架构设计
Codeforces Round #578 (Div. 2) B - Block Adventure 【贪心】
leetcode:169. 多数元素
代码表征预训练语言模型学习指南:原理、分析和代码
Why can redis single thread be so fast
Un7.20: how to display two attributes in an association table at the same time?
Chapter 2 software process and thought section 1 Foundation
Leetcode 104. 二叉树的最大深度
bootloader系列一——Arm处理器启动流程解析
Network layer protocol introduction
871. 约数之和