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
Dóra Kocsis
dynare
Commits
5515a8a6
Commit
5515a8a6
authored
Jul 24, 2013
by
Houtan Bastani
Browse files
reporting: @series: add zerotol option
parent
7d1899df
Changes
3
Hide whitespace changes
Inline
Side-by-side
doc/dynare.texi
View file @
5515a8a6
...
...
@@ -8359,7 +8359,7 @@ Whether or not to show vertical lines separating the columns. Default: @code{fal
@
end
defmethod
@
anchor
{
addSeries
}
@defmethod Report addSeries data, graphLineColor, graphLineStyle, graphLineWidth, graphMarker, graphMarkerEdgeColor, graphMarkerFaceColor, graphMarkerSize, tableShowMarkers, tableAlignRight, tableNegColor, tablePosColor
@
defmethod
Report
addSeries
data
,
graphLineColor
,
graphLineStyle
,
graphLineWidth
,
graphMarker
,
graphMarkerEdgeColor
,
graphMarkerFaceColor
,
graphMarkerSize
,
tableShowMarkers
,
tableAlignRight
,
tableNegColor
,
tablePosColor
,
zerotol
Adds
a
@
code
{
Series
}
to
a
@
code
{
Graph
}
or
a
@
code
{
Table
}.
@
optionshead
@
table
@
code
...
...
@@ -8413,6 +8413,11 @@ zero. Default: @code{`red'}
The color to use when marking Table data that is greater than
zero. Default: @code{`blue'
}
@
item
zerotol
,
@
code
{
DOUBLE
}
The
zero
tolerance
.
Anything
smaller
than
@
code
{
zerotol
}
and
larger
than
@
code
{-
zerotol
}
will
be
set
to
zero
before
being
graphed
.
Default
:
@
math
{
1e-6
}
@
end
table
@
end
defmethod
...
...
matlab/reports/@series/getLine.m
View file @
5515a8a6
...
...
@@ -60,6 +60,9 @@ assert(~(strcmp(o.graphLineStyle, 'none') && isempty(o.graphMarker)), ['@series.
% Validate xrange
assert
(
isempty
(
xrange
)
||
isa
(
xrange
,
'dynDates'
));
% Zero tolerance
assert
(
isfloat
(
o
.
zerotol
),
'@series.write: zerotol must be a float'
);
%%
if
isempty
(
xrange
)
||
xrange
==
o
.
data
.
time
ds
=
o
.
data
;
...
...
@@ -67,8 +70,18 @@ else
ds
=
o
.
data
(
xrange
);
end
opt
=
{
'XData'
,
1
:
length
(
ds
.
data
)};
opt
=
{
opt
{:},
'YData'
,
ds
.
data
};
% if graphing data that is within zerotol, set to zero, create series and
% get line:
thedata
=
ds
.
data
;
stz
=
bsxfun
(
@
and
,
...
bsxfun
(
@
lt
,
thedata
,
o
.
zerotol
),
...
bsxfun
(
@
gt
,
thedata
,
-
o
.
zerotol
));
if
any
(
stz
)
thedata
(
stz
)
=
0
;
end
opt
=
{
'XData'
,
1
:
length
(
thedata
)};
opt
=
{
opt
{:},
'YData'
,
thedata
};
opt
=
{
opt
{:},
'Color'
,
o
.
graphLineColor
};
opt
=
{
opt
{:},
'LineStyle'
,
o
.
graphLineStyle
};
...
...
matlab/reports/@series/series.m
View file @
5515a8a6
...
...
@@ -51,6 +51,8 @@ o.tableMarkerLimit = 1e-4;
o
.
tableAlignRight
=
false
;
o
.
zerotol
=
1e-6
;
if
nargin
==
1
assert
(
isa
(
varargin
{
1
},
'series'
),[
'@series.series: with one arg you '
...
'must pass a series object'
]);
...
...
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