次のように、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
関連記事
matplotlib で折れ線グラフの下部に色をつけて塗りつぶす方法
pyplot の fill_between を使う。 例 from matplotlib import pyplot as plt data_x = [25,26,27] data_y = & …
pyplot.errorbar を使って設定する。 オプションの詳細は https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.erro …
annotate を使う 例 import numpy as np import matplotlib.pyplot as plt ax = plt.figure().add_subplot() th …
2023/01/18
matplotlib のグラフ作成と gnuplot との対応 比較
2022/10/14
pythonで配列(リスト)の、ある要素がわかっているときにその次の要素を取得する方法。