次のように、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
関連記事
os.mkdir() 関数を使う。 すでにフォルダが存在している場合は、エラーを表示する。 例 import os folder_name = ‘./python_create_folder’ try …
pyplot.errorbar を使って設定する。 オプションの詳細は https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.erro …
2次関数のグラフを表示するには次のようにする。 例 import matplotlib.pyplot as plt import numpy as np # numpy linspace 等間隔な数列 …
python3 でグローバル変数とローカル変数で同じ名前の変数を使う
グローバル変数とローカル変数で同じ名前の変数を使うことができる。 例 x = 10 def myfunc(): x = 20 print(‘関数内: x = ‘+str(x)) myfunc() pr …
2023/01/18
matplotlib のグラフ作成と gnuplot との対応 比較
2022/10/14
pythonで配列(リスト)の、ある要素がわかっているときにその次の要素を取得する方法。