deepreasoning icon indicating copy to clipboard operation
deepreasoning copied to clipboard

plot

Open alhassanmich opened this issue 1 year ago • 1 comments

import pandas as pd import matplotlib.pyplot as plt

--------------------------------------------------

Station 3 – microfossil abundance by depth

--------------------------------------------------

records = [ # depth, forams, ostracods, gastropods, others (0, 82, 0, 0, 0), # Surface Grab total (1, 1264.5, 27.5, 13, 667),# DIRI total (2, 267, 2, 0, 0), # D1R2 total (3, 558.5, 5.5, 0, 142), # D2R1 total (4, 825, 2.5, 5, 412), # D2R2 total (5, 568.5, 15.5, 0, 0), # D3R2 total (6, 122, 0, 0, 0), # D3R3 total (7, 25, 0, 0, 0), # D4 total (8, 0, 0, 0, 0), # D6 total (9, 20, 0, 0, 0), # D7 total (10, 23, 4, 0, 0) # D8 total ]

df = pd.DataFrame(records, columns=["depth_cm", "Foraminifera", "Ostracods", "Gastropods", "Others"])

Plot

plt.figure(figsize=(6, 4)) for col in ["Foraminifera", "Ostracods", "Gastropods", "Others"]: plt.plot(df["depth_cm"], df[col], marker="o", label=col)

plt.gca().invert_yaxis() plt.xlabel("Depth (cm)") plt.ylabel("Abundance (count)") plt.title("Microfossil abundance trend – Station 3") plt.legend() plt.tight_layout() plt.show()

alhassanmich avatar Aug 05 '25 21:08 alhassanmich