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
Dynare
reporting
Commits
ea80bf07
Commit
ea80bf07
authored
May 20, 2014
by
Houtan Bastani
Browse files
reporting: support horizontal lines
parent
bf97829e
Changes
2
Hide whitespace changes
Inline
Side-by-side
@report_series/report_series.m
View file @
ea80bf07
...
...
@@ -48,6 +48,7 @@ o.graphMarkerSize = 1;
o
.
graphMiscTikzAddPlotOptions
=
''
;
o
.
graphHline
=
{};
o
.
graphVline
=
dates
();
o
.
tableShowMarkers
=
false
;
...
...
@report_series/writeSeriesForGraph.m
View file @
ea80bf07
...
...
@@ -30,7 +30,7 @@ function o = writeSeriesForGraph(o, fid, xrange)
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
%% Validate options provided by user
if
isempty
(
o
.
graphVline
)
if
isempty
(
o
.
graphVline
)
&&
isempty
(
o
.
graphHline
)
assert
(
~
isempty
(
o
.
data
)
&&
isa
(
o
.
data
,
'dseries'
),
[
'@report_series.writeSeriesForGraph: must '
...
'provide data as a dseries'
]);
end
...
...
@@ -68,13 +68,15 @@ assert(~(strcmp(o.graphLineStyle, 'none') && isempty(o.graphMarker)), ['@report_
% Validate graphVline
assert
(
isdates
(
o
.
graphVline
),
'@report_series.writeSeriesForGraph: graphVline must be a dates'
);
assert
(
isempty
(
o
.
graphHline
)
||
isnumeric
(
o
.
graphHline
),
...
'@report_series.writeSeriesForGraph: graphHline must a single numeric value'
);
% Zero tolerance
assert
(
isfloat
(
o
.
zeroTol
),
'@report_series.write: zeroTol must be a float'
);
%% graphVline
if
~
isempty
(
o
.
graphVline
)
if
~
isempty
(
o
.
graphVline
)
||
~
isempty
(
o
.
graphHline
)
for
i
=
1
:
o
.
graphVline
.
ndat
fprintf
(
fid
,
'%%vline %d\n\\begin{pgfonlayer}{background1}\n\\draw[color=%s,%s,line width=%fpt,line join=round'
,
...
i
,
o
.
graphLineColor
,
o
.
graphLineStyle
,
o
.
graphLineWidth
);
...
...
@@ -97,6 +99,27 @@ if ~isempty(o.graphVline)
'cs:%d,\\pgfkeysvalueof{/pgfplots/ymax});\n\\end{pgfonlayer}\n'
],
...
x
,
x
);
end
if
~
isempty
(
o
.
graphHline
)
fprintf
(
fid
,
'%%hline %d\n\\begin{pgfonlayer}{background1}\n\\draw[color=%s,%s,line width=%fpt,line join=round'
,
...
i
,
o
.
graphLineColor
,
o
.
graphLineStyle
,
o
.
graphLineWidth
);
if
~
isempty
(
o
.
graphMarker
)
if
isempty
(
o
.
graphMarkerEdgeColor
)
o
.
graphMarkerEdgeColor
=
o
.
graphLineColor
;
end
if
isempty
(
o
.
graphMarkerFaceColor
)
o
.
graphMarkerFaceColor
=
o
.
graphLineColor
;
end
fprintf
(
fid
,
',mark=%s,mark size=%f,every mark/.append style={draw=%s,fill=%s}'
,
...
o
.
graphMarker
,
o
.
graphMarkerSize
,
o
.
graphMarkerEdgeColor
,
o
.
graphMarkerFaceColor
);
end
if
~
isempty
(
o
.
graphMiscTikzAddPlotOptions
)
fprintf
(
fid
,
',%s'
,
o
.
graphMiscTikzAddPlotOptions
);
end
fprintf
(
fid
,
[
'] (axis cs:\\pgfkeysvalueof{/pgfplots/xmin},%f) -- (axis '
...
'cs:\\pgfkeysvalueof{/pgfplots/xmax},%f);\n\\end{pgfonlayer}\n'
],
...
o
.
graphHline
,
o
.
graphHline
);
end
return
end
...
...
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