File: dynare_graph_init.m

package info (click to toggle)
dynare 4.5.7-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 49,408 kB
  • sloc: cpp: 84,998; ansic: 29,058; pascal: 13,843; sh: 4,833; objc: 4,236; yacc: 3,622; makefile: 2,278; lex: 1,541; python: 236; lisp: 69; xml: 8
file content (78 lines) | stat: -rw-r--r-- 2,029 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
function dyn_graph=dynare_graph_init(figure_name,nplot,line_types,line_width)
% function dynare_graph_init(figure_name,colors)
% initializes set of graphs
%
% INPUTS:
%   figure_name: name of the figures
%   colors: line colors
%
% OUTPUTS
%   dyn_graph: structure with figure information
%
% SPECIAL REQUIREMENT
%   none

% Copyright (C) 2006-2017 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/>.

global options_

dyn_graph.fh = dyn_figure(options_.nodisplay,'Name',figure_name);
dyn_graph.figure_name = figure_name;
if nargin > 2
    dyn_graph.line_types = line_types;
else
    dyn_graph.line_types = options_.graphics.line_types;
end
if nargin > 3
    dyn_graph.line_width = line_width;
else
    dyn_graph.line_width = options_.graphics.line_width;
end

dyn_graph.plot_nbr = 0;

switch(nplot)
  case 1
    dyn_graph.nc = 1;
    dyn_graph.nr = 1;
  case 2
    dyn_graph.nc = 1;
    dyn_graph.nr = 2;
  case 3
    dyn_graph.nc = 1;
    dyn_graph.nr = 3;
  case 4
    dyn_graph.nc = 2;
    dyn_graph.nr = 2;
  case 5
    dyn_graph.nc = 3;
    dyn_graph.nr = 2;
  case 6
    dyn_graph.nc = 3;
    dyn_graph.nr = 2;
  case 7
    dyn_graph.nc = 4;
    dyn_graph.nr = 2;
  case 8
    dyn_graph.nc = 4;
    dyn_graph.nr = 2;
  otherwise
    dyn_graph.nc = min(nplot,options_.graphics.ncols);
    dyn_graph.nr = min(ceil(nplot/dyn_graph.nc),options_.graphics.nrows);
end
dyn_graph.max_nplot = dyn_graph.nc*dyn_graph.nr;