import numpy as np
import matplotlib.pyplot as plt

def display_data(x, y, u, t, scheme):
    if scheme == 0:
        title = 'FTCS'
    elif scheme == 1:
        title = 'Lax'
    else:
        title = 'Lax-Wendroff'
    if t == 0.0:
        title += ': Initial conditions'
    else:
        title += ': time = '+'%.2f'%(t)
        plt.cla()
    plt.title(title)
    plt.xlabel('x')
    plt.ylabel('y')
    plt.xlim(x.min(), x.max())
    plt.ylim(y.min(), y.max())
    a = np.zeros(J)
    cax = plt.imshow(np.flip(u, axis=0),
                     extent=(x.min(), x.max(), y.min(), y.max()),
                     vmin=0.0, vmax=1.0)
    if t == 0.0: plt.colorbar(cax)
    plt.pause(0.001)
