% add vector to data vector in subplots
% this is set up for oplot4 so it assumes each plot has three lines
lh=input('Load figure handle? (y/n)','s');
if isempty(lh);lh='n';end
if deblank(lh)=='y';
    if ~exist('allhand','var')
        allhand={0};
    end
    hh=ls('handle*');
    hh=char(strread(hh,'%s'));
    
    disp( [num2str([1:size(hh,1)]'),repmat(' ',size(hh,1),1),hh]);
    nhh=input('Give # of handle to be loaded >>');
    
   kkh=load(hh(nhh,:));
   jstnm=char(regexp(hh(nhh,:),'.*(?=\.)','match'));
   eval([jstnm,'= kkh.handle_subp;']);
   allhand{end+1,1}=eval(jstnm);
   handle_subp=eval(jstnm);
   disp('existing IRFs in field kkh.allirf')
   disp(kkh.allirf)
   disp('can address this referring to structure kkh.allirf.<irf>')
end
    
    
xx=input('Give vector to be added [oplot4 is x100] ==>> ');
style=input('Keep line stile? (y/style) default y >> ','s');
if isempty(style);style='y';end
for kk=1:size(handle_subp,2);
    for jj=1:size(handle_subp,1);
        if handle_subp(jj,kk)~=0
            hh=get(handle_subp(jj,kk));
            
            if isempty(strmatch(deblank(style),'y'))
             ff=get(hh.Children,'LineStyle');
             ff{2}=char(style);
            set(hh.Children,{'LineStyle'}, ff);
            end
            tit=get(hh.Title,'String');
            
            doit=input(['Change the ',tit,' series?(y/n; default n) >> '],'s');
            if isempty(doit);doit='n';end
            if isempty(strmatch(deblank(doit),'n'))
                uu=get(hh.Children,'YData');
                uu{3}=uu{1};
                uu2=uu{2};

                if length(uu2)~=length(xx);
                    error('Vectors don''t conform')
                else
                    uu{2}=uu2+xx(:)';
                    set(hh.Children,{'YData'},uu);
                    gg=get(hh.Children,'Marker');
                    ggc=get(hh.Children,'Color');
               plot(handle_subp(jj,kk),time(1:freq:end),uu{2}(time(1:freq:end)),'LineStyle','none','Marker',gg{3},'MarkerSize',4,'Color',ggc{3});

                    
                end
                axis(handle_subp(jj),'tight')
            end
        end
    end
end

