Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
DynareJulia
Dynare.jl
Commits
6412c724
Commit
6412c724
authored
Dec 05, 2020
by
MichelJuillard
Browse files
adding bar graphs
parent
9d923a03
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/parser/DynareParser.jl
View file @
6412c724
...
...
@@ -616,12 +616,15 @@ function get_smoothed_values(variable_name::String;
end
function
plot
(
variables
;
first_period
=
1
,
bar_variable
=
[],
first_period
=
1
,
plot_title
=
"Smoothed value"
,
plot_legend
=
(),
plot_filename
=
""
,
plot_legend_position
=
:
topright
)
local
myplot
# deal first with bar variable
variables
=
pushfirst!
(
variables
,
bar_variable
)
for
(
i
,
v
)
in
enumerate
(
variables
)
if
length
(
plot_legend
)
>
0
thislabel
=
plot_legend
[
i
]
...
...
@@ -630,13 +633,25 @@ function plot(variables;
plot_legend_position
=
false
end
if
i
==
1
if
length
(
bar_variable
)
>
0
len
=
length
(
bar_variable
)
xb
=
collect
(
range
(
first_period
,
length
=
len
))
myplot
=
Plots
.
bar
(
xb
,
bar_variable
,
label
=
thislabel
,
legend
=
plot_legend_position
,
title
=
plot_title
)
twinx
()
else
x
=
collect
(
range
(
first_period
,
length
=
length
(
v
)))
myplot
=
Plots
.
plot
(
x
,
v
,
label
=
thislabel
,
legend
=
plot_legend_position
,
title
=
plot_title
,
linewidth
=
3
)
end
else
x
=
collect
(
range
(
first_period
,
length
=
length
(
v
)))
myplot
=
Plots
.
plot
(
x
,
v
,
label
=
thislabel
,
legend
=
plot_legend_position
,
title
=
plot_title
)
else
x
=
collect
(
range
(
first_period
,
length
=
length
(
v
)))
myplot
=
Plots
.
plot!
(
x
,
v
,
label
=
thislabel
)
myplot
=
Plots
.
plot!
(
x
,
v
,
label
=
thislabel
,
linewidth
=
3
)
end
end
Plots
.
display
(
myplot
)
...
...
Write
Preview
Supports
Markdown
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