美文网首页
Matplotlib: 折线图

Matplotlib: 折线图

作者: LET149 | 来源:发表于2023-07-28 09:31 被阅读0次
    1. 模块:matplotlib.pyplot
    1. 方法:plot()

1. 基础绘图

import matplotlib.pyplot as plt
import numpy as np

plt.style.use('_mpl-gallery')

# make data
x = np.linspace(0, 10, 100)
y = 4 + 2 * np.sin(2 * x)

# plot
fig, ax = plt.subplots()

ax.plot(x, y, linewidth=2.0)

ax.set(xlim=(0, 8), xticks=np.arange(1, 8),
       ylim=(0, 8), yticks=np.arange(1, 8))

plt.show()
image.png

2. 参数

.plot(x, y, linewidth=)

linewidth=: 线宽

相关文章

网友评论

      本文标题:Matplotlib: 折线图

      本文链接:https://www.haomeiwen.com/subject/saulpdtx.html