当前位置:网站首页>Matplotlib axvline() and axhline() functions in Matplotlib
Matplotlib axvline() and axhline() functions in Matplotlib
2022-06-25 08:58:00 【Guoqingru】
matplotlib matplotlib in axvline() and axhline() function
# -*- encoding: utf-8 -*-
# @File : axhline.py
# @Author: Mr. Luo
# @Date: 2021/11/6 13:40
'''
feature: Draw parallel to x Horizontal reference line of axis
'''
import matplotlib.pyplot as plt
import numpy as np
'''
y: The starting point of the horizontal reference line
c: Reference line color
ls: Reference line style
lw: Reference line width
Translational : The function function above , Call signature and parameter description can also be translated to function axvline() On
'''
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()

边栏推荐
- 备战2022年金九银十必问的1000道Android面试题及答案整理,彻底解决面试的烦恼
- 《乔布斯传》英文原著重点词汇笔记(一)【 Introduction 】
- In Section 5 of bramble pie project practice, Nokia 5110 LCD is used to display Hello World
- 从别人库里拷贝的游戏如何再自己的库里显示
- atguigu----17-生命周期
- nodejs 使用Express框架demo
- 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
- 《乔布斯传》英文原著重点词汇笔记(二)【 chapter one】
- City Chain technology platform, really Realizing value Internet reconstruction!
- 3、 Automatically terminate training
猜你喜欢

How to become a software testing expert? From 3K to 17k a month, what have I done?

Easyplayer streaming media player plays HLS video. Technical optimization of slow starting speed

JMeter interface test, associated interface implementation steps (token)

matplotlib 简单逻辑回归可视化

【OpenCV】—输入输出XML和YAML文件

Nodejs using the express framework demo

行业春寒回暖,持续承压的酒店企业于何处破局?

C#启动程序传递参数丢失双引号,如何解决?

C # startup program loses double quotation marks for parameters passed. How to solve it?

Prepare for the 1000 Android interview questions and answers that golden nine silver ten must ask in 2022, and completely solve the interview problems
随机推荐
Easyplayer streaming media player plays HLS video. Technical optimization of slow starting speed
声纹技术(六):声纹技术的其他应用
Notes on key words in the original English work biography of jobs (IV) [chapter two]
2、 Training fashion_ MNIST dataset
[reinforcement learning notes] common symbols in reinforcement learning
wav文件(波形文件)格式分析与详解
C language: bubble sort
About i/o -- the relationship between memory and CPU and disk
Hyper-v:hyper-v generation 1 or generation 2 virtual machines
Jmeter中的断言使用讲解
【OpenCV】—输入输出XML和YAML文件
Unknown table 'column of MySQL_ STATISTICS‘ in information_ schema (1109)
UEFI: repair efi/gpt bootloader
How annotation lib and processor lib reference
View all listening events on the current page by browser
cazy长安战役八卦迷宫
对常用I/O模型进行比较说明
Nodejs using the express framework demo
Wechat applet_ 7. Project practice, local life
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