Grafy III ContourPlot Sestrojení obrysového grafu. Vytvoří "topografickou mapu" funkce dvou proměnných. Obrysy spojují body se stejnou hodnotou a graf je vystínován dle hodnoty (čím vyšší hodnota, tím světlejší barva). ContourPlot[funkce, {x, xmin, xmax }, {y, ymin , ymax }] ContourPlot@Cos @x ∗ yD, 8x, 0, 2 π<, 8y, 0, 2 π
Parametry funkce ContourPlot Options@ContourPlotD 8AlignmentPoint → Center, AspectRatio → 1, Axes → False, AxesLabel → None, AxesOrigin → Automatic, AxesStyle → 8<, Background → None, BaselinePosition → Automatic, BaseStyle → 8<, BoundaryStyle → None, BoxRatios → Automatic, ClippingStyle → None, ColorFunction → Automatic, ColorFunctionScaling → True, ColorOutput → Automatic, ContentSelectable → Automatic, ContourLabels → None, ContourLines → True, Contours → Automatic, ContourShading → Automatic, ContourStyle → Automatic, CoordinatesToolOptions → Automatic, DisplayFunction $DisplayFunction, Epilog → 8<, Evaluated → Automatic, EvaluationMonitor → None, Exclusions → Automatic, ExclusionsStyle → None, FormatType TraditionalForm, Frame → True, FrameLabel → None, FrameStyle → 8<, FrameTicks → Automatic, FrameTicksStyle → 8<, GridLines → None, GridLinesStyle → 8<, ImageMargins → 0., ImagePadding → All, ImageSize → Automatic, ImageSizeRaw → Automatic, LabelStyle → 8<, LightingAngle → None, MaxRecursion → Automatic, Mesh → None, MeshFunctions → 8<, MeshStyle → Automatic, Method → Automatic, PerformanceGoal $PerformanceGoal, PlotLabel → None, PlotPoints → Automatic, PlotRange → 8Full, Full, Automatic<, PlotRangeClipping → True, PlotRangePadding → Automatic, PlotRegion → Automatic, PreserveImageOptions → Automatic, Prolog → 8<, RegionFunction → HTrue &L, RotateLabel → True, Ticks → Automatic, TicksStyle → 8<, WorkingPrecision → MachinePrecision<
2
cviceni_04_grafy_3.nb
ColorFunction ... nastavení barevné funkce jednotlivých úrovní
ü ContourShading ... určuje, zda graf bude stínován Hodnota - True, False ContourPlot@Cos @x ∗ yD, 8x, 0, 2 π<, 8y, 0, 2 π<, ContourShading → FalseD
ü Contours ... určení celkového počtu obrysů (úrovní) Nastavení : Contours -> Počet ContourPlot@Cos @x ∗ yD, 8x, 0, 2 π<, 8y, 0, 2 π<, Contours → 100D
cviceni_04_grafy_3.nb
ContourLines ... určuje, zda budou vykresleny obrysové čáry Hodnota - True, False ContourPlot@Cos @x ∗ yD, 8x, 0, 2 π<, 8y, 0, 2 π<, ContourLines → FalseD 6
5
4
3
2
1
0 0
1
2
3
4
5
6
DensityPlot Graf hustoty. Tento graf je velmi podobný obrysovému grafu, s tím rozdílem, že hodnoty jsou vykresleny do pravidelných čtvercových polí. DensityPlot[funkce, {x, xmin, xmax }, {y, ymin , ymax }] DensityPlot@Cos @x ∗ yD, 8x, 0, 2 π<, 8y, 0, 2 π
3
4
cviceni_04_grafy_3.nb
Parametry funkce DensityPlot Options @DensityPlotD 8AlignmentPoint → Center, AspectRatio → 1, Axes → False, AxesLabel → None, AxesOrigin → Automatic, AxesStyle → 8<, Background → None, BaselinePosition → Automatic, BaseStyle → 8<, BoundaryStyle → None, BoxRatios → Automatic, ClippingStyle → None, ColorFunction → Automatic, ColorFunctionScaling → True, ColorOutput → Automatic, ContentSelectable → Automatic, CoordinatesToolOptions → Automatic, DisplayFunction $DisplayFunction, Epilog → 8<, Evaluated → Automatic, EvaluationMonitor → None, Exclusions → Automatic, ExclusionsStyle → None, FormatType TraditionalForm, Frame → True, FrameLabel → None, FrameStyle → 8<, FrameTicks → Automatic, FrameTicksStyle → 8<, GridLines → None, GridLinesStyle → 8<, ImageMargins → 0., ImagePadding → All, ImageSize → Automatic, ImageSizeRaw → Automatic, LabelStyle → 8<, LightingAngle → None, MaxRecursion → Automatic, Mesh → None, MeshFunctions → 81 &, 2 &<, MeshShading → None, MeshStyle → Automatic, Method → Automatic, PerformanceGoal $PerformanceGoal, PlotLabel → None, PlotPoints → Automatic, PlotRange → 8Full, Full, Automatic<, PlotRangeClipping → True, PlotRangePadding → Automatic, PlotRegion → Automatic, PreserveImageOptions → Automatic, Prolog → 8<, RegionFunction → HTrue &L, RotateLabel → True, Ticks → Automatic, TicksStyle → 8<, WorkingPrecision → MachinePrecision<
ü Mesh ... zobrazení nebo skrytí síťování Hodnota - True, False DensityPlot@Cos @x ∗ yD, 8x, 0, 2 π<, 8y, 0, 2 π<, Mesh → TrueD
ü PlotPoints ... počet vykreslovaných bodů ve směru jednotlivých os PlotPointsØPocet PlotPointsØ{PocetX,PocetY}
cviceni_04_grafy_3.nb
DensityPlot@Cos @x ∗ yD, 8x, 0, 2 π<, 8y, 0, 2 π<, Mesh → True, PlotPoints → 5D
DensityPlot@Cos @x ∗ yD, 8x, 0, 2 π<, 8y, 0, 2 π<, Mesh → True, PlotPoints → 100D
Graf s logaritmickým měřítkem ü LogPlot ... Logaritmické měřítko na ose Y LogPlot[funkce, {x, xmin, xmax }]
5
6
cviceni_04_grafy_3.nb
LogPlotAx2 , 8x, 1, 20<E
100 50
10 5
5
10
15
20
ü LogLogPlot ... Logaritmické měřítko na ose X a Y LogLogPlot[funkce, {x, xmin, xmax }] LogLogPlotAx2 , 8x, 1, 20<E
100 50
10 5
1.5
2.0
3.0
5.0
7.0
10.0
Sloupcový graf ü BarChart ... Sloupcový graf BarChart[{listhodnot1,listhodnot2,...,listhodnotN}] BarChart@881, 2, 3<, 81, 3, 2<
15.0
20.0
cviceni_04_grafy_3.nb
Parametry funkce BarChart Options@BarChartD :AlignmentPoint → Center, AspectRatio →
1
, Axes → True, GoldenRatio AxesLabel → None, AxesOrigin → Automatic, AxesStyle → 8<, Background → None, BarOrigin → Bottom, BarSpacing → Automatic, BaselinePosition → Automatic, BaseStyle → 8<, ChartBaseStyle → Automatic, ChartElementFunction → Automatic, ChartElements → Automatic, ChartLabels → None, ChartLayout → Automatic, ChartLegends → None, ChartStyle → Automatic, ColorFunction → Automatic, ColorFunctionScaling → True, ColorOutput → Automatic, ContentSelectable → Automatic, CoordinatesToolOptions → Automatic, DisplayFunction $DisplayFunction, Epilog → 8<, FormatType TraditionalForm, Frame → False, FrameLabel → None, FrameStyle → 8<, FrameTicks → Automatic, FrameTicksStyle → 8<, GridLines → None, GridLinesStyle → 8<, ImageMargins → 0., ImagePadding → All, ImageSize → Automatic, ImageSizeRaw → Automatic, Joined → False, LabelingFunction → Automatic, LabelStyle → 8<, LegendAppearance → Automatic, Method → Automatic, PerformanceGoal $PerformanceGoal, PlotLabel → None, PlotRange → All, PlotRangeClipping → False, PlotRangePadding → Automatic, PlotRegion → Automatic, PreserveImageOptions → Automatic, Prolog → 8<, RotateLabel → True, Ticks → Automatic, TicksStyle → 8<>
ü BarOrigin ... nastavení směru vykreslení sloupců Hodnota : Left, Top, Right, Bottom BarChart@881, 2, 3<, 81, 3, 2<<, BarOrigin → LeftD
7
8
cviceni_04_grafy_3.nb
ü ChartLegends ... legenda grafu BarChart@881, 2, 3<, 81, 3, 2<<, ChartLegends → 8"A", "B", "C"
A B C
ü ChartLabels ... popisky na ose grafu BarChart@881, 2, 3<, 81, 3, 2<<, ChartLabels → 88"1", "2"<, 8"A", "B", "C"<
BarChart@881, 2, 3<, 81, 3, 2<<, ChartLabels → 88"1", "2"<, None
cviceni_04_grafy_3.nb
ü ChartStyle ... nastavení stylu vykreslení sloupců BarChart@881, 2, 3<, 81, 3, 2<<, ChartStyle → 8Red, Green, Blue
BarChart@881, 2, 3<, 81, 3, 2<<, ChartStyle → "SolarColors"D
BarChart@881, 2, 3<, 81, 3, 2<<, ChartStyle → 8EdgeForm@DashedD
9
10
cviceni_04_grafy_3.nb
ü ChartElements ... nastavení vykreslovacích prvků BarChart@881, 2, 3<, 81, 3, 2<<, ChartElements → Graphics@Disk@DDD
g = ExampleData@8"Geometry3D", "Horse"
ü ChartElementFunction ... nastavení stylu vykreslení sloupců In[54]:= Out[54]=
ChartElementData@BarChartD 8FadingRectangle, GlassRectangle, GradientRectangle, GradientScaleRectangle, ObliqueRectangle, Rectangle, SegmentScaleRectangle<
cviceni_04_grafy_3.nb
BarChart@881, 2, 3<, 81, 3, 2<<, ChartElementFunction → "GlassRectangle"D
Kruhový výsečový graf ü PieChart ... Kruhový výsečový graf PieChart[listhodnot1] PieChart@830, 50, 20
11
12
cviceni_04_grafy_3.nb
PieChart@8830, 50, 20<, 820, 20, 60<
Parametry funkce PieChart Options@PieChartD 8AlignmentPoint → Center, AspectRatio → Automatic, Axes → False, AxesLabel → None, AxesOrigin → Automatic, AxesStyle → 8<, Background → None, BaselinePosition → Automatic, BaseStyle → 8<, ChartBaseStyle → Automatic, ChartElementFunction → Automatic, ChartLabels → None, ChartLayout → Automatic, ChartLegends → None, ChartStyle → Automatic, ColorFunction → Automatic, ColorFunctionScaling → True, ColorOutput → Automatic, ContentSelectable → Automatic, CoordinatesToolOptions → Automatic, DisplayFunction $DisplayFunction, Epilog → 8<, FormatType TraditionalForm, Frame → False, FrameLabel → None, FrameStyle → 8<, FrameTicks → Automatic, FrameTicksStyle → 8<, GridLines → None, GridLinesStyle → 8<, ImageMargins → 0., ImagePadding → All, ImageSize → Automatic, ImageSizeRaw → Automatic, LabelingFunction → Automatic, LabelStyle → 8<, LegendAppearance → Automatic, Method → Automatic, PerformanceGoal $PerformanceGoal, PlotLabel → None, PlotRange → Automatic, PlotRangeClipping → False, PlotRangePadding → Automatic, PlotRegion → Automatic, PolarAxes → False, PolarAxesOrigin → Automatic, PolarGridLines → None, PolarTicks → Automatic, PreserveImageOptions → Automatic, Prolog → 8<, RotateLabel → True, SectorOrigin → Automatic, SectorSpacing → Automatic, Ticks → Automatic, TicksStyle → 8<, TicksStyle → 8<<
cviceni_04_grafy_3.nb
ü ChartLegends ... legenda grafu PieChart@830, 50, 20<, ChartLegends → 8"A", "B", "C"
A B C
ü ChartStyle ... nastavení stylu vykreslení sloupců PieChart@830, 50, 20<, ChartStyle → "Rainbow"D
ü ChartElementFunction ... nastavení stylu vykreslení sloupců In[53]:= Out[53]=
ChartElementData@PieChartD 8GlassSector, GradientSector, NoiseSector, OscillatingSector, PlateauSector, Sector, SquareWaveSector, TriangleWaveSector<
13
14
cviceni_04_grafy_3.nb
PieChart@830, 50, 20<, ChartElementFunction → "GlassSector"D
ü ChartLabels ... popisky grafu PieChart@830, 50, 20<, ChartLabels → 8"A", "B", "C"
cviceni_04_grafy_3.nb
PieChart@830, 50, 20<, ChartLabels → Placed@8"A", "B", "C"<, "RadialCallout"DD
15