How to| 绘制图形
Wolfram 语言有多种方法可绘制函数和数据. 它会自动处理绘图方面的许多细节,例如采样率、审美选择和专注的区域等. 虽然这些默认选项已经过仔细选择,对大多数情况均适用,Wolfram 语言还允许您自定义图形,以满足您的需要.
使用 Plot 绘制一个函数的图形:
Plot[Sin[x], {x, 0, 10}]使用 ListPlot 对数据绘图:
datapts = Table[x + RandomReal[{-4, 4}], {x, 0, 20}];
ListPlot[datapts]使用 ListLinePlot 绘制数据,并用线连接:
ListLinePlot[datapts]使用 Plot3D 绘制函数的三维图形:
Plot3D[Sin[x]Cos[y], {x, 0, 5}, {y, 1, 10}]GraphicsGrid[{{Plot3D[Sin[x]Cos[y], {x, 0, 5}, {y, 1, 10}], Plot3D[Sin[x] * Cos[y], {x, 0, 5}, {y, 1, 10}, ColorFunction -> (Hue[#3]&), MeshFunctions -> (#3&), Boxed -> False, Axes -> False]}}]使用 GraphPlot 绘制网络图:
GraphPlot[{1 -> 2, 1 -> 4, 2 -> 4, 3 -> 4, 3 -> 2, 3 -> 5, 5 -> 1}, VertexLabels -> Automatic]