Displaying 2 results from an estimated 2 matches for "ylim_2".
Did you mean:
ylim2
2010 Dec 30
2
optim and singularity
...OWER-UPSTREAM US NA NA NA"),header=T)
closeAllConnections()
#interpolate missing WTD values
temp.dat$WTD<-na.approx(temp.dat$WTD,as.numeric(as.Date(temp.dat$Meas_Date,"%m/%d/%Y")))
#the current limits of the left and right y-axes
ylim_1<-rev(c(0,max(na.omit(temp.dat$WTD))+1))
ylim_2<-c(floor(min(range(na.omit(temp.dat$Avg.EM.Survey.Value))[1],range(na.omit(temp.dat$Avg.Soil.Paste.EC))[1])),ceiling(max(range(na.omit(temp.dat$Avg.EM.Survey.Value))[2],range(na.omit(temp.dat$Avg.Soil.Paste.EC))[2])))
plot(as.Date(temp.dat$Meas_Date,"%m/%d/%Y"),temp.dat$WTD,xlim=c(as....
2010 Dec 22
0
adjust secondary y-axis bounds to minimize visual residuals
...hen thinking in
terms of depth. The second is electrical conductance (a surrogate for
salinity), and is referenced to the right y-axis. The data and plot
commands follow below.
I've been trying to figure out a way to minimize the variable called
"min_this" by changing the values in ylim_2 only, with one constraint:
ylim_2[1]>0. I'm unsure of how to stuff the code that follows the plot
commands into a loop that adjusts ylim_2 so as to minimize "min_this"? I'm
guessing there is a function to do this?
Thanks,
Eric
library(zoo)
#example data and plotting command...