Untitled
unknown
plain_text
a year ago
740 B
6
Indexable
# Re-creating a simple 2D bar graph using matplotlib as requested.
# Data for the population of barangays in the Philippines
barangay_names = ["Barangay 176", "Commonwealth", "Batasan Hills", "Other Barangays"]
barangay_populations = [247000, 198295, 161409, 12 * 100000] # Assumed 12 barangays with >100k population
# Plotting a 2D bar graph
plt.figure(figsize=(8, 6))
plt.bar(barangay_names, barangay_populations, color="skyblue")
plt.xlabel("Barangay")
plt.ylabel("Population (Thousands)")
plt.title("Population Size of Barangays in the Philippines")
plt.tight_layout()
# Saving the 2D bar graph as a file
output_path = "/mnt/data/barangay_population_2D.png"
plt.savefig(output_path)
plt.close()
output_pa
thEditor is loading...
Leave a Comment