次のように、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
関連記事
2次関数のグラフを表示するには次のようにする。 例 import matplotlib.pyplot as plt import numpy as np # numpy linspace 等間隔な数列 …
python3 で csv ファイルを読み込んで、最初の数行を表示する方法
以下の例では、空の配列 data を用意しておき、最初の3行を読み込んでおく。 例 import csv with open(‘data.csv’,’r’) as csv_file: csv_read …
2023/01/18
matplotlib のグラフ作成と gnuplot との対応 比較
2022/10/14
pythonで配列(リスト)の、ある要素がわかっているときにその次の要素を取得する方法。