Commit d6482809 authored by Heraut Louis's avatar Heraut Louis
Browse files

Plot aes

parent ff5d708f
No related merge requests found
Showing with 40 additions and 31 deletions
+40 -31
......@@ -198,6 +198,13 @@ time_panel = function (code, df_data, df_trend, missRect, p_threshold, unit2day,
datebreak = round(as.numeric(dDate) / unit2day / 11 , 0)
p = ggplot() + theme_bw() +
ggtitle(type) +
theme(plot.title=element_text(size=10, vjust=-1.5, hjust=1),
axis.title.x=element_blank(),
axis.title.y=element_text(size=9)) +
geom_line(aes(x=df_data_code$Date, y=df_data_code$Qm3s),
color='black')
......@@ -232,6 +239,8 @@ time_panel = function (code, df_data, df_trend, missRect, p_threshold, unit2day,
}}
if (norm) {
p = p +
ylab(bquote('dbit ['*m^{3}*'.'*s^{-1}*'] x'~10^{.(as.character(power))}))
......@@ -242,20 +251,20 @@ time_panel = function (code, df_data, df_trend, missRect, p_threshold, unit2day,
}
p = p +
# ggtitle(paste(variable, 'station',
# as.character(code), sep=' ')) +
xlab('date') +
# xlab('date') +
scale_x_date(date_breaks=paste(as.character(datebreak),
'year', sep=' '),
date_labels="%Y",
limits=c(min(df_data_code$Date),
max(df_data_code$Date)),
expand=c(0, 0)) +
annotate('text',
x=as.Date(as.numeric(max(df_data_code$Date))*0.9),
y=max(df_data_code$Qm3s, na.rm=TRUE)*1.05,
label=type)
expand=c(0, 0))
# geom_text(aes(x=max(df_data_code$Date),
# y=maxQ*1.1,
# label=type),
# parse=TRUE,
# hjust='right',
# vjust='top')
if (type == 'sqrt') {
p = p +
......
......@@ -155,30 +155,30 @@ res_VCN10trend = get_VCN10trend(df_data, df_meta, period)
# TIME PANEL #
# Plot time panel of debit by stations
panel(list(df_data, df_data),
layout_matrix=c(1, 2),
df_meta=df_meta,
missRect=list(TRUE, TRUE),
type=list('time', 'sqrt'),
info_header=TRUE,
time_header=NULL,
header_ratio=3,
figdir=figdir,
filename_opt='time')
# panel(list(res_QAtrend$data, res_QMNAtrend$data,
# res_VCN10trend$data),
# layout_matrix=c(1, 2, 3),
# df_meta=df_meta,
# df_trend=list(res_QAtrend$trend, res_QMNAtrend$trend,
# res_VCN10trend$trend),
# type=list(expression(Q_A), '', ''),
# missRect=list(TRUE, TRUE, TRUE),
# panel(list(df_data, df_data),
# layout_matrix=c(1, 2),
# df_meta=df_meta,
# missRect=list(TRUE, TRUE),
# type=list('time', 'sqrt'),
# info_header=TRUE,
# time_header=df_data,
# header_ratio=2,
# time_header=NULL,
# header_ratio=3,
# figdir=figdir,
# filename_opt='')
# filename_opt='time')
panel(list(res_QAtrend$data, res_QMNAtrend$data,
res_VCN10trend$data),
layout_matrix=c(1, 2, 3),
df_meta=df_meta,
df_trend=list(res_QAtrend$trend, res_QMNAtrend$trend,
res_VCN10trend$trend),
type=list(bquote(Q[A]), bquote(Q[MNA]), bquote(V[CN10])),
missRect=list(TRUE, TRUE, TRUE),
info_header=TRUE,
time_header=df_data,
header_ratio=2,
figdir=figdir,
filename_opt='')
### /!\ Removed 185 row(s) containing missing values (geom_path) -> remove NA ###
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment