TE^AJ IZ MATHEMATICE

3. DEL

Bor Plestenjak

Dvorazse`na grafika

Risanje eksplicitno podanih krivulj

slika1=Plot[Sin[x],{x,-5,5}]

slika2=Plot[{Sin[x],Sin[2x],Sin[3x]},{x,0,2Pi}]

linfun=Table[c x,{c,1,5}]

slika3=Plot[Evaluate[linfun],{x,-5,5}]

slika4=Plot[Tan[x],{x,-5,5}]

Show[slika1]

Kako prekrijemo slike eno ~ez drugo

Show[slika1,slika4,PlotRange->{-2,2}]

Kako spravimo ve~ slik eno zraven druge

slike=GraphicsArray[{{slika1,slika2},{slika3,slika4}}]

Show[slike]

Spreminjanje oblike slik

Dolo~anje obmo~ja

Plot[Tan[x],{x,-5,5},PlotRange->{-3,3}]

Plot[Tan[x],{x,-5,5},PlotRange->{{-10,10},{-5,5}}]

Spreminjanje razmerja enot na oseh

Show[slika1,AspectRatio->1]

Osi, okvir in mre`a

Show[slika1,Frame->True,Axes->False]

Show[slika1,Ticks->{{-3,0,3},{-1,0,1}}]

Show[slika1,Ticks->{{{-Pi,"-Pi"},{Pi,"Pi"}},{-1,1}}]

Opremljanje slik z napisi

Show[slika1,PlotLabel->"Graf sinusa",AxesLabel->{"os x","Sin[x]"}]

Show[slika1,PlotLabel->"Graf sinusa",Frame->True,
FrameLabel->{"Spodaj","Levo","Zgoraj","Desno"}]

Spreminjanje natan~nosti slike

Plot[Sin[50 x],{x,0,Pi}]

Plot[Sin[50 x],{x,0,Pi},PlotPoints->100]

Razli~ne oblike ~rt

Plot[Sin[x],{x,-5,5},PlotStyle->RGBColor[0,0,1]]

Plot[{Sin[x],Sin[2x],Sin[3x]},{x,0,2Pi},
PlotStyle->{RGBColor[1,0,0],Thickness[0.02],Dashing[{0.05,0.05}]}]

Plot[{Sin[x],Sin[2x],Sin[3x]},{x,0,2Pi},
PlotStyle->{{RGBColor[0,1,0],Dashing[{0.05,0.05}]},GrayLevel[0.5],
Dashing[{0.01,0.05,0.05,0.05}]}]

ListPlot

kvad=Table[i^2,{i,1,15}]
ListPlot[kvad]

ListPlot[{{1,2},{2,5},{3,8},{4,5},{5,5},{6,1}},PlotJoined->True]

Risanje implicitno podanih krivulj

<<Graphics`ImplicitPlot`

ImplicitPlot[{x^2+x y^2==5,x^2-y^2==5},{x,-4,4},{y,-4,4}]

Notranja struktura dvodimenzionalne grafike

Show[Graphics[{Point[{3,3}],Line[{{1,2},{2,3},{3,1}}],Circle[{2,2},0.2],
Circle[{2,3},{0.1,0.4}],Disk[{1,1},0.2], Polygon[{{1,0},{2,1},{3,0},{1,0}}]}]]

Trorazse`na grafika

slika5=Plot3D[Sin[x] Cos[y],{x,-Pi,Pi},{y,-Pi,Pi}]

Show[slika5,ViewPoint->{0,0,1}]

ContourPlot[Sin[x] Cos[y],{x,-Pi,Pi},{y,-Pi,Pi}]

DensityPlot[Sin[x] Cos[y],{x,-Pi,Pi},{y,-Pi,Pi}]

Spreminjanje oblike tridimenzionalne grafike

Show[slika5,Boxed->False,Mesh->False]

Notranja struktura trodimenzionalne grafike

Show[Graphics3D[{Line[{{0,0,0},{3,0,0},{4,4,4}}], Cuboid[{1,1,1},{2,2,2}],
Polygon[{{3,0,1},{4,1,2},{2,3,3}}]}]]