diff --git a/matlab/reporting/@graph/createGraph.m b/matlab/reporting/@graph/createGraph.m index dd1beedb048207c386e0dbbd8c70eb811461adde..e800416b4caa38340c037013120a16713acffcbb 100644 --- a/matlab/reporting/@graph/createGraph.m +++ b/matlab/reporting/@graph/createGraph.m @@ -98,10 +98,11 @@ set(gca,'XTick', x); set(gca,'XTickLabel', xlabels); if o.legend - lh = legend(o.seriesElements.getNames()); + lh = legend(o.seriesElements.getTexNames()); set(lh, 'orientation', o.legend_orientation); set(lh, 'Location', o.legend_location); set(lh, 'FontSize', o.legend_font_size); + set(lh, 'interpreter', 'latex'); legend('boxoff'); end diff --git a/matlab/reporting/@series/getTexName.m b/matlab/reporting/@series/getTexName.m new file mode 100644 index 0000000000000000000000000000000000000000..e79660836288717595209ff93b39690da3aeb906 --- /dev/null +++ b/matlab/reporting/@series/getTexName.m @@ -0,0 +1,23 @@ +function s = getTexName(o) +%function s = getTexName(o) + +% Copyright (C) 2013 Dynare Team +% +% This file is part of Dynare. +% +% Dynare is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% Dynare is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with Dynare. If not, see <http://www.gnu.org/licenses/>. + +assert(~isempty(o.data) && size(o.data, 2) == 1); +s = o.data(1).tex(); +end \ No newline at end of file diff --git a/matlab/reporting/@seriesElements/getTexNames.m b/matlab/reporting/@seriesElements/getTexNames.m new file mode 100644 index 0000000000000000000000000000000000000000..7c247b9263523e141a4690545b487d7521029093 --- /dev/null +++ b/matlab/reporting/@seriesElements/getTexNames.m @@ -0,0 +1,26 @@ +function names = getTexNames(o, varargin) +%function names = getTexNames(o, varargin) + +% Copyright (C) 2013 Dynare Team +% +% This file is part of Dynare. +% +% Dynare is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% Dynare is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with Dynare. If not, see <http://www.gnu.org/licenses/>. + +se = o.objArray.getObjs(varargin{:}); +names = {}; +for i=1:length(se) + names(i) = se{i}.getTexName(); +end +end \ No newline at end of file