Wolfram Language Graphics Tutorial

By Xah Lee. Date: . Last updated: .

This is a basic tutorial on WolframLang graphics system.

This tutorial teaches you:

or you can watch a video:

Xah Talk Show 2022-02-06 Intro to WolframLang Mathematica Graphics and Programing Graphics

There are two major types of builtin plotting functions:

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:

or see

for example:

WolframLang Plot3D 2022-02-09 gdYC
Plot3D[ Sin[x] Sin[y], {x,0,10}, {y,0,10} ]

Functions for Data Visualization

See

example

WolframLang PieChart3D 2022-02-09 q74Z
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 ]
WolframLang Options 2022-02-09 f66T
Options for Plot

Type ?Name to get the documentation for the option name.

?Axes
WolframLang Axes 2022-02-09 GV5K

Click the info icon to goto the full documentation.

Commonly Used Options for 2D Graphics

Commonly Used Options for 3D Graphics

Commonly used options for 3d plot functions that plots surface of math function. For example: Plot3D, ParametricPlot3D

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"]
ParametricPlot3D 2022-02-09 gTXG

How Does WolframLang Graphics Work

All WolframLang graphics is a expression that's a list of graphics primitives.

All Plot functions or visualization functions that show graphics, are internally creating a list of graphics primitives.

graphics primitive

graphics primitive is a expression that represents a graphical element, such as line, circle, polygon, text, sphere, tube.

some graphics primitives are 2D (such as Circle, Disk, Rectangle), some are 3D (e.g. Sphere, Cuboid, Tube), some both (e.g. Point, Line, Polygon).

Example of graphics primitives:

Complete list at SymbolicGraphicsLanguage

Graphics primitives are symbolic. By themselves they do nothing.

Line[{{0, 0}, {2, 1}}]
WolframLang Line 2022-02-09 4kgq

Displaying Graphics Primitives

To display a graphics primitives, such as Line[{point1, point2}], put them inside the functions Graphics or Graphics3D.

Example

WolframLang Graphics 2022-02-09 f3D4
Graphics[Line[{{0, 0}, {2, 1}}]]
Cuboid 2022-02-09 5g87
Graphics3D[Cuboid[{0, 0, 0}, {1, 2, 1}], Axes -> True]
WolframLang cubes 2022-02-09 mJgr
Graphics3D[Table[Cuboid[{x, x, x}, {x, x, x} + 1], {x, 0, 5}], Axes -> True]

How Do Builtin Plot Functions Work

2022-02-09 work in progress

How to Extract Graphics from Builtin Plot Functions

2022-02-09 work in progress

Advanced Graphics Programing from Scratch

2022-02-09 work in progress

Discretize Graphics

DiscretizeGraphics and DiscretizeRegion returns a MeshRegion. These are critical, when you want to do a transformation on graphics, so that it is applied all points on edge or faces, instead of just on vertexes.