3D Scatter

Li-ion Battery Cell Quality Grading

Battery manufacturing QC showing capacity, voltage, and resistance with quality grades.

Output
Li-ion Battery Cell Quality Grading
Python
import matplotlib.pyplot as plt
import numpy as np

np.random.seed(852)

# Battery cell test data
n_cells = 160

capacity = np.random.normal(3500, 200, n_cells)  # mAh
voltage = np.random.normal(3.7, 0.1, n_cells)  # V
internal_resistance = np.random.exponential(20, n_cells) + 10  # mΩ

# Grade classification
grade_a = (capacity > 3400) & (voltage > 3.65) & (internal_resistance < 35)
grade_b = (capacity > 3200) & ~grade_a
grade_c = ~grade_a & ~grade_b

colors = []
for a, b in zip(grade_a, grade_b):
    if a:
        colors.append('#6CF527')  # Grade A
    elif b:
        colors.append('#F5B027')  # Grade B
    else:
        colors.append('#F5276C')  # Grade C

fig = plt.figure(figsize=(10, 8), facecolor='#ffffff')
ax = fig.add_subplot(111, projection='3d', facecolor='#ffffff')

ax.scatter(capacity, voltage, internal_resistance, c=colors, s=50, 
           alpha=0.7, edgecolors='#374151', linewidths=0.3)

ax.set_xlabel('Capacity (mAh)', color='#1f2937', fontsize=10)
ax.set_ylabel('Voltage (V)', color='#1f2937', fontsize=10)
ax.set_zlabel('Internal Resistance (mΩ)', color='#1f2937', fontsize=10)
ax.set_title('Li-ion Battery Cell Quality Grading', color='#1f2937', fontsize=14, fontweight='bold', pad=20)

ax.tick_params(colors='#6b7280', labelsize=8)
ax.xaxis.pane.fill = False
ax.yaxis.pane.fill = False
ax.zaxis.pane.fill = False
ax.xaxis.pane.set_edgecolor('#e5e7eb')
ax.yaxis.pane.set_edgecolor('#e5e7eb')
ax.zaxis.pane.set_edgecolor('#e5e7eb')

ax.view_init(elev=20, azim=45)
plt.tight_layout()
plt.show()
Library

Matplotlib

Category

3D Charts

Did this help you?

Support PyLucid to keep it free & growing

Support