3D Line

Chaotic Butterfly Curve

A chaotic butterfly-like parametric curve inspired by strange attractors, with cool color gradient.

Output
Chaotic Butterfly Curve
Python
import matplotlib.pyplot as plt
import numpy as np

# Simplified chaotic-like curve (not true Lorenz, but similar visual)
n = 2000
t = np.linspace(0, 50, n)

# Chaotic-inspired parametric
x = np.sin(t) * (np.exp(np.cos(t)) - 2 * np.cos(4 * t) - np.sin(t/12)**5)
y = np.cos(t) * (np.exp(np.cos(t)) - 2 * np.cos(4 * t) - np.sin(t/12)**5)
z = np.sin(t) * np.cos(t) * 2

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

# Rainbow neon effect
colors = np.linspace(0, 1, n)
for i in range(n-1):
    c = colors[i]
    color = plt.cm.cool(c)
    ax.plot(x[i:i+2], y[i:i+2], z[i:i+2], color=color, linewidth=1.2)

ax.set_xlabel('X', color='white', fontsize=10)
ax.set_ylabel('Y', color='white', fontsize=10)
ax.set_zlabel('Z', color='white', fontsize=10)
ax.set_title('Chaotic Butterfly Curve', color='white', fontsize=14, fontweight='bold', pad=20)

ax.tick_params(colors='#64748b', labelsize=8)
ax.xaxis.pane.fill = False
ax.yaxis.pane.fill = False
ax.zaxis.pane.fill = False
ax.xaxis.pane.set_edgecolor('#1e293b')
ax.yaxis.pane.set_edgecolor('#1e293b')
ax.zaxis.pane.set_edgecolor('#1e293b')
ax.grid(True, alpha=0.2, color='#334155')

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

Matplotlib

Category

3D Charts

Did this help you?

Support PyLucid to keep it free & growing

Support