1. 使用虚线点为某一个数字进行说明,还可以做成可交互的文件。
例如
http://demonstrations.wolfram.com/SupplyAndDemand/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
Manipulate[ Show[ Plot[Tooltip[d - .5 q, "demand"], {q, 0, 200}, PlotStyle -> Thick, PlotRange -> {{0, 100}, {0, 100}}, AxesOrigin -> {0, 0}, AxesLabel -> {"quantity", "price"}, Ticks -> {{{0.769 d - 0.769 s, "\!\(\*SuperscriptBox[\(Q\), \(e\)]\)"}}, {{d - .5 (0.769 d - 0.769 s), "\!\(\*SuperscriptBox[\(P\), \(e\)]\)"}}}, AspectRatio -> 1], Plot[Tooltip[s + .8 q, "supply"], {q, 0, 150}, PlotStyle -> {Thick, Red}], Graphics[{Dashed, Line[{{0.769 d - 0.769 s, 0}, {0.769 d - 0.769 s, d - .5 (0.769 d - 0.769 s)}}]}], Graphics[{Dashed, Line[{{0, d - .5 (0.769 d - 0.769 s)}, {0.769 d - 0.769 s, d - .5 (0.769 d - 0.769 s)}}]}], Graphics[{PointSize[.02], Tooltip[Point[{0.769 d - 0.769 s, d - .5 (0.769 d - 0.769 s)}], "equilibrium"]}], ImageSize -> If[format, 500, {500, 400}], AspectRatio -> If[format, Automatic, .75]], "None" -> {{s, 22, "supply"}, 44, 0, 2}, {{d, 75, "demand"}, 50, 100, 2}, {{format, False, "large format"}, {True, False}}, AutorunSequencing -> {1, 2}] |
演示:(CDF文件加载较慢,请耐心等待……)
var demoObj = new DEMOEMBED(); demoObj.run(‘SupplyAndDemand’, ”, ‘535’, ‘545’);
Supply and Demand from the Wolfram Demonstrations Project by Fiona Maclachlan
2. 使用箭头来标注
例如:
http://demonstrations.wolfram.com/BernsteinPolynomials/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
Manipulate[ Module[{ps, f}, If[k > n, k = n]; ps = Table[{Hue[.67, .6, .6], Opacity[.1 (8 + 2 Boole[k == i])], Thickness[0.001 (1 + 4 Boole[k == i])]}, {i, 0, n}]; f[t_] := Table[Bernstein[i, n, t], {i, 0, n}]; Show[Plot[Evaluate@f[x], {x, 0, 1}, PlotStyle -> ps, PlotPoints -> 25, MaxRecursion -> ControlActive[1, 2], PlotRange -> {0, 1.1}, Filling -> If[fill, {k + 1 -> {Axis, LightGray}}, None], PlotLabel -> Style[Subscript[B, k, n][x] == Bernstein[k, n, x], 14]], Graphics[ If[n == 0, {}, With[{j = k + .3 Boole[k == 0] - .3 Boole[k == n]}, Arrow[{{.5, 1.1}, {DivZ[j, n], Bernstein[k, n, DivZ[j, n]]}}]]]], Graphics[ If[env && n != 0, {Part[ Plot[1/Sqrt[2 \[Pi] n t (1 - t)], {t, 0, 1}, PlotStyle -> {Red, Thickness[0.004], Opacity[.7]}, PlotRange -> All], 1]}, {}]], ImageSize -> 1.2 {450, 300}, ImagePadding -> {{25, 25}, {25, 38}}]], {{n, 12, "degree"}, 0, 20, 1, Appearance -> "Labeled"}, {{k, 5, "\!\(\*SuperscriptBox[\(k\), \(th\)]\)"}, 0, n, 1, Appearance -> "Labeled"}, {{env, True, "show envelope"}, {True, False}, ControlPlacement -> Bottom}, {{fill, True, "show filling"}, {True, False}, ControlPlacement -> Bottom}, SaveDefinitions -> True, ControllerLinking -> False] |
效果:(CDF文件加载较慢,请耐心等待……)
var demoObj = new DEMOEMBED(); demoObj.run(‘BernsteinPolynomials’, ”, ‘517’, ‘585’);
Bernstein Polynomials from the Wolfram Demonstrations Project by Yu-Sung Chang
3 其他方法包括使用 Epilog 结合绘制 Arrow 来手动控制,比如
1 2 3 4 5 6 7 8 9 |
Plot[{Emin, Emax}, {q, -1, 2.5}, PlotLegends -> Placed[{"\!\(\*SubscriptBox[\(E\), \(min - e\)]\)", "\!\(\*SubscriptBox[\(E\), \(max - e\)]\)"}, {Scaled[{0.1, 1}], {-0.7, 6}}], Axes -> True, AxesLabel -> {"q", "E"}, Filling -> {1 -> {2}}, Epilog -> {Black, Text["\!\(\*SubscriptBox[\(q\), \(c\)]\)", {1.7, 2.0}, {-1, 1}], {Black, Arrow[{{1.68, 1.75}, {1.55, 1.2}}]}}] |
效果: