import matplotlib.pyplot as plt #Data Source: https://www.gov.za/about-sa/people-south-africa # Data labels = ["Good/Very Good/Excellent Health", "Less than Good Health"] sizes = [94, 6] colors = ["#D44803", "#999999"] # main colour + grey for contrast # --- Pie Chart --- fig, ax = plt.subplots(figsize=(6, 6)) wedges, texts, autotexts = ax.pie( sizes, labels=labels, colors=colors, autopct="%1.1f%%", # show percentages startangle=90, textprops={"color": "Black"} ) ax.set_title("Pie Chart with PikBioStat: South African Self-Reported Health Status", fontsize=14) plt.show() # --- Donut Chart --- fig, ax = plt.subplots(figsize=(6, 6)) wedges, texts, autotexts = ax.pie( sizes, labels=labels, colors=colors, autopct="%1.1f%%", startangle=90, textprops={"color": "black"}, wedgeprops=dict(width=0.4), labeldistance=1.2, # move labels further out pctdistance=0.8 ) ax.set_title("Donut Chart with PikBioStat: South African Self-Reported Health Status", fontsize=14) plt.show()