bcgroundwater
bcgroundwater copied to clipboard
`gwl_area_plot()`: Change scale breaks for wells with short records
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.
Great idea! Maybe you could add to your PR #27?
Done!
@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?
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.
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.