import topotoolbox
import numpy as np
import matplotlib.pyplot as plt
dem = topotoolbox.load_dem('bigtujunga')
fd = topotoolbox.FlowObject(dem)
s = topotoolbox.StreamObject(fd)
s = s.klargestconncomps(1)
z = topotoolbox.imposemin(s, dem)
kn = np.zeros(len(z), dtype=bool)
ze = s.lowerenv(z, kn)
fig,ax = plt.subplots()
_= s.plotdz(dem, ax=ax, color='gray')
_= s.plotdz(ze, ax=ax, color='black')
ax.autoscale_view()
plt.show()
