Last active
August 1, 2020 07:32
-
-
Save yatakeke/0686561473a4720fb982410287268bb5 to your computer and use it in GitHub Desktop.
matplotlib pie chart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
plt.pie(fraction, startangle, wedgeprops, autopct, explode, **) | |
# example: plt.pie(frac, startangle=90, wedgeprops={'linewidth': 3, 'edgecolor':"white"}, autopct="%1.1f%%", explode=[0.2, 0, 0, 0, 0] | |
# fraction: total of fraction should be 1 | |
# startangle: startangle | |
# wedgeprops: edge props | |
# autopct: show percentage | |
# explode: array for explode | |
plt.legend(labels, bbox_to_anchor, loc) | |
# labels: labels of fraction | |
# bbox_to_anchor: relative position to whole of figure | |
## range => (0, 0) ~ (1, 1) | |
# loc: which part of box is set up anchor | |
## ボックスのどの部分をアンカーに合わせるか |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment