## 2D Graphics

2次元のグラフを書かせてみよう(Plot)．
In[36]:=
`Plot[ Sin[x^2], {x,-Pi,Pi} ]`
Out[36]=
`-Graphics-`

In[37]:=
`Plot[ Sin[x^2], {x,-Pi,Pi}, AspectRatio->Automatic ]`
Out[37]=
`-Graphics-`
AxesオプションをFalseに設定すると，xy軸が表示されない．
In[38]:=
```Plot[ Sin[x^2], {x,-Pi,Pi}, AspectRatio->Automatic,
Axes->False ]```
Out[38]=
`-Graphics-`
どのようなオプションがあるか見てみよう．
In[39]:=
`??Plot`
Out[39]=
```Plot[f, {x, xmin, xmax}] generates a plot of f as a
function of x from xmin to xmax. Plot[{f1, f2, ...},
{x, xmin, xmax}] plots several functions fi.

Attributes[Plot] = {HoldAll, Protected}

Options[Plot] =
{AspectRatio -> GoldenRatio^(-1), Axes -> Automatic,
AxesLabel -> None, AxesOrigin -> Automatic,
AxesStyle -> Automatic, Background -> Automatic,
ColorOutput -> Automatic, Compiled -> True,
DefaultColor -> Automatic, Epilog -> {},
Frame -> False, FrameLabel -> None,
FrameStyle -> Automatic, FrameTicks -> Automatic,
GridLines -> None, MaxBend -> 10.,
PlotDivision -> 20., PlotLabel -> None,
PlotPoints -> 25, PlotRange -> Automatic,
PlotRegion -> Automatic, PlotStyle -> Automatic,
Prolog -> {}, RotateLabel -> True,
Ticks -> Automatic, DefaultFont :> \$DefaultFont,
DisplayFunction :> \$DisplayFunction}```
オプションを変えると，いろいろな表示ができる．
In[40]:=
```Plot[ Sin[x^2], {x,-Pi,Pi}, Axes->None, Frame->True,
FrameLabel->{"x","sin(x^3)"}, GridLines->Automatic,
PlotStyle->{{GrayLevel[0.3],Thickness[0.03]}} ]```
Out[40]=
`-Graphics-`
2つの関数のグラフを表示してみよう．
In[41]:=
`f1[x_] := 2 Sin[x]; f2[x_] := 2 Sin[x]-Sin[2x];`
In[42]:=
`Plot[ {f1[x], f2[x]}, {x,-Pi,Pi} ]`
Out[42]=
`-Graphics-`

In[43]:=
```Plot[ {f1[x], f2[x]}, {x,-Pi,Pi},
PlotStyle->{{},Dashing[{0.02}]},
Prolog->{Text["f1(x)",{0.8,2}],
Text["f2(x)",{1.5,1}]} ]```
Out[43]=
`-Graphics-`
パラメーター表示の関数のグラフ(ParametricPlot)．
In[44]:=
`ParametricPlot[ {Sin[t], Sin[2t]}, {t,0,2Pi} ]`
Out[44]=
`-Graphics-`

In[45]:=
`Needs["Graphics`Graphics`"]`
In[46]:=
`PolarPlot[a, {a,0,2Pi}]`
Out[46]=
`-Graphics-`

In[47]:=
`Needs["Graphics`ImplicitPlot`"]`
In[48]:=
`ImplicitPlot[ x^2+y^2==1, {x,-1,1} ]`
Out[48]=
`-Graphics-`

Dept. CS / Faculty of Eng. / Kobe Univ. / Naoyuki Tamura