set_mpl_interactive()
s = np.shape(data)
if source is not None and hasattr(source, "bands"):
xvals = source.bands.centers
else:
xvals = None
if len(s) == 1:
if not xvals:
xvals = list(range(len(data)))
p = plt.plot(xvals, data)
elif len(s) == 2:
if not xvals:
xvals = list(range(s[1]))
p = plt.plot(xvals, data[0, :])
plt.hold(1)
for i in range(1, s[0]):
p = plt.plot(xvals, data[i, :])
spectral._xyplot = p
plt.grid(1)
if source is not None and hasattr(source, "bands"):
if source.bands.band_quantity is not None:
After Change
if source is not None and hasattr(source, "bands"):
xvals = source.bands.centers
else:
xvals = list(range(data.shape[-1]))
if data.ndim == 1:
data = data[np.newaxis, :]
data = data.reshape(-1, data.shape[-1])