g.region -p -a raster=elevation r.watershed elevation=elevation threshold=10000 drainage=direction stream=streams r.stream.order streams=streams direction=direction hack=hack r.stream.channel streams=hack direction=direction elevation=elevation \ identifier=stream_identifier distance=stream_distance gradient=stream_gradient # Eg., 495 is a stream identifier. May be different in different situation r.mapcalc "stgrad = if(stream_identifier==495,float(stream_gradient),null())" r.mapcalc "stdist = if(stream_identifier==495,float(stream_distance),null())" # Use R for plotting R library(spgrass6) r=readRAST6(c("stdist","stgrad"),NODATA=-9999) p=subset(r@data,!is.na(r@data$dist)) sorted=p[order(p$stdist),] plot(sorted,stdist~stgrad,type="l")
Last changed: $Date$