Here write only the samples and easy descriptions. See official document for the detailed specification of the module.
モジュールの詳しい仕様は公式ドキュメントを見てもらうとして,ここではサンプルと簡単な説明だけ書いておく.
Official document 公式ドキュメント:
+
matplotlib.pyplot.fill — Matplotlib 3.3.1 documentation
Input coordinates of the polygon (closed 2D shape) in the order of horizontal axis, vertical axis.
Polygon must fill the following conditions.
(1)
xs[0] == xs[-1] and ys[0] == ys[-1]
(2)
Lines not cross each other.
ポリゴン(閉じた平面図形)の座標を横軸,縦軸の順に与える.
ポリゴンは下記条件を満たしている必要がある.
(1) xs[0] == xs[-1] かつ ys[0] == ys[-1]
(2) 線が互いに交差しない
The code below is from:
+
python - plot a donut with fill or fill_between use pyplot in matplotlib - Stack Overflow
(modified little a bit).
However, this is not enough. When color was not specified, the output is as follows.
The point at the end of the first shape (outer circle) and the point at the beggining of the second shape (inner circle) are connected. You may insert nan between them to avoid this as follows.
最初の図形(外側の円)の最後の点と二つ目の図形(内側の円)の最初の点が結ばれている.これを避けるには,次のように
nanを挟むのが良い.