WolframLang: Plot and Visualization
This is a basic tutorial on WolframLang graphics system.
This tutorial teaches you:
- Builtin functions for plotting math functions
- Builtin functions for plotting data (bunch of numbers)
- How does graphics work. WolframLang graphics primitives. How to write program to draw arbitrary graphics, or extract graphics from builtin plotters.
or you can watch a video:
There are two major types of builtin plotting functions:
- Plotting math functions. Example: plot sine, equation, vector valued function, complex function, parametric formula for 2D or 3D, etc.
- Plotting data (usually list of numbers), such as pie chart, bar chart, statistics, histogram, stock chart, or a surface by a bunch of points, etc.
Plotting Math Functions
Note, most plotting function's names contains the word “Plot”, but not all.
For example
BarChart
, PieChart
, Histogram
,
BoxWhiskerChart
, etc.
To get a list of builtin functions for plotting, type any one of the following to get a list:
?*Plot*
Names["*Plot*"]
Information["*Plot*"]
or see
for example:
Plot3D[ Sin[x] Sin[y], {x,0,10}, {y,0,10} ]
Functions for Data Visualization
See
example
PieChart3D[{3, 10, 1}, ChartLabels -> {"a", "b", "c"}]
Options for Plot Functions
Type
Options[ FunctionName ]
to get a list of options for the function.
Example:
Options[ Plot ]
Type
?Name
to get the documentation for the option name.
?Axes
Click the info icon to goto the full documentation.
Commonly Used Options for 2D Graphics
AspectRatio
AspectRatioAxes
AxesAxesLabel
AxesLabelFrame
FrameFrameLabel
FrameLabelFrameTicks
FrameTicksPlotLegends
PlotLegendsPlotPoints
PlotPointsPlotRange
PlotRangeTicks
Ticks
Commonly Used Options for 3D Graphics
Commonly used options for
3d plot functions that plots surface of math function.
For example:
Plot3D
,
ParametricPlot3D
PlotPoints -> {50,60}
Axes -> False
Boxed -> False
BoundaryStyle -> Directive[Black, Thin]
→ boundary line.Mesh -> None
MeshShading -> {{None}, {None}}
→ no surface patch.PlotStyle -> Directive[White, Opacity[0.7], Specularity[10, 20]]
→ surface color, transparency, shine.Lighting -> "Neutral"
example:
ParametricPlot3D[ {Cos[u]*(2 + Cos[v]), Sin[u]*(2 + Cos[v]), Sin[v]} , {u, 0, 5}, {v, 0, 6}, PlotPoints -> 100, Axes -> False, Boxed -> False, BoundaryStyle -> Directive[Black, Thin], PlotStyle -> Directive[White, Opacity[0.7], Specularity[10, 20]], Lighting -> "Neutral"]