function Graphs = Graphs(precause)         
% reading data from accelerometer
% sample [tim, 0.19, -0.04, 1.06], 
% non-zero fileload indicates already loaded xyz, cas matrices
    if(strcmp(precause, 'auto'))
        load('auto/auto');
    else
        load('autobus/bus');
    end
   vec400 = 0.0025.*(1:(numel(xyz(1:320,1,:))+ numel(xyz(1,1,:))*80));                        
%   x - acceleration signal
for i = 1:3
    figure((i-1)*5+1)
    pom =zeros(400, 1, numel(xyz(1,i,:)));      % delays between writing data to SD card will be filled with zeros
    pom(1:320,1,:) = xyz(:,i,:);
    pom1 = reshape(pom(1:400,1,:),1, numel(pom(1:400,1,:)));
    if(i == 3)      % in main axis, 1g must substitute zero (or -1g in case of setting measure box in car)
        switch precause
            case 'auto'
                pom1(pom1==0) = -1;
            otherwise
                pom1(pom1==0) = 1;
        end
    end
    [AX] = plot(double(vec400)./3600, pom1.*10);
    %every line mark place where samples come from
    line([vec400((400*999))./3600 vec400((400*999+319))./3600],[-20 20],  'Color',[1 0 0], 'LineWidth',2);
    line([vec400((400*2999))./3600 vec400((400*2999+319))./3600],[-20 20],  'Color',[1 0 0], 'LineWidth',2);
    line([vec400((400*9999))./3600 vec400((400*9999+319))./3600],[-20 20],  'Color',[1 0 0], 'LineWidth',2);
    switch precause
            case 'auto'
               line([vec400((400*11999))./3600 vec400((400*11999+319))./3600],[-20 20],  'Color',[1 0 0], 'LineWidth',2);
            otherwise
               line([vec400((400*12999))./3600 vec400((400*12999+319))./3600],[-20 20],  'Color',[1 0 0], 'LineWidth',2);
    end;
    xlim([0 4])
    xlabel('t (hod)');
    switch i
        case 1
            ylabel('a_x (ms^{-2})');
        case 2 
            ylabel('a_y (ms^{-2})');
        case 3
            ylabel('a_z (ms^{-2})');
    end
    % graphical modifications
    set(get(get(AX, 'Parent'), 'XLabel'),'FontSize',16);
    set(get(get(AX, 'Parent'), 'YLabel'), 'FontSize',16);
    set(get(AX, 'Parent'), 'FontSize',14);
    %********************
    grid on;
    for j = 1:4                                                     % positions of samples to be examined must be choosen depending on acceleration time histories
        switch j
            case 1 
                timev = vec400((400*999):(400*999+319));
                datav = pom1((400*999):(400*999+319)).*10;              
            case 2 
                timev = vec400((400*2999):(400*2999+319));
                datav = pom1((400*2999):(400*2999+319)).*10;
            case 3 
                timev = vec400((400*9999):(400*9999+319));
                datav = pom1((400*9999):(400*9999+319)).*10;
                
            case 4 
                switch precause
                case 'auto'
                    timev = vec400((400*11999):(400*12999+319));
                    datav = pom1((400*11999):(400*12999+319)).*10;
                otherwise
                     timev = vec400((400*12999):(400*12999+319));
                     datav = pom1((400*12999):(400*12999+319)).*10;
                end;
        end
       %create different samples      time vector / data samples / Fs =
       %400Hz  / figure index
       fftr(timev, datav, 400, (i-1)*5+1+j);              
    end
end