import topotoolbox
import matplotlib.pyplot as plt
dem = topotoolbox.load_dem('perfectworld')
fd = topotoolbox.FlowObject(dem)
basins = fd.drainagebasins()
_= basins.shufflelabel().plot(cmap="Pastel1",interpolation="nearest")
plt.show()
