範例 共 4 個步驟,在同一個工作階段中依序執行。每一步都在引擎上實際執行過,下方的輸出就是它產生的結果。
data = {0.3, 0.3, 1.2, 0.8, 3.1, 1, 4, 0.1};沒有輸出——這個步驟是在為下一步做準備。
newdata = MapIndexed[If[# > Mean[data], Style[
Legended[#, Row[{"bar", First[#2]}]], ColorData[63, First[#2]]], #]&, data];沒有輸出——這個步驟是在為下一步做準備。
styles = Sequence@@{ImageSize -> 400, ChartStyle -> Gray, GridLinesStyle -> Directive[AbsoluteThickness[3], LightGray]};沒有輸出——這個步驟是在為下一步做準備。
BarChart[newdata, ChartElementFunction -> "FadingRectangle", GridLines -> {None, {Mean[data]}}, Evaluate@styles, ChartLegends -> SwatchLegend[None, LegendMarkerSize -> 20, LegendMarkers -> "FadingRectangle", LabelStyle -> {Gray, Bold, 18}, LegendLabel -> "above mean"]]-Graphics-所有操作範例 · 函式參考 · 從 MCP 用戶端使用這個