bcgroundwater icon indicating copy to clipboard operation
bcgroundwater copied to clipboard

`gwl_area_plot()`: Change scale breaks for wells with short records

Open steffilazerte opened this issue 6 years ago • 5 comments

For gwl_area_plot(), perhaps consider changing the x axis to yearly breaks when there are fewer than 10 years (or fewer than 6 years) of well data? This isn't a very common occurrence, but would improve the legibility of those figures.

I'm more than happy to create a pull request if you think this would be a good thing to include.

steffilazerte avatar Aug 30 '18 18:08 steffilazerte

Great idea! Maybe you could add to your PR #27?

stephhazlitt avatar Aug 30 '18 18:08 stephhazlitt

Done!

steffilazerte avatar Aug 30 '18 18:08 steffilazerte

@steffilazerte @ateucher—so I have figured out why I have not encountered this too much, the SoE trend analysis criteria requires a minimum of 10 years data for the Mann-Kendall. That said, there are quite a few with 10-20 years data where the breaks are minimal (e.g. 11 years). Maybe we should this to fewer than 12 (or even 15) years?

stephhazlitt avatar Sep 21 '18 23:09 stephhazlitt

That seems logical. There's only one number to change in the function, so it'd be an easy fix, as long as the 1-year breaks still look okay with 15 years of data. Alternatively we could change the if_else function to a case_when function to get at intermediate ranges.

I.e. perhaps:

  • 0-10 years -> 1-year breaks
  • 10-20 years -> 2-year breaks
  • 20+ years -> 3-year breaks

This change is still relevant to wells with < 10 years of data, as the plotting function creates a figure for all data sets, it just doesn't put the trend on it.

steffilazerte avatar Sep 24 '18 13:09 steffilazerte

I'll plot up some examples and see how 1-year breaks look with more years of data. If too busy, maybe I'll offer some more options via case_when. Great suggestions @steffilazerte.

stephhazlitt avatar Sep 24 '18 16:09 stephhazlitt