Re: [R] function curve() swap axes

2012-07-06 Thread Boudewijn Verkooijen
Thank you guys! The solution turned out to be very simple, but I couldn't find it anywhere (not even in the help of the function curve()). I think there's not much difference in both methods, but with curve you can easily adjust the amount of a values with 'n = ...' option, to make a smooth line.

Re: [R] function curve() swap axes

2012-07-05 Thread David Winsemius
On Jul 5, 2012, at 8:34 AM, Boudewijn Verkooijen wrote: 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

Re: [R] function curve() swap axes

2012-07-05 Thread Duncan Murdoch
On 05/07/2012 8:34 AM, Boudewijn Verkooijen wrote: 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? curve() is designed for plotting y vs x where y is a fu

[R] function curve() swap axes

2012-07-05 Thread Boudewijn Verkooijen
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((sq