範例 共 2 個步驟,在同一個工作階段中依序執行。每一步都在引擎上實際執行過,下方的輸出就是它產生的結果。
d1 = Table[PDF[NormalDistribution[0, 1], x], {x, -3, 3, 0.1}];
d2 = Table[PDF[NormalDistribution[0, 0.5], x], {x, -3, 3, 0.1}];
dm = Mean /@ Transpose[{d1, d2}];
styles = Sequence@@{PlotStyle -> {Directive[AbsoluteThickness[5], Opacity[0.5], ColorData[45][1]], Directive[AbsoluteThickness[7], ColorData[45][4]], Directive[AbsoluteThickness[5], Opacity[0.5], ColorData[45][10]]}, ImageSize -> 400, PlotRange -> All, AxesStyle -> Gray, Ticks -> None};沒有輸出——這個步驟是在為下一步做準備。
ListLinePlot[{d1, Legended[dm, "mean"], d2}, DataRange -> {-3, 3}, Evaluate@styles, Filling -> {1 -> {3}}, FillingStyle -> Opacity[0.1], PlotLegends -> LineLegend[None, LegendMarkerSize -> {40, 10}, LabelStyle -> {20, Bold, GrayLevel[0.3]}]]-Graphics-所有操作範例 · 函式參考 · 從 MCP 用戶端使用這個