diff --git a/plotting/panel.R b/plotting/panel.R index b939c2bb6b7f1e96187b4893c44aead704784fce..87b19e3f005f1fe736fdae3928584c7bfa15e5c9 100644 --- a/plotting/panel.R +++ b/plotting/panel.R @@ -174,6 +174,8 @@ time_panel = function (df_data_code, df_trend_code, type, p_threshold=0.1, missR ltype = c('solid', 'dashed', 'dotted', 'twodash') lty = c('solid', '22') + + ii = 0 for (i in 1:nPeriod) { df_trend_code_per = @@ -182,6 +184,8 @@ time_panel = function (df_data_code, df_trend_code, type, p_threshold=0.1, missR if (df_trend_code_per$p <= p_threshold) { + ii = ii + 1 + iStart = which.min(abs(df_data_code$Date - Start[i])) iEnd = which.min(abs(df_data_code$Date - End[i])) @@ -210,11 +214,11 @@ time_panel = function (df_data_code, df_trend_code, type, p_threshold=0.1, missR codeDate = df_data_code$Date codeQ = df_data_code$Qm3s - x = gpct(3, codeDate, shift=TRUE) + x = gpct(2, codeDate, shift=TRUE) xend = x + gpct(3, codeDate) dy = gpct(5, codeQ, ref=0) - y = gpct(108, codeQ, ref=0) - (i-1)*dy + y = gpct(105, codeQ, ref=0) - (ii-1)*dy xt = xend + gpct(1, codeDate) label = bquote(bold(.(format(df_trend_code$trend, scientific=TRUE, digits=3)))~'['*m^{3}*'.'*s^{-1}*'.'*an^{-1}*']')