Wolfram: Extract Graphics from Builtin Plot Functions
Extract Graphics from Builtin Plot Functions
all builtin functions that display graphics return
either a
Graphics
or
Graphics3D
expression.
the first element of it is a list of Graphics Primitives (and directives). (or, a GraphicsComplex that represent list of graphics primitives. )
so, to exctract graphics primitives, just get the first element of the result.
Example: 2D Graphics
(* extract the graphic primitives from a builtin plot function *) gr = Plot[ Sin[x], {x,0,5} ]; (* length is always 2 *) Length[gr] (* 2 *) (* head always Graphics or Graphics3D *) Head[gr] (* Graphics *) (* get list of graphics primitives and directives. *) gp = First[gr]

Example: 3D Graphics
gr = Plot3D[ Sin[x] Cos[y], {x,0,5}, {y,0,5} ]; Length[gr] (* 2 *) Head[gr] (* Graphics3D *) (* get list of graphics primitives and directives. *) gp = First[gr]

WolframLang, Graphics Programing
- Wolfram: Graphics Programing Index
- Wolfram: Plot and Visualization
- Wolfram: Graphics Primitives
- Wolfram: Graphics Directives
- Wolfram: Extract Graphics from Plot
- Wolfram: Geometric Transformation Functions
- Wolfram: Apply Transform to Graphics
- Wolfram: Compose Transformations
- Wolfram: Translate Copy Graphics
- Wolfram: Transformation Matrix
- Wolfram: GraphicsComplex
- Wolfram: Mesh Region
- Wolfram: Graphics Misc
- Wolfram: Animation