Home > matlab > dynare_graph.m

dynare_graph

PURPOSE ^

function dynare_graph(y,tit,x)

SYNOPSIS ^

function dynare_graph(y,tit,x)

DESCRIPTION ^

 function dynare_graph(y,tit,x) 
 graphs

 INPUT
   figure_name: name of the figures
   colors: line colors

 OUTPUT
   none

 SPECIAL REQUIREMENT
   none

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function dynare_graph(y,tit,x)
0002 % function dynare_graph(y,tit,x)
0003 % graphs
0004 %
0005 % INPUT
0006 %   figure_name: name of the figures
0007 %   colors: line colors
0008 %
0009 % OUTPUT
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
0033 
0034 if nargin < 3
0035     x = (1:size(y,1))';
0036 end
0037 nplot = dyn_graph.plot_nbr + 1; 
0038 if nplot > dyn_graph.max_nplot
0039     figure('Name',dyn_graph.figure_name);
0040     nplot = 1;
0041 end
0042 dyn_graph.plot_nbr = nplot;
0043 subplot(dyn_graph.nr,dyn_graph.nc,nplot);
0044 
0045 line_types = dyn_graph.line_types;
0046 line_type = line_types{1};
0047 for i=1:size(y,2);
0048     if length(line_types) > 1
0049         line_type = line_types{i};
0050     end
0051     
0052     plot(x,y(:,i),line_type);
0053     hold on
0054 end
0055 title(tit);
0056 hold off

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