# trochu vice o grafickych funkcich
clear;
clc;
# vymazeme nastaveni vykreslovani
__gnuplot_raw__ "reset;";
# nastavuje opet vykresleni plnou carou
__gnuplot_set__ data style lines;
printf("U dvourozmernych grafu musime definovat nezavislou promennou\n")
printf("x=0:pi/4:10\n");
x=0:pi/4:10
printf("Vykreslime graf: plot(x,sin(x))\n");
printf ("Stisknete libovolnou klavesu...\n");
pause
plot(x,sin(x));
printf("Presnejsi deleni: x=0:pi/100:10\n");
printf ("Stisknete libovolnou klavesu...\n");
pause
x=0:pi/100:10;
plot(x,sin(x));
printf("Vykreslime i body: plot(x,sin(x),'-o')\n");
printf ("Stisknete libovolnou klavesu...\n");
pause
x=0:pi/4:10
plot(x,sin(x),"-*")
printf("...zmenime barvu: plot(x,sin(x),'-b')\n");
printf ("Stisknete libovolnou klavesu...\n");
pause
x=0:pi/100:10;
plot(x,sin(x),'-b')
printf("vice grafu najednou: plot(x,sin(x),x,cos(x))\n");
printf ("Stisknete libovolnou klavesu...\n");
pause
plot(x,sin(x),x,cos(x))
printf("Mrizka a vymazani popisek:\n");
printf("__gnuplot_set__ grid\n");
printf("__gnuplot_set__ tics out\n");
printf("__gnuplot_set__ nokey\n");
printf("replot\n");
printf ("Stisknete libovolnou klavesu...\n");
pause
__gnuplot_set__ grid
__gnuplot_set__ tics out
__gnuplot_set__ nokey
replot
printf("Dalsi styly kresby a barvy:\n");
printf("plot(x,sin(x),'^m',x,cos(x),'ob')\n");
printf("Stisknete libovolnou klavesu...\n");
pause
plot(x,sin(x),'^m',x,cos(x),'ob');
printf("Prirozeny logaritmus: plot(x,log(x))\n");
printf("Stisknete libovolnou klavesu...\n");
pause
plot(x,log(x));
printf("Musime zmenit rozsah os\n");
printf("__gnuplot_set__ yrange [-10:]\n");
printf("Stisknete libovolnou klavesu...\n");
pause
__gnuplot_set__ yrange [-10:]
replot
printf("Logaritmicka stupnice: semilogx(x,log(x))\n");
printf("Stisknete libovolnou klavesu...\n");
pause
semilogx(x,log(x));
printf("Opet zmenime rozsahy na osach:\n");
printf("__gnuplot_set__ xrange [0.1:]\n");
printf("__gnuplot_set__ yrange [-4:]\n");
printf("a tisk desetinne carky: __gnuplot_set__ decimalsign ','\n");
printf("Stisknete libovolnou klavesu...\n");
pause
__gnuplot_set__ xrange [0.1:]
__gnuplot_set__ yrange [-4:]
__gnuplot_set__ decimalsign ','
semilogx(x,log(x));
printf("Zrusime nastaveni obrazku a jeste zkusime plne krivky:\n");
printf(" __gnuplot_set__ style data filledcurves y1=0\n");
printf("data=[x', sin(x)']\n");
printf("gplot data with filledcurves\n");
printf("Stisknete libovolnou klavesu...\n");
pause
# rusi vsechna nastaveni obrazku
__gnuplot_raw__ "reset;";
__gnuplot_set__ data style lines;
#
__gnuplot_set__ style data filledcurves y1=0
data=[x', sin(x)'];
gplot data
printf("Nakonec parametricke kresby krivek\n");
printf("plot(r.*cos(phi),r.*sin(phi),...)\n");
printf("1.krivka: r roste od 0 do 360, tj. r=phi\n");
printf("2.krivka: r=2*sin(2*phi)\n");
printf("Stisknete libovolnou klavesu...\n");
pause
# rusi vsechna nastaveni obrazku
__gnuplot_raw__ "reset;";
__gnuplot_set__ style data lines;
__gnuplot_set__ data style lines;
#
clc
phi=linspace(0,8*pi,361);
r=linspace(0,2,361);
plot(r.*cos(phi),r.*sin(phi),2*sin(2*phi).*cos(phi),2*sin(2*phi).*sin(phi));
printf("Jeste chceme stejne meritko na osach: axis('equal')\n");
printf("Stisknete libovolnou klavesu...\n");
pause
axis('equal')
printf("...pripadne osy vypnout: axis('off')\n");
printf("Stisknete libovolnou klavesu...\n");
pause
axis('off')
printf("...pripadne xobrazit osy pocatkem: __gnuplot_set__ xzeroaxis lt -1\n");
printf(" a replot\n");
printf("Stisknete libovolnou klavesu...\n");
pause
__gnuplot_set__ xzeroaxis lt -1
__gnuplot_set__ yzeroaxis lt -1
replot
printf("Stisknete libovolnou klavesu...\n");
pause
# rusi vsechna nastaveni obrazku
__gnuplot_raw__ "reset;";
__gnuplot_set__ data style lines;
