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
d560e59a
Commit
d560e59a
authored
Jul 29, 2014
by
Houtan Bastani
Browse files
reporting: add writeCSV option for graphs, #693
parent
135e4d13
Changes
2
Hide whitespace changes
Inline
Side-by-side
@graph/graph.m
View file @
d560e59a
...
...
@@ -85,6 +85,8 @@ o.height = 4.5;
o
.
miscTikzPictureOptions
=
''
;
o
.
miscTikzAxisOptions
=
''
;
o
.
writeCSV
=
false
;
if
nargin
==
1
assert
(
isa
(
varargin
{
1
},
'graph'
),[
'@graph.graph: with one arg you '
...
'must pass a graph object'
]);
...
...
@@ -139,7 +141,7 @@ assert(isint(o.yTickLabelPrecision), '@graph.graph: o.yTickLabelPrecision must b
assert
(
islogical
(
o
.
yTickLabelFixed
),
'@graph.graph: yTickLabelFixed must be either true or false'
);
assert
(
islogical
(
o
.
yTickLabelZeroFill
),
'@graph.graph: yTickLabelZeroFill must be either true or false'
);
assert
(
islogical
(
o
.
yTickLabelScaled
),
'@graph.graph: yTickLabelScaled must be either true or false'
);
assert
(
islogical
(
o
.
writeCSV
),
'@graph.graph: writeCSV must be either true or false'
);
assert
(
ischar
(
o
.
shadeColor
),
'@graph.graph: shadeColor must be a string'
);
assert
(
ischar
(
o
.
zeroLineColor
),
'@graph.graph: zeroLineColor must be a string'
);
assert
(
any
(
strcmp
(
o
.
axisShape
,
{
'box'
,
'L'
})),
[
'@graph.graph: axisShape '
...
...
...
@graph/writeGraphFile.m
View file @
d560e59a
...
...
@@ -231,8 +231,25 @@ if o.showZeroline
o
.
zeroLineColor
,
dd
.
ndat
);
end
if
o
.
writeCSV
csvseries
=
dseries
();
end
for
i
=
1
:
ne
o
.
series
{
i
}
.
writeSeriesForGraph
(
fid
,
dd
);
if
o
.
writeCSV
csvseries
=
[
csvseries
...
o
.
series
{
i
}
.
data
(
dd
)
.
set_names
([
...
o
.
series
{
i
}
.
data
.
name
{:}
'_'
...
o
.
series
{
i
}
.
graphLegendName
'_'
...
o
.
series
{
i
}
.
graphLineColor
'_'
...
o
.
series
{
i
}
.
graphLineStyle
'_'
...
num2str
(
o
.
series
{
i
}
.
graphLineWidth
)
'_'
...
o
.
series
{
i
}
.
graphMarker
'_'
...
o
.
series
{
i
}
.
graphMarkerEdgeColor
'_'
...
o
.
series
{
i
}
.
graphMarkerFaceColor
'_'
...
num2str
(
o
.
series
{
i
}
.
graphMarkerSize
)])
...
];
end
if
o
.
showLegend
le
=
o
.
series
{
i
}
.
getNameForLegend
();
if
~
isempty
(
le
)
...
...
@@ -240,6 +257,9 @@ for i=1:ne
end
end
end
if
o
.
writeCSV
csvseries
.
save
(
strrep
(
o
.
graphName
,
'.tex'
,
''
),
'csv'
);
end
fprintf
(
fid
,
'\\end{axis}\n\\end{tikzpicture}%%'
);
if
fclose
(
fid
)
==
-
1
error
(
'@graph.writeGraphFile: closing %s\n'
,
o
.
filename
);
...
...
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