公開:2025-04-01、更新:2025-04-01
3-10「pip」 6ページ
マンガ

6
コンテンツ紹介
テキスト原稿
# 6p
__1__
猫野:
少しプログラムを
細かく見ていこう
__2__
import matplotlib.pyplot
インポート文の「.」は
ディレクトリーなどの
区切り文字
matplotlibのpyplotを
読み込むという意味
---
__3__
x = [1, 2, 3, 4, 5]
y = [5, 10, 15, 10, 20]
リストという形式で
並べたデータを作り
変数xと変数yに
それぞれ代入
__4__
matplotlib.pyplot.plot(x, y)
matplotlib.pyplot.show()
リストxとyを
プロットして
表示する