# Wolfram Language Graphics Tutorial

By Xah Lee. Date: . Last updated: .

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. e.g. 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:

See

example

## 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 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"]```

## 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:

• `Point[{45,41}]` (2D)
• `Point[{44,90,48}]` (3D)
• `Line[{{331,754}, {557,550}, {888,272}}]` (2D)
• `Line[{{92,402,927}, {183,643,101}, {229,39,925}}]` (3D)
• `Polygon[args]` (2D or 3D)
• `Text[args]` (2D)
• `Disk[args]` (2D)
• `Circle[args]` (2D)
• `Rectangle[args]` (2D)
• `Sphere[args]` (3D)
• `Cuboid[args]` (3D)
• `Tube[args]` (3D)

Complete list at SymbolicGraphicsLanguage

Graphics primitives are symbolic. By themselves they do nothing.

`Line[{{0, 0}, {2, 1}}]`

## Displaying Graphics Primitives

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

Example

## 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.