3D Quiver

Linear Shear Flow Profile

Linear shear flow where velocity magnitude increases linearly with height.

Output
Linear Shear Flow Profile
Python
import matplotlib.pyplot as plt
import numpy as np

# Linear shear flow
n = 6
x = np.linspace(-2, 2, n)
y = np.linspace(-2, 2, n)
z = np.linspace(-2, 2, n)
X, Y, Z = np.meshgrid(x, y, z)

# Shear: velocity increases with z
U = 0.5 * Z
V = np.zeros_like(X)
W = np.zeros_like(X)

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

ax.quiver(X, Y, Z, U, V, W, length=0.4, normalize=False,
          color='#f97316', alpha=0.85, arrow_length_ratio=0.3)

ax.set_xlim(-3, 3)
ax.set_ylim(-2.5, 2.5)
ax.set_zlim(-2.5, 2.5)

ax.set_xlabel('X (flow)', color='white', fontsize=10)
ax.set_ylabel('Y', color='white', fontsize=10)
ax.set_zlabel('Z (height)', color='white', fontsize=10)
ax.set_title('Linear Shear Flow Profile', 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.view_init(elev=15, azim=30)
plt.tight_layout()
plt.show()
Library

Matplotlib

Category

3D Charts

Did this help you?

Support PyLucid to keep it free & growing

Support