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
82e45f67
Commit
82e45f67
authored
Jul 22, 2013
by
Houtan Bastani
Browse files
reporting: @graph: new option xTickLabels
parent
a961069a
Changes
3
Hide whitespace changes
Inline
Side-by-side
doc/dynare.texi
View file @
82e45f67
...
...
@@ -8240,7 +8240,7 @@ command. Default: @code{`!'}
@
end
table
@
end
defmethod
@
defmethod
Report
addGraph
data
,
figname
,
graphSize
,
showGrid
,
showLegend
,
showLegendBox
,
legendLocation
,
legendOrientation
,
legendFontSize
,
seriesToUse
,
shade
,
shadeColor
,
shadeOpacity
,
title
,
xlabel
,
ylabel
,
xrange
,
yrange
,
showZeroline
@
defmethod
Report
addGraph
data
,
figname
,
graphSize
,
showGrid
,
showLegend
,
showLegendBox
,
legendLocation
,
legendOrientation
,
legendFontSize
,
seriesToUse
,
shade
,
shadeColor
,
shadeOpacity
,
title
,
xlabel
,
ylabel
,
xrange
,
xTickLabels
,
yrange
,
showZeroline
Adds
a
@
code
{
Graph
}
to
a
@
code
{
Section
}.
@
optionshead
@
table
@
code
...
...
@@ -8309,6 +8309,10 @@ The y-axis label. Default: @code{none}
@
item
xrange
,
@
code
{
dynDates
}
The
boundary
on
the
x
-
axis
to
display
in
the
graph
.
Default
:
all
@
item
xTickLabels
,
@
code
{
CELL_ARRAY_STRINGS
}
The
labels
to
use
for
the
xticks
in
the
graph
.
Default
:
the
dates
of
the
@
code
{
dynSeries
}
@
item
yrange
,
@
code
{
NUMERICAL_VECTOR
}
The
boundary
on
the
y
-
axis
to
display
in
the
graph
,
represented
as
a
@
code
{
NUMERICAL_VECTOR
}
of
size
@
math
{
2
},
with
the
first
entry
less
...
...
matlab/reports/@graph/createGraph.m
View file @
82e45f67
...
...
@@ -98,15 +98,19 @@ if ~isempty(o.shade)
set
(
gca
,
'children'
,
children
);
end
xticks
=
get
(
gca
,
'XTick'
);
xTickLabels
=
cell
(
1
,
length
(
xticks
));
for
i
=
1
:
length
(
xticks
)
if
xticks
(
i
)
>=
x
(
1
)
&&
...
xticks
(
i
)
<=
x
(
end
)
xTickLabels
{
i
}
=
xlabels
{
xticks
(
i
)};
else
xTickLabels
{
i
}
=
''
;
if
isempty
(
o
.
xTickLabels
)
xticks
=
get
(
gca
,
'XTick'
);
xTickLabels
=
cell
(
1
,
length
(
xticks
));
for
i
=
1
:
length
(
xticks
)
if
xticks
(
i
)
>=
x
(
1
)
&&
...
xticks
(
i
)
<=
x
(
end
)
xTickLabels
{
i
}
=
xlabels
{
xticks
(
i
)};
else
xTickLabels
{
i
}
=
''
;
end
end
else
xTickLabels
=
o
.
xTickLabels
;
end
set
(
gca
,
'XTickLabel'
,
xTickLabels
);
...
...
matlab/reports/@graph/graph.m
View file @
82e45f67
...
...
@@ -60,6 +60,7 @@ o.legendFontSize = 8;
o
.
showZeroline
=
false
;
o
.
graphSize
=
[];
o
.
xTickLabels
=
{};
if
nargin
==
1
assert
(
isa
(
varargin
{
1
},
'graph'
),[
'@graph.graph: with one arg you '
...
...
...
@@ -132,7 +133,8 @@ assert(isempty(o.seriesToUse) || iscellstr(o.seriesToUse), ['@graph.graph: ' ...
assert
(
isempty
(
o
.
graphSize
)
||
((
isfloat
(
o
.
graphSize
)
&&
length
(
o
.
graphSize
)
==
2
)),
...
[
'@graph.graph: graphSize is specified as an array with two float '
...
'entries, [width height]'
]);
assert
(
iscellstr
(
o
.
xTickLabels
),
...
'@graph.graph: xTickLabels must be a cell array of strings'
);
% using o.seriesToUse, create series objects and put them in o.seriesElements
if
~
isempty
(
o
.
data
)
if
isempty
(
o
.
seriesToUse
)
...
...
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