次のように、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
関連記事
plot.subplots() でグラフの縦方向と横方向の数を指定する。 例 import numpy as np from matplotlib import pyplot as plt x1 = …
readline を使って次のように書く。 例 ファイル:data.txt # id name age 1 佐藤太郎 10 2 鈴木花子 18 3 坂本明美 21 4 松村光子 24 5 小川奏子 1 …
set size square または、その省略形で set size sq というコマンドを使えば正方形の中にグラフを描くことができる。 例 set size square plot cos(x) …
pythonで配列(リスト)の、ある要素がわかっているときにその次の要素を取得する方法。
リストを iter に変えたあと、… next() を使う。 参考リンク https://www.programiz.com/python-programming/methods/buil …
2023/01/18
matplotlib のグラフ作成と gnuplot との対応 比較
2022/10/14
pythonで配列(リスト)の、ある要素がわかっているときにその次の要素を取得する方法。