plt.xlabel と plt.ylabel を使う。
例
import numpy as np import matplotlib.pyplot as plt x = np.linspace(0, 2, 100) plt.plot(x, x, label='linear') plt.xlabel('x axis') plt.ylabel('y axis') plt.title("title") plt.show()
結果

雑記
投稿日:
plt.xlabel と plt.ylabel を使う。
import numpy as np import matplotlib.pyplot as plt x = np.linspace(0, 2, 100) plt.plot(x, x, label='linear') plt.xlabel('x axis') plt.ylabel('y axis') plt.title("title") plt.show()
執筆者:seyanen
関連記事
list をrange を指定して初期化すれば良い。数を1つ飛ばしのリストも次のようにして作れる。 例 list1 = list(range(1,10,2)) print(list1) 結果 [1, …
大括弧を表示するには、\left[ または \right] を使う。 例 $\left[ \left( \frac{x}{y} \right) \right]$ 結果 片方だけの大括弧 片方だけのカッ …
python3 でリストから重複を削除したリストを作成する方法
いったん dictionary に変換してから、新しいリストを作成する。すると、重複を除いたリストが作れる。 例 list1 = [‘1′,’2′,’3′,’1′,’2′,’5’] dict1 = d …
2023/01/18
matplotlib のグラフ作成と gnuplot との対応 比較
2022/10/14
pythonで配列(リスト)の、ある要素がわかっているときにその次の要素を取得する方法。