How to | グラフィックスをカスタマイズする方法
Wolfram言語では,グラフィックスをさまざまなオプションを使って2Dおよび3Dのグラフィックスをカスタマイズすることができる.
Plotによって作成されるデフォルトのグラフィックスは,さまざまなデフォルトのオプション値を使う:
Plot[Sin[x], {x, 0, 2π}]Plot[Sin[x], {x, 0, 2π}, PlotLabel -> Sin[x]]Plot[Sin[x], {x, 0, 2π}, PlotLabel -> Style[Sin[x], {Red, 18}]]Plot[Sin[x], {x, 0, 2π}, PlotStyle -> Directive[Thick, Dashed, Red]]Plot[Sin[x], {x, 0, 2π}, AxesStyle -> Directive[Thick, Dashed, Red]]Plot[Sin[x], {x, 0, 2π}, LabelStyle -> Directive[Thick, Dashed, Red]]Plot[Sin[x], {x, 0, 2π}, Prolog -> {Red, PointSize[0.02], Point[{{π / 2, 1}, {3π / 2, -1}}]},
Epilog -> {Green, PointSize[0.02], Point[{{0, 0}, {π, 0}, {2π, 0}}]}]プロットにスタイル付けされたグラフィックスプリミティブをいくつか加える:
Plot[Sin[x], {x, 0, 2π}, Epilog -> {
{Red, Text["extrema", {4, 0.5}, {-1, -1}]},
{Blue, Arrowheads[{-0.04, 0.04}], Arrow[{{π / 2, 1}, {4, 0.5}, {3π / 2, -1}}]}}]Plot3Dを使って作成したデフォルトのグラフィックスには,さまざまなデフォルトのオプション値が使われている:
Plot3D[Sin[x] + Sin[y], {x, -6, 6}, {y, -6, 6}]Plot3D[Sin[x] + Sin[y], {x, -6, 6}, {y, -6, 6}, Boxed -> False, AxesOrigin -> {-6, -6, -2}]Plot3D[{-x ^ 4 - y ^ 4, x ^ 2 + y ^ 2, (x / 1.3) ^ 5 + (y / 1.3) ^ 5}, {x, -2, 2}, {y, -2, 2}]Plot3D[{-x ^ 4 - y ^ 4, x ^ 2 + y ^ 2, (x / 1.3) ^ 5 + (y / 1.3) ^ 5}, {x, -2, 2}, {y, -2, 2}, RegionFunction -> Function[{x, y, z}, x ^ 4 + y ^ 4 ≤ 4]]Plot3D[{-x ^ 4 - y ^ 4, x ^ 2 + y ^ 2, (x / 1.3) ^ 5 + (y / 1.3) ^ 5} , {x, -2, 2}, {y, -2, 2}, RegionFunction -> Function[{x, y, z}, x ^ 4 + y ^ 4 ≤ 4], Mesh -> None, Lighting -> {{"Point", Yellow, {0, -5, -5}}, {"Point", Blue, {0, 3, 3}}, {"Point", Red, {-3, -3, 0}}, {"Point", Green, {5, 5, 0}}}]Plot3D[{-x ^ 4 - y ^ 4, x ^ 2 + y ^ 2, (x / 1.3) ^ 5 + (y / 1.3) ^ 5}, {x, -2, 2}, {y, -2, 2}, RegionFunction -> Function[{x, y, z}, x ^ 4 + y ^ 4 ≤ 4], BoxRatios -> {1, 1, 1}, Axes -> False, Background -> Black, Boxed -> False, Mesh -> None]