// If we"re given a vector, interpret as a matrix
if data.ndim == 1:
data = data.reshape((1, -1))
t = data.shape[1]
kwargs.setdefault("mode", "constant")
After Change
>>> plt.tight_layout()
data = np.atleast_2d(data)
t = data.shape[1]
kwargs.setdefault("mode", "constant")