In [1]:
import numpy as np
import matplotlib.pyplot as plt



pot = lambda x: -1/np.sqrt(x**2+1)
a = 6.9314718055994524e-7
b = 0.0069314718056
w = 0.08607963870836033
k = w/137
A = 1.2
t0 = 2500
dist = lambda x,t:  np.exp(-a*(t-t0)**2)*np.exp(-b*x**2)*A*np.sin(w*t-k*x)
n = 10000
x = np.linspace(-30,30, n)
t = np.linspace(1400,1500, n)

toplot = np.zeros((n, n))
for i in range(0, n):
    toplot[:,i] = dist(x,t[i]) + pot(x)
print("Values generated!")
plt.imshow(toplot,cmap="viridis_r",extent=[t[0],t[-1],x[0],x[-1]],aspect='auto',interpolation='nearest')
print("Imshow Done!")
c = plt.colorbar()
c.set_label(r"$V_{Eff} \; (a.u.)$",size=40)
print("Colorbar Done!")

plt.xlabel(r"$t  \ (a.u.)$",size=35)
plt.ylabel(r"$x \ (a.u.)$",size=35)
plt.xticks(fontsize=30)
plt.yticks(fontsize=30)
plt.show()


Values generated!
Imshow Done!
Colorbar Done!

In [ ]: