Untitled

 avatar
unknown
plain_text
5 months ago
904 B
2
Indexable
import pandas as pd
import matplotlib.pyplot as plt

# Load the Excel file and sheet
file_path = 'your_excel_file.xlsx'  # Replace with the actual file path
sheet_name = 'SIMPSON CLASSIFICATION'

# Read the Excel file
df = pd.read_excel(file_path, sheet_name=sheet_name)

# Extract the necessary columns
sample_ids = df['Sample ID']
cl_values = df['Cl-']
hco3_values = df['HCO3-']

# Plotting the Simpson Classification chart
plt.figure(figsize=(10, 6))

# Create scatter plot
plt.scatter(cl_values, hco3_values, color='b', label='Samples')

# Label the plot
plt.title('Simpson Classification Chart')
plt.xlabel('Cl- Concentration (mg/L)')
plt.ylabel('HCO3- Concentration (mg/L)')

# Annotating the Sample IDs on the plot
for i, sample_id in enumerate(sample_ids):
    plt.annotate(sample_id, (cl_values[i], hco3_values[i]))

# Add grid and legend
plt.grid(True)
plt.legend()

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