Home > matlab > dynare_graph_init.m

dynare_graph_init

PURPOSE ^

function dynare_graph_init(figure_name,colors)

SYNOPSIS ^

function dynare_graph_init(figure_name,nplot,line_types,line_width)

DESCRIPTION ^

 function dynare_graph_init(figure_name,colors) 
 initializes set of graphs

 INPUTS:
   figure_name: name of the figures
   colors: line colors

 OUTPUTS
   none

 SPECIAL REQUIREMENT
   none

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function dynare_graph_init(figure_name,nplot,line_types,line_width)
0002 % function dynare_graph_init(figure_name,colors)
0003 % initializes set of graphs
0004 %
0005 % INPUTS:
0006 %   figure_name: name of the figures
0007 %   colors: line colors
0008 %
0009 % OUTPUTS
0010 %   none
0011 %
0012 % SPECIAL REQUIREMENT
0013 %   none
0014 
0015 % Copyright (C) 2006-2009 Dynare Team
0016 %
0017 % This file is part of Dynare.
0018 %
0019 % Dynare is free software: you can redistribute it and/or modify
0020 % it under the terms of the GNU General Public License as published by
0021 % the Free Software Foundation, either version 3 of the License, or
0022 % (at your option) any later version.
0023 %
0024 % Dynare is distributed in the hope that it will be useful,
0025 % but WITHOUT ANY WARRANTY; without even the implied warranty of
0026 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0027 % GNU General Public License for more details.
0028 %
0029 % You should have received a copy of the GNU General Public License
0030 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
0031 
0032 global dyn_graph options_
0033 
0034 dyn_graph.fh = figure('Name',figure_name);
0035 dyn_graph.figure_name = figure_name;
0036 if nargin > 2
0037     dyn_graph.line_types = line_types;
0038 else
0039     dyn_graph.line_types = options_.graphics.line_types;
0040 end
0041 if nargin > 3
0042     dyn_graph.line_width = line_width;
0043 else
0044     dyn_graph.line_width = options_.graphics.line_width;
0045 end
0046 
0047 dyn_graph.plot_nbr = 0;
0048 
0049 switch(nplot)
0050   case 1
0051     dyn_graph.nc = 1;
0052     dyn_graph.nr = 1;
0053   case 2
0054     dyn_graph.nc = 1;
0055     dyn_graph.nr = 2;
0056   case 3
0057     dyn_graph.nc = 1;
0058     dyn_graph.nr = 3;
0059   case 4
0060     dyn_graph.nc = 2;
0061     dyn_graph.nr = 2;
0062   case 5
0063     dyn_graph.nc = 3;
0064     dyn_graph.nr = 2;
0065   case 6
0066     dyn_graph.nc = 3;
0067     dyn_graph.nr = 2;
0068   case 7
0069     dyn_graph.nc = 4;
0070     dyn_graph.nr = 2;
0071   case 8
0072     dyn_graph.nc = 4;
0073     dyn_graph.nr = 2;
0074   otherwise
0075     dyn_graph.nc = min(nplot,options_.graphics.ncols);
0076     dyn_graph.nr = min(ceil(nplot/dyn_graph.nc),options_.graphics.nrows);
0077 end
0078 dyn_graph.max_nplot = dyn_graph.nc*dyn_graph.nr;

Generated on Mon 21-May-2012 02:42:43 by m2html © 2005