幾何畫圖,坐標軸的感化是不成輕忽的。
這里,專門講一下Mathematica對坐標軸的處置方式。
坐標軸可以顯示,也可以埋沒,別離以Axes->True、Axes->False來節制:
Graphics[SSSTriangle[3,4,5], Axes -> True]
Graphics3D[Triangle[{{0,0,0},{0,1,3},{5,2,0}}], Axes ->False]
x軸、y軸、z軸可以別離自力操作。
只顯示x軸:
Graphics[SSSTriangle[3,4,5],Axes ->{ True,False}]
埋沒x、z軸:
Graphics3D[Triangle[{{0,0,0},{0,1,3},{5,2,0}}],Axes ->{False, True,False}]
用AxesLabel給坐標軸加上標簽:
Plot[Sinc[x], {x, 0, 10},AxesLabel -> {x, Sinc[x]}]
Plot3D[Sin[x] Cos[y], {x, 0, 10},{y, 0, 10},AxesLabel -> {x軸,y軸,z軸}]
用AxesStyle改變坐標軸的樣式:
Plot[Sinc[x], {x, 0, 10}, AxesStyle -> {Directive[Darker@Green, 12],Red}]
Plot3D[Sin[x] Cos[y], {x, 0, 10},{y, 0, 10}, AxesStyle ->{Red,Green,Blue}, AxesLabel -> {x軸,y軸,z軸}]
用Ticks指心猿意馬坐標軸的刻度值:
Plot[Sinc[x], {x, 0, 10}, AxesStyle -> {Directive[Darker@Green, 12],Red}, Ticks -> {{0, Pi, 2 Pi, 3 Pi}, {-1, 1}}]
Plot3D[Sin[x] Cos[y], {x, 0, 10},{y, 0, 10}, AxesStyle ->{Red,Green,Blue}, AxesLabel -> {x軸,y軸,z軸}, Ticks -> {{0,2,4,6,8,10},{1,3,5,7,9}, {-1, 1}}]
AxesEdge可以把坐標軸集中到一個起點上:
Plot3D[Sin[x] Cos[y], {x, 0, 10},{y, 0, 10}, AxesEdge -> {{ 0, 10},{0, 10}, {-1, -1}}, Mesh -> None, PlotStyle -> Opacity[.5], Boxed -> False]
AxesOrigin指心猿意馬了坐標軸原點的位置。
以{Pi, 0}為原點:
Plot[Sinc[x], {x, 0, 10}, AxesStyle -> {Directive[Darker@Green, 12],Red},
AxesOrigin -> {Pi, 0}]
以{Pi, 8,0}為原點:
Plot3D[Sin[x] Cos[y], {x, 0, 10},{y, 0, 10}, AxesStyle ->{Red,Green,Blue}, AxesOrigin -> {Pi, 8,0}]
繪制極坐標函數的圖像的時辰,PolarAxes可以指心猿意馬極坐標軸:
PolarPlot[Sin[3 t], {t, 0, Pi}, PolarAxes -> Automatic,
PolarTicks -> {"Degrees", Automatic}]
0 篇文章
如果覺得我的文章對您有用,請隨意打賞。你的支持將鼓勵我繼續創作!