線圖#

建立基本線圖。

import matplotlib.pyplot as plt
import numpy as np

# Data for plotting
t = np.arange(0.0, 2.0, 0.01)
s = 1 + np.sin(2 * np.pi * t)

fig, ax = plt.subplots()
ax.plot(t, s)

ax.set(xlabel='time (s)', ylabel='voltage (mV)',
       title='About as simple as it gets, folks')
ax.grid()

fig.savefig("test.png")
plt.show()
About as simple as it gets, folks

參考

本範例顯示了以下函式、方法、類別和模組的使用方式

標籤:繪圖風格:線 等級:初學者

腳本總執行時間:(0 分鐘 1.084 秒)

由 Sphinx-Gallery 產生之圖庫