USGS-R / lakeReport

Scripts and report generator
Other
0 stars 4 forks source link

Depth Profile x-axis for SC not incorporating all data #95

Open sbmarsh-USGS opened 3 years ago

sbmarsh-USGS commented 3 years ago
if(top){
    side1 <- seq(from=xranges$wt_low, to=xranges$wt_high, by=10)
    side3 <- seq(from=xranges$do_low, to=xranges$do_high, by=10)
    xn.minor <- 4
    plottext <- c("W.T.", "D.O.") # legend label
    mainTitle <- filter_date
  } else{
    sc_sequence_categ <- cut(xranges$sc_high - xranges$sc_low,
                             breaks=c(0, 50, 200, 500, 900, Inf),
                             labels = c(5, 50, 100, 200, 500))
    sc_sequence <- as.numeric(levels(sc_sequence_categ))[sc_sequence_categ]

    side1 <- seq(from=xranges$sc_low, to=xranges$sc_high, by=sc_sequence)
    side3 <- seq(from=xranges$ph_low, to=xranges$ph_high, by=1)
    xn.minor <- 0
    plottext <- c("S.C.", "pH") # legend label
    mainTitle <- ""
  }

image Note: the SC axis should go to 700, because in July the largest value is 681.

sbmarsh-USGS commented 3 years ago

Now that I look more closely, I'm not even sure that these are plotting the right data. The lowest value for Wind Lake in July 2020 is 604 and the plot shows it going below 600. Now I'm really perplexed.

image

lindsayplatt commented 3 years ago

Hi @sbmarsh-USGS - it's been awhile! Hope all is well 😃

The limits of the axes aren't determined by the data themselves, but instead are set by the CSV file that can be found in the GitHub repo here. Given what this says for POTTER LAKE NEAR MUKWONAGO, WI, the highest SC limit should be 700, so the plot should have 700 not 650. However, your local CSV could be different than what is up here on GitHub. I would check and verify that your local CSV has 700 as the upper limit and wasn't changed to 650.

For the second one, the range is quite large (600 to 1400), so it makes sense to me that a value of 604 appears to touch the lower limit (the line is drawn right on top of the y axis) because 4 uS is only about ~0.5% of the width of the plot.

sbmarsh-USGS commented 3 years ago

Hi @lindsayplatt Things are good here. Hope you are doing well, too! :)

I checked the CSV file in my local version, and Potter Lake's upper range is set to 700 there also, so not sure why it's not using that.