Displaying 1 result from an estimated 1 matches for "tanalpha".
Did you mean:
sayalpha
2012 Jul 05
2
function curve() swap axes
Dear all,
I'm using the curve() function to plot discharge Q against water depth a.
However, I would like to have a graph of water depth a plotted against
discharge Q. How can this be done?
Minimal working example:
S0 = 0.004
n = 0.04
tanalpha = 1.4/1.5
par(mar = c(5,5,1,1)) # b, l, t, r
curve((sqrt(S0)/n)*(0.035+(0.7+(x-0.1)/tanalpha)*(x-0.1))*((0.035+(0.7+(x-0.1)/tanalpha)*(x-0.1))/(2*sqrt((0.7/2)^2+0.1^2)+2*sqrt((x-0.1)^2+((x-0.1)/tanalpha)^2)))^(2/3),0.1,1.55,
lwd = 3, col = "royalblue4", ann = F, axes = T)
title(xlab = par...