Untitled

Anonymous
Plain Text
09/24/2025 2:57 PM
645 B
16
Indexable
Never
import matplotlib.pyplot as plt

# Data from the table
phenotypes = [
    "Ebony body\nand long wings",
    "Ebony body\nand vestigial wings",
    "Gray body\nand long wings",
    "Gray body\nand vestigial wings"
]
fly_counts = [98, 28, 293, 81]
errors = [10, 7, 25, 10]

# Plotting the bar graph
plt.figure(figsize=(10, 6))
bars = plt.bar(phenotypes, fly_counts, yerr=errors, capsize=10, color=['#6C5B7B', '#355C7D', '#F67280', '#C06C84'])

# Adding labels and title
plt.ylabel("Number of Flies")
plt.title("Phenotypic Distribution of F₂ Flies")
plt.grid(axis='y', linestyle='--', alpha=0.7)

# Display the plot
plt.tight_layout()
plt.show()
Editor is loading...
Leave a Comment