SharedVector Fields.ipynbOpen in CoCalc

import numpy as np
import matplotlib.pyplot as plt
Y, X = np.mgrid[-10:10:100j, -10:10:100j]

###Field equation###
Fx = X**4-3*Y**2 #i component of field equation
Fy = Y**4+X #j component of field equation
##e.g. if your field equation is F = yi+xj, set Fx=Y and Fy=X


plt.figure(figsize=(10,10))
plt.streamplot(X, Y, Fx, Fy, density=10) #Change density for more or fewer field lines plotted
plt.xlabel('X', fontsize=18)
plt.ylabel('Y', fontsize=18)
plt.tick_params(labelsize=20)
plt.show()