function panel_graph(t, y, x0, y0, z0, v0, vx, vy, vz, vw, eta, ye_end, ye_top, method, ye, approxi, X_B, Y_B, Z_B)

global p2 f1 f11
% function erzeugt 2D/3D Ausgabe fuer user-interface

%-----------------------------x-Werte fuer Boden---------------------------
if (y(length(y),1) == 0)
    x_start = -1;
    x_step = 2/10;
    x_end = 1;
else
    x_start = min(y(:,1)) - abs(max(y(:,1))/4);
    x_step = (abs(min(y(:,1))) + abs(max(y(:,1))) + abs(max(y(:,1))/2))/10;
    x_end = abs(max(y(:,1))) + abs(max(y(:,1))/4);
end

%-----------------y-Werte fuer Boden mit/ohne Wind-------------------------
if (vw == 0 | vw > 0 & eta == 0 | vw > 0 & eta == 180)
   y_start = y0 - 10;
   y_step = (2*y0 + 20)/10;
   y_end = y0 + 10;
else
   y_start = -(abs(y0) + abs(y(length(y),5))) -(abs(y0) + abs(y(length(y),5)))/3;
   y_step = 8/3*(abs(y0) + abs(y(length(y),5)))/10;
   y_end = (abs(y0) + abs(y(length(y),5))) + (abs(y0) + abs(y(length(y),5)))/3;
end


%---------------------------------Ebene------------------------------------
    [X1,Y1] = meshgrid(x_start:x_step:x_end,y_start:y_step:y_end);
    Z1 = X1;
    Z1(:,:)= 0;

%----------------------Graphische Ausgabe----------------------------------
%Bildschirmaufloesung ermitteln
scrsz = get(0,'ScreenSize');
colordef white;


%-------------------2D plot dx/dy------------------------------------------
f1 = figure(1);
f11 = subplot(2,2,1);
hold on;
p2 = plot(y(:,1)./1000,y(:,3)./1000,'r');
xlabel('Distanz (km)');
ylabel('Hoehe (km)');
title('Plot 1: Vergleichende Darstellung 2D');


%---------------------------3D plot----------------------------------------

f13 = subplot(2,2,3);
surf(X1,Y1,Z1,'EdgeColor','none');
hold on;
view(20,10);
title('Plot 2: Vergleichende Darstellung 3D');
xlabel('Distanz (m)');
%ylabel('Z-Koordinate (m)');
zlabel('Hoehe (m)');
pbaspect([2 1 1]);
        
%Flugbahn
p3 = plot3(y(:,1),y(:,5),y(:,3),'Color','r', 'LineWidth',3);
            
 
