当前位置:   article > 正文

python使用matplotlib可视化线图(line plot)、自定义可视化图像的背景色(change the background color of a plot in matplotlib)_background of matplotlib

background of matplotlib

python使用matplotlib可视化线图(line plot)、自定义可视化图像的背景色(change the background color of a plot in matplotlib)

目录

python使用matplotlib可视化线图(line plot)、自定义可视化图像的背景色(change the background color of a plot in matplotlib)

#仿真数据

#python使用matplotlib可视化线图(line plot)、自定义可视化图像的背景色(change the background color of a plot in matplotlib)


pip install matplotlib

# 1、安装包
$ pip install matplotlib

# 2、进入python的交互式界面
$ python -i

# 3、使用 matplotlib 的 scatter 方法绘制散点图
>>> import matplotlib.pyplot as plt
>>> x = [1, 2, 3, 4, 5]
>>> y = [2.3, 3.4, 1.2, 6.6, 7.0]
>>> plt.scatter(x, y, color='r', marker='+')

# 4、输出结果
# 你的电脑随后会弹出一个最终图表效果的窗口。

Matplotlib 是 Python 的绘图库,它能让使用者很轻松地将数据图形化,并且提供多样化的输出格式。

Matplotl

本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/964988
推荐阅读
相关标签
  

闽ICP备14008679号