Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
1.3 kB
2
Indexable
Never
import matplotlib.pyplot as plt

# Data
labels = ['White; Black or African American', 
          'White; American Indian and Alaska Native', 
          'White; Asian', 
          'White; Native Hawaiian and Other Pacific Islander', 
          'White; Some Other Race', 
          'Black or African American; American Indian and Alaska Native', 
          'Black or African American; Asian', 
          'Black or African American; Native Hawaiian and Other Pacific Islander', 
          'Black or African American; Some Other Race', 
          'American Indian and Alaska Native; Asian', 
          'American Indian and Alaska Native; Native Hawaiian and Other Pacific Islander', 
          'American Indian and Alaska Native; Some Other Race', 
          'Asian; Native Hawaiian and Other Pacific Islander', 
          'Asian; Some Other Race', 
          'Native Hawaiian and Other Pacific Islander; Some Other Race']

sizes = [8086, 6035, 4824, 244, 24553, 1209, 289, 70, 768, 77, 8, 648, 189, 169, 15]

# Create a pie chart
plt.figure(figsize=(10, 8))
plt.pie(sizes, labels=labels, autopct='%1.1f%%', startangle=140)
plt.axis('equal')  # Equal aspect ratio ensures that pie is drawn as a circle.
plt.title('Population by Race in Douglas County')
plt.show()
Leave a Comment