Matplotlib可视化(十八)-- 注释

#!usr/bin/env python
# -*- coding:utf-8 _*-
"""
@author: Caramel
@file: 2.1.py
@time: 2020/03/04
@desc:注释
"""
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(-10, 11)
y = x**2
plt.plot(x, y)
plt.annotate('this is bottom', xy=(0,1), xytext=(0,20), arrowprops=dict(facecolor='r', headwidth=20, width= 15))
#参数含义 分别是文字,箭头起始点,文字起始点,箭头设置(箭头的颜色, 头宽, 身体宽)
plt.show()

猜你喜欢

转载自blog.csdn.net/qq_42007339/article/details/104667408
今日推荐