lw で、線幅を数字で指定すればよい。
例
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,c='green',lw = '3')
plt.plot(data_x,data_y2,c='blue',lw = '5')
plt.show()
結果

雑記
投稿日:
lw で、線幅を数字で指定すればよい。
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,c='green',lw = '3')
plt.plot(data_x,data_y2,c='blue',lw = '5')
plt.show()

執筆者:seyanen
関連記事
python3 でグローバル変数とローカル変数で同じ名前の変数を使う
グローバル変数とローカル変数で同じ名前の変数を使うことができる。 例 x = 10 def myfunc(): x = 20 print(‘関数内: x = ‘+str(x)) myfunc() pr …
C言語で scanf のようなものを作るには、python では input() で実現できる。 例 print(‘xの値を入力してください’) x = input() print(‘xの値は ‘ + …
python3 で辞書(dictionary)の一部を del で削除する
辞書の一部を削除するには、del で消去したいキーを指定する。 例 dict1 = {“名前”:”太郎”, “年齢”: 20, “住所”: “東京都千代田区大手町1-1”} print(dict1) …
python の __str__ と __repr__ とは
python でクラスの情報を文字列で表示するとき、__str__ メソッドと __repr__ メソッドが使える。__str__ は、プログラマーとは限らないユーザーに「読める形で情報を表示」するこ …
matplotlib で、グラフのタイトルに上付き文字を入力する方法
数学記号などで、グラフのタイトルに上付きの文字を入力したい場合がある。 その場合は次のように書いて設定できる。 例 import numpy as np from matplotlib import …
2023/01/18
matplotlib のグラフ作成と gnuplot との対応 比較
2022/10/14
pythonで配列(リスト)の、ある要素がわかっているときにその次の要素を取得する方法。