0001 function MakeAllFigures(NumberOfPlots,Caption,FigureProperties,Info)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 global M_ options_
0021
0022 FigHandle = figure('Name',FigureProperties.Name);
0023
0024 NAMES = cell(NumberOfPlots,1);
0025 if options_.TeX
0026 TeXNAMES = cell(NumberOfPlots,1);
0027 end
0028
0029 if NumberOfPlots == 9
0030 nr = 3;
0031 nc = 3;
0032 elseif NumberOfPlots == 8
0033 nr = 3;
0034 nc = 3;
0035 elseif NumberOfPlots == 7
0036 nr = 3;
0037 nc = 3;
0038 elseif NumberOfPlots == 6
0039 nr = 2;
0040 nc = 3;
0041 elseif NumberOfPlots == 5
0042 nr = 3;
0043 nc = 2;
0044 elseif NumberOfPlots == 4
0045 nr = 2;
0046 nc = 2;
0047 elseif NumberOfPlots == 3
0048 nr = 2;
0049 nc = 2;
0050 elseif NumberOfPlots == 2
0051 nr = 1;
0052 nc = 2;
0053 elseif NumberOfPlots == 1
0054 nr = 1;
0055 nc = 1;
0056 end
0057
0058 for plt = 1:NumberOfPlots
0059 eval(['NumberOfCurves = Info.Box' int2str(plt) '.Number;'])
0060 NumberOfObservations = zeros(2,1);
0061 x = cell(NumberOfCurves,1);
0062 y = cell(NumberOfCurves,1);
0063 PltType = cell(NumberofCurves,1);
0064 top = NaN(NumberOfCurves,1);
0065 bottom = NaN(NumberOfCurves,1);
0066 binf = NaN(NumberOfCurves,1);
0067 bsup = NaN(NumberOfCurves,1);
0068 for curve = 1:NumberOfCurves
0069 eval(['x{' curve '} = Info.Box' int2str(plt) '.Curve' int2str(curve) '.xdata;'])
0070 eval(['y{' curve '} = Info.Box' int2str(plt) '.Curve' int2str(curve) '.ydata;'])
0071 eval(['name = Info.Box' int2str(plt) '.Curve' int2str(curve) '.variablename;'])
0072 eval(['PltType{' curve '} = Info.Box' int2str(plt) '.Curve' int2str(curve) '.type']);
0073 if length(x{curve})-length(y{curve})
0074 disp('MakeFigure :: The number of observations in x doesn''t match with ')
0075 disp(['the number of observation in y for ' name ])
0076 return
0077 end
0078 if Info.PlotProperties.CutTop
0079 top(curve) = max(y{curve});
0080 else Info.PlotProperties.CutBottom
0081 bottom(curve) = min(y{curve});
0082 end
0083 binf(curve) = min(x{curve});
0084 bsup(curve) = max(x{curve});
0085 end
0086 ymax = max(top);
0087 ymin = min(bottom);
0088 xmin = min(binf);
0089 xmax = max(bsup);
0090 if isnan(ymin(plt))
0091 ymin = 0;
0092 end
0093 eval(['NAMES{' int2str(plt) '} = Info.Box' int2str(plt) '.name;'])
0094 if options_.TeX
0095 eval(['TeXNAMES{' int2str(plt) '} = Info.Box' int2str(plt) '.texname;'])
0096 end
0097 subplot(nr,nc,plt)
0098 hold on
0099 for curve = 1:NumberOfCurves
0100 hh = plot(x{curve},y{curve});
0101 if strcmpi(PltType{curve},'PriorDensity')
0102 set(hh,'Color',[0.7 0.7 0.7],'LineStyle','-','LineWidth',2)
0103
0104
0105 elseif strcmpi(PltType{curve},'DensityEstimate')
0106 set(hh,'Color','k','LineStyle','-','LineWidth',2)
0107
0108
0109 elseif strcmpi(PltType{curve},'ModeEstimate')
0110 set(hh,'Color','g','LineStyle','--','LineWidth',2)
0111
0112
0113 elseif strcmpi(PltType{curve},'SmoothVariable')
0114 set(hh,'Color','k','LineStyle','-','LineWidth',2)
0115
0116
0117 elseif strcmpi(PltType{curve},'Deciles')
0118 set(hh,'Color','g','LineStyle','-','LineWidth',1)
0119
0120
0121 elseif strcmpi(PltType{curve},'Forecasts')
0122 set(hh,'Color','','LineStyle','-','LineWidth',2)
0123
0124
0125 elseif strcmpi(PltType{curve},'ForecastsHPD')
0126 set(hh,'Color','k','LineStyle','-','LineWidth',1)
0127
0128
0129 elseif strcmpi(PltType{curve},'ForecastsDeciles')
0130 set(hh,'Color','g','LineStyle','-','LineWidth',1)
0131
0132
0133 elseif strcmpi(PltType{curve},'DiagnosticWithin')
0134 set(hh,'Color','b','LineStyle','-','LineWidth',2)
0135
0136
0137 elseif strcmpi(PltType{curve},'DiagnosticPooled')
0138 set(hh,'Color','r','LineStyle','-','LineWidth',2)
0139
0140
0141 end
0142 end
0143 axis([xmin xmax ymin ymax])
0144 title(NAMES{plt})
0145 drawnow
0146 hold off
0147 end
0148
0149 if Info.SaveFormat.Eps
0150 if isempty(Info.SaveFormat.Name)
0151 eval(['print -depsc2 ' M_.fname Info.SaveFormat.GenericName int2str(Info.SaveFormat.Number) '.eps']);
0152 else
0153 eval(['print -depsc2 ' M_.fname Info.SaveFormat.GenericName Info.SaveFormat.Name '.eps']);
0154 end
0155 end
0156 if Info.SaveFormat.Pdf && ~exist('OCTAVE_VERSION')
0157 if isempty(Info.SaveFormat.Name)
0158 eval(['print -dpdf ' M_.fname Info.SaveFormat.GenericName int2str(Info.SaveFormat.Number)]);
0159 else
0160 eval(['print -dpdf ' M_.fname Info.SaveFormat.GenericName Info.SaveFormat.Name]);
0161 end
0162 end
0163 if Info.SaveFormat.Fig && ~exist('OCTAVE_VERSION')
0164 if isempty(Info.SaveFormat.Name)
0165 saveas(FigHandle,[M_.fname Info.SaveFormat.GenericName int2str(Info.SaveFormat.Number) '.fig']);
0166 else
0167 saveas(FigHandle,[M_.fname Info.SaveFormat.GenericName Info.SaveFormat.Name '.fig']);
0168 end
0169 end