当前位置:网站首页>matplotlib matplotlib中axvline()和axhline()函数
matplotlib matplotlib中axvline()和axhline()函数
2022-06-25 08:16:00 【郭庆汝】
matplotlib matplotlib中axvline()和axhline()函数
# -*- encoding: utf-8 -*-
# @File : axhline.py
# @Author: Mr. Luo
# @Date: 2021/11/6 13:40
'''
feature:绘制平行于x轴的水平参考线
'''
import matplotlib.pyplot as plt
import numpy as np
'''
y:水平参考线的出发点
c:参考线条颜色
ls:参考线条风格
lw:参考线条宽度
平移性:上面的函数功能,调用签名和参数说明同样可以平移到函数axvline()上
'''
x = np.linspace(0.2, 10, 1000)
y = np.sin(x)
plt.plot(x, y, ls="-.", c='b', label="figure")
plt.legend()
plt.axhline(y=0.0, c="g", ls="--", lw=2)
plt.axvline(x=4.0, c="r", ls="--", lw=2)
plt.show()
边栏推荐
- C#启动程序传递参数丢失双引号,如何解决?
- How to design test cases
- 对常用I/O模型进行比较说明
- 备战2022年金九银十必问的1000道Android面试题及答案整理,彻底解决面试的烦恼
- Is it safe to buy stocks and open accounts through the account QR code of the account manager? Want to open an account for stock trading
- UEFI:修复 EFI/GPT Bootloader
- Object. Can defineproperty also listen for array changes?
- mysql之Unknown table ‘COLUMN_STATISTICS‘ in information_schema (1109)
- 2021 "Ai China" selection
- 获取扫码的客户端是微信还是支付宝
猜你喜欢
随机推荐
atguigu----17-生命周期
十大券商开户风险大吗,安全靠谱吗?
IC研发常用英文术语缩写
《乔布斯传》英文原著重点词汇笔记(二)【 chapter one】
flutter 多语言的intl: ^0.17.0导不进去
SharePoint:SharePoint Server 2013 与 ADRMS 集成指南
Is it safe to open a stock account online now?
Summary of hardfault problem in RTOS multithreading
TrendMicro:Apex One Server 工具文件夹
Sharepoint:sharepoint server 2013 and adrms Integration Guide
Jmeter中的断言使用讲解
Is it safe to open an account at Huatai Securities?
Hyper-v:Hyper-v 第 1 代或第 2 代虚拟机
Swiperefreshlayout+recyclerview failed to pull down troubleshooting
¥3000 | 录「TBtools」视频,交个朋友&拿现金奖!
【MYSQL】索引的理解和使用
View all listening events on the current page by browser
Notes on key words in the original English work biography of jobs (IV) [chapter two]
WebGL发布之后不可以输入中文解决方案
How annotation lib and processor lib reference