Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
HYCAR-Hydro
airGR
Commits
62d50d8f
Commit
62d50d8f
authored
Mar 30, 2017
by
unknown
Browse files
v1.0.5.30 in plot.OutputsModel(), black elements are now drawn with the foreground color
parent
2c1b065b
Changes
2
Hide whitespace changes
Inline
Side-by-side
DESCRIPTION
View file @
62d50d8f
Package: airGR
Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.0.5.
29
Version: 1.0.5.
30
Date: 2017-03-30
Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl")),
...
...
R/plot.OutputsModel.R
View file @
62d50d8f
...
...
@@ -240,7 +240,7 @@ plot.OutputsModel <- function(x, Qobs = NULL, IndPeriod_Plot = NULL, BasinArea =
ylim2
<-
c
(
ylim1
[
1
],
1.2
*
ylim1
[
2
]);
plot
(
Xaxis
,
rep
(
NA
,
length
(
Xaxis
)),
type
=
"n"
,
ylim
=
ylim2
,
xlab
=
""
,
ylab
=
""
,
xaxt
=
"n"
,
yaxt
=
"n"
,
...
);
txtleg
<-
NULL
;
colleg
<-
NULL
;
if
(
BOOL_Qobs
){
lines
(
Xaxis
,
DATA2
[
IndPeriod_Plot
],
lwd
=
lwdLine
,
lty
=
1
,
col
=
"black"
);
txtleg
<-
c
(
txtleg
,
"observed"
);
colleg
<-
c
(
colleg
,
"black"
);
}
if
(
BOOL_Qobs
){
lines
(
Xaxis
,
DATA2
[
IndPeriod_Plot
],
lwd
=
lwdLine
,
lty
=
1
,
col
=
par
(
"fg"
)
);
txtleg
<-
c
(
txtleg
,
"observed"
);
colleg
<-
c
(
colleg
,
par
(
"fg"
)
);
}
if
(
BOOL_Qsim
){
lines
(
Xaxis
,
DATA3
[
IndPeriod_Plot
],
lwd
=
lwdLine
,
lty
=
1
,
col
=
"orangered"
);
txtleg
<-
c
(
txtleg
,
"simulated"
);
colleg
<-
c
(
colleg
,
"orangered"
);
}
axis
(
side
=
2
,
at
=
seqDATA1
,
labels
=
seqDATA2
,
cex.axis
=
cexaxis
)
par
(
las
=
0
);
mtext
(
side
=
2
,
paste
(
"flow"
,
plotunit
,
sep
=
" "
),
line
=
lineY
,
cex
=
cexlab
);
par
(
las
=
0
);
...
...
@@ -264,7 +264,7 @@ plot.OutputsModel <- function(x, Qobs = NULL, IndPeriod_Plot = NULL, BasinArea =
ylim2
<-
c
(
ylim1
[
1
],
1.2
*
ylim1
[
2
]);
plot
(
Xaxis
,
rep
(
NA
,
length
(
Xaxis
)),
type
=
"n"
,
ylim
=
ylim2
,
xlab
=
""
,
ylab
=
""
,
xaxt
=
"n"
,
yaxt
=
"n"
,
...
);
txtleg
<-
NULL
;
colleg
<-
NULL
;
if
(
BOOL_Qobs
){
lines
(
Xaxis
,
Qobs
[
IndPeriod_Plot
],
lwd
=
lwdLine
,
lty
=
1
,
col
=
"black"
);
txtleg
<-
c
(
txtleg
,
"observed"
);
colleg
<-
c
(
colleg
,
"black"
);
}
if
(
BOOL_Qobs
){
lines
(
Xaxis
,
Qobs
[
IndPeriod_Plot
],
lwd
=
lwdLine
,
lty
=
1
,
col
=
par
(
"fg"
)
);
txtleg
<-
c
(
txtleg
,
"observed"
);
colleg
<-
c
(
colleg
,
par
(
"fg"
)
);
}
if
(
BOOL_Qsim
){
lines
(
Xaxis
,
OutputsModel
$
Qsim
[
IndPeriod_Plot
],
lwd
=
lwdLine
,
lty
=
1
,
col
=
"orangered"
);
txtleg
<-
c
(
txtleg
,
"simulated"
);
colleg
<-
c
(
colleg
,
"orangered"
);
}
axis
(
side
=
2
,
at
=
pretty
(
ylim1
),
labels
=
pretty
(
ylim1
),
cex.axis
=
cexaxis
)
par
(
las
=
0
);
mtext
(
side
=
2
,
paste
(
"flow"
,
plotunit
,
sep
=
" "
),
line
=
lineY
,
cex
=
cexlab
);
par
(
las
=
0
);
...
...
@@ -356,7 +356,7 @@ plot.OutputsModel <- function(x, Qobs = NULL, IndPeriod_Plot = NULL, BasinArea =
par
(
new
=
TRUE
);
}
##Plot_flows
plot
(
NULL
,
type
=
"n"
,
xlim
=
range
(
SeqX1
),
ylim
=
c
(
ylimQ
[
1
],
2
*
ylimQ
[
2
]),
xlab
=
""
,
ylab
=
""
,
xaxt
=
"n"
,
yaxt
=
"n"
,
...
)
if
(
BOOL_Qobs
){
lines
(
1
:
nrow
(
DataPlotQ
),
DataPlotQ
$
Qobs
,
lwd
=
lwdLine
,
lty
=
1
,
col
=
"black"
);
txtleg
<-
c
(
txtleg
,
"Qobs"
);
colleg
<-
c
(
colleg
,
"black"
);
lwdleg
<-
c
(
lwdleg
,
lwdLine
);
}
if
(
BOOL_Qobs
){
lines
(
1
:
nrow
(
DataPlotQ
),
DataPlotQ
$
Qobs
,
lwd
=
lwdLine
,
lty
=
1
,
col
=
par
(
"fg"
)
);
txtleg
<-
c
(
txtleg
,
"Qobs"
);
colleg
<-
c
(
colleg
,
par
(
"fg"
)
);
lwdleg
<-
c
(
lwdleg
,
lwdLine
);
}
if
(
BOOL_Qsim
){
lines
(
1
:
nrow
(
DataPlotQ
),
DataPlotQ
$
Qsim
,
lwd
=
lwdLine
,
lty
=
1
,
col
=
"orangered"
);
txtleg
<-
c
(
txtleg
,
"Qsim"
);
colleg
<-
c
(
colleg
,
"orangered"
);
lwdleg
<-
c
(
lwdleg
,
lwdLine
);
}
##Axis_and_legend
axis
(
side
=
1
,
at
=
SeqX1
,
tick
=
TRUE
,
labels
=
xLabels1
,
cex.axis
=
cexaxis
)
...
...
@@ -400,8 +400,8 @@ plot.OutputsModel <- function(x, Qobs = NULL, IndPeriod_Plot = NULL, BasinArea =
DATA2
<-
log
(
Qobs
[
IndPeriod_Plot
][
SelectNotZero
]);
SeqQuant
<-
seq
(
0
,
1
,
by
=
1
/
(
length
(
DATA2
)));
Quant
<-
as.numeric
(
quantile
(
DATA2
,
SeqQuant
,
na.rm
=
TRUE
));
Fn
<-
ecdf
(
DATA2
);
YY
<-
DATA2
;
YY
<-
YY
[
order
(
Fn
(
DATA2
)
)];
XX
<-
Fn
(
DATA2
);
XX
<-
XX
[
order
(
Fn
(
DATA2
)
)];
lines
(
XX
,
YY
,
lwd
=
1
,
col
=
"black"
);
txtleg
<-
c
(
txtleg
,
"observed"
);
colleg
<-
c
(
colleg
,
"black"
);
}
lines
(
XX
,
YY
,
lwd
=
1
,
col
=
par
(
"fg"
)
);
txtleg
<-
c
(
txtleg
,
"observed"
);
colleg
<-
c
(
colleg
,
par
(
"fg"
)
);
}
if
(
BOOL_Qsim
){
DATA2
<-
log
(
OutputsModel
$
Qsim
[
IndPeriod_Plot
][
SelectNotZero
]);
SeqQuant
<-
seq
(
0
,
1
,
by
=
1
/
(
length
(
DATA2
)));
Quant
<-
as.numeric
(
quantile
(
DATA2
,
SeqQuant
,
na.rm
=
TRUE
));
...
...
@@ -423,7 +423,7 @@ plot.OutputsModel <- function(x, Qobs = NULL, IndPeriod_Plot = NULL, BasinArea =
kPlot
<-
kPlot
+1
;
mar
<-
c
(
6
,
5
,
1
,
5
);
par
(
new
=
FALSE
,
mar
=
mar
,
las
=
0
)
ylim
<-
log
(
range
(
c
(
Qobs
[
IndPeriod_Plot
][
SelectQobsNotZero
&
SelectQsimNotZero
],
OutputsModel
$
Qsim
[
IndPeriod_Plot
][
SelectQobsNotZero
&
SelectQsimNotZero
]),
na.rm
=
TRUE
));
plot
(
log
(
Qobs
[
IndPeriod_Plot
][
SelectQobsNotZero
&
SelectQsimNotZero
]),
log
(
OutputsModel
$
Qsim
[
IndPeriod_Plot
][
SelectQobsNotZero
&
SelectQsimNotZero
]),
type
=
"p"
,
pch
=
1
,
cex
=
0.9
,
col
=
"black"
,
xlim
=
ylim
,
ylim
=
ylim
,
xaxt
=
"n"
,
yaxt
=
"n"
,
xlab
=
""
,
ylab
=
""
,
...
)
plot
(
log
(
Qobs
[
IndPeriod_Plot
][
SelectQobsNotZero
&
SelectQsimNotZero
]),
log
(
OutputsModel
$
Qsim
[
IndPeriod_Plot
][
SelectQobsNotZero
&
SelectQsimNotZero
]),
type
=
"p"
,
pch
=
1
,
cex
=
0.9
,
col
=
par
(
"fg"
)
,
xlim
=
ylim
,
ylim
=
ylim
,
xaxt
=
"n"
,
yaxt
=
"n"
,
xlab
=
""
,
ylab
=
""
,
...
)
abline
(
a
=
0
,
b
=
1
,
col
=
"royalblue"
);
axis
(
side
=
1
,
at
=
seqDATA1
,
labels
=
seqDATA2
,
cex
=
cexaxis
);
axis
(
side
=
2
,
at
=
seqDATA1
,
labels
=
seqDATA2
,
cex
=
cexaxis
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment