注釈
最後まで をクリックすると完全なサンプルコードをダウンロードできます。
A simple pie chart example with matplotlib.
import numpy as np import matplotlib.pyplot as plt n = 20 Z = np.ones(n) Z[-1] *= 2 plt.axes((0.025, 0.025, 0.95, 0.95)) plt.pie(Z, explode=Z * 0.05, colors=[f"{i / float(n):f}" for i in range(n)]) plt.axis("equal") plt.xticks([]) plt.yticks() plt.show()
Total running time of the script: (0 minutes 0.039 seconds)
Gallery generated by Sphinx-Gallery
1.4. Matplotlib: plotting
A simple, good-looking plot