% Einfaches Plot
figure(1);
x = -pi:0.1:pi;
y = sin(x);
plot(x,y);

% Mehrere Kurven I
figure(2);
x = -pi:0.1:pi;
plot(x,sin(x),x,cos(x));

% Mehrere Kurven II, Farbe, Linestyles
figure(3);
x = -4:0.2:4;
hold on;
plot(x,x.^3/7-2*x, 'r-.');
plot(x,x.^2/2-4,'g->');
plot(x,-x.^4/20+4,'k:o');
hold off;

% Legenden und Gitter
figure(4);
x = 0:0.01:2;
y1 = x.*x;
y2 = sqrt(x);
hold on;
grid on;
plot(x,y1,x,y2);
legend('x^2','sqrt(x)');
hold off;

% Direktes Plotten von Funktionen
figure(5);
hold on;
axis([-pi pi -1.5 1.5]);
fplot('sin(x)',[-pi,pi],'r:');
fplot('cos(x)',[-pi,pi],'g--');
fplot('tan(x)',[-pi,pi],'b');
hold off;

% 3D-Plot
figure(6);
[x,y] = meshgrid(-10:0.5:10);
z = 2 * sin(x) + y;
surf(x,y,z);

% Balkendiagramm
figure(7);
verteilung = randn(1,10);
bar(verteilung);

% Tortendiagramm
figure(8);
ergebnis = [47.5 22.2 30.3];
pie(ergebnis);

% Scatter Plot
figure(9);
x = randn(1,1000);
y = randn(1,1000);
scatter(x,y);

% Boxplot
x = randn(10,10);
boxplot(x);

