pyplot grid で縦横線(罫線のようなもの)を引くことができる。
例
from matplotlib import pyplot as plt
data_x = [25,26,27]
data_y = [39,41,50]
data_y2 = [40,20,17]
plt.plot(data_x,data_y)
plt.plot(data_x,data_y2)
plt.grid(True)
plt.show()
結果

雑記
投稿日:2021年6月11日 更新日:
pyplot grid で縦横線(罫線のようなもの)を引くことができる。
from matplotlib import pyplot as plt
data_x = [25,26,27]
data_y = [39,41,50]
data_y2 = [40,20,17]
plt.plot(data_x,data_y)
plt.plot(data_x,data_y2)
plt.grid(True)
plt.show()

執筆者:seyanen
関連記事
C言語で scanf のようなものを作るには、python では input() で実現できる。 例 print(‘xの値を入力してください’) x = input() print(‘xの値は ‘ + …
matplotlib でグラフ表示ウィンドウの画面上の位置を自由に設定する方法
matplotlib.use(‘TkAgg’) としておき、 get_current_fig_manager().window.wm_geometry(“+20+50”) として、(+20+50)のと …
2023/01/18
matplotlib のグラフ作成と gnuplot との対応 比較
2022/10/14
pythonで配列(リスト)の、ある要素がわかっているときにその次の要素を取得する方法。