次のように、axes で facecolor を変更すればよい。
例
from matplotlib import pyplot as plt
x = [2,7,8]
y = [7,1.2,3]
fig, ax = plt.subplots()
size = 300
ax.scatter(x,y,size)
ax.set_xlim([0,10])
ax.set_ylim([0,10])
ax.set_facecolor('silver')
plt.show()
結果

雑記
投稿日:
次のように、axes で facecolor を変更すればよい。
from matplotlib import pyplot as plt
x = [2,7,8]
y = [7,1.2,3]
fig, ax = plt.subplots()
size = 300
ax.scatter(x,y,size)
ax.set_xlim([0,10])
ax.set_ylim([0,10])
ax.set_facecolor('silver')
plt.show()
執筆者:seyanen
関連記事
ヒストグラムを描くには、data_hist を使う。 ヒストグラムの縦棒の数は bins で指定する。 例 from matplotlib import pyplot as plt data_hist …
matplotlib で csv ファイルからデータを読み込んでグラフを表示する方法
np loadtext で csv ファイルを読み込む。 pyplot.bar で棒グラフを表示する。 例 import numpy as np from matplotlib import pypl …
python3 で辞書(dictionary)の一部を del で削除する
辞書の一部を削除するには、del で消去したいキーを指定する。 例 dict1 = {“名前”:”太郎”, “年齢”: 20, “住所”: “東京都千代田区大手町1-1”} print(dict1) …
2023/01/18
matplotlib のグラフ作成と gnuplot との対応 比較
2022/10/14
pythonで配列(リスト)の、ある要素がわかっているときにその次の要素を取得する方法。