function graph_manipul_2(gtf,xx,style,col);
% Change (single) line style in multiple plots
% and add vector to data vector in subplots (e.g. trend)
% @ giovanni.lombardo@ecb.int: 22 May 2008

if isempty(gtf)
gtf=input('Get handle from particular figure? (fig # if yes) >> ');
end

if ~isempty(gtf)
    handle_subp=get(figure(gtf),'Children');
end

% if isempty(xx)
% xx=input('Give vector to be added [check out scale: x100?] ==>> ');
% end
if isempty(xx);
    emptyxx=1;
else
    emptyxx=0;
end
if isempty(style)
style=input('Keep line Style? (y/style) default y >> ','s');
end
if isempty(col)
col=input('Give color [k,b,r,y,g] if want to change it >>','s');
end

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');
                if size(ff,1)==1
                    tmpff{1,1}=ff;
                    ff=tmpff;
                end

                ffc=get(hh.Children,'Color');
                if size(ffc,1)==1
                    tmpffc{1,1}=ffc;
                    ffc=tmpffc;
                end
                ffm=get(hh.Children,'Marker');
                if size(ffm,1)==1
                    tmpffm{1,1}=ffm;
                    ffm=tmpffm;
                end
                if size(ffm,1)>1
                    ffm{2}=char('none');
                end
                ff{1}=char(style);

                set(hh.Children,{'LineStyle'}, ff);
                if ~isempty(col);
                    ffc{1}=char(col);
                    set(hh.Children,{'Color'}, ffc);
                end


                set(hh.Children,{'Marker'}, ffm);
            end
            tit=get(hh.Title,'String');
            if emptyxx
                doit='y';
            else
                doit=input(['Change the ',tit,' series?(y/n; default n) >> '],'s');
            end
            if isempty(doit);doit='n';end
            if isempty(strmatch(deblank(doit),'n'))


                uu=get(hh.Children,'YData');
                if ~iscell(uu);
                    tmpuu{1,1}=uu(1:end);
                    uu=tmpuu;
                end


                %                 if size(uu,1)>2;
                %                     error('max number of lines per panel = 2');
                %                 end

                ttmm=[];
                for cn=1:size(uu,1);
                    ttmm(cn,1)=size(uu{cn},2);
                end
                [ii,ser]=max(ttmm);
                %                 uu{3}=uu{1};
                if size(uu,1)>1
                    gg=setdiff([1:length(uu)]',ser);

                    uu{gg}=[];
                end
                uu2=uu{ser};
                if isempty(xx);
                    xx=zeros(length(uu2),1);
                end

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


                end
                axis(handle_subp(jj),'tight')
            end
        end
    end
end
nmsave=input('Give name to print figure (eps & pdf) >> ','s' );
if ~isempty(nmsave)
    if ~exist('../figures','dir');
        mkdir('../figures');
    end
    print(gcf,'-depsc2','-r800',[nmsave])
    [a,b]=system(['epstopdf ',[nmsave,'.eps']]);
    saveas(gcf,[nmsave,'.fig']);
    %if epstopdf is not installed use the following (the margins are not optimal though)
    %     [a,b]=system(['ps2pdf ',[nmsave,'.eps']]);
    [a,b]=system(['mv ',[nmsave,'.eps '],' ',[nmsave,'.pdf'],' ',[nmsave,'.pdf'],' ','../figures/.']);
end


