PGF/TikZ
   HOME

TheInfoList



OR:

PGF/Ti''k''Z is a pair of languages for producing
vector graphics Vector graphics is a form of computer graphics in which visual images are created directly from geometric shapes defined on a Cartesian plane, such as points, lines, curves and polygons. The associated mechanisms may include vector display ...
(e.g., technical illustrations and drawings) from a geometric/algebraic description, with standard features including the drawing of points, lines, arrows, paths, circles, ellipses and polygons. PGF is a lower-level language, while Ti''k''Z is a set of higher-level macros that use PGF. The top-level PGF and Ti''k''Z commands are invoked as TeX macros, but in contrast with PSTricks, the PGF/Ti''k''Z graphics themselves are described in a language that resembles
MetaPost MetaPost refers to both a programming language and the interpreter of the MetaPost programming language. Both are derived from Donald Knuth's Metafont language and interpreter. MetaPost produces vector graphic diagrams from a geometric/algeb ...
. Till Tantau is the designer of the PGF and Ti''k''Z languages. He is also the main developer of the only known interpreter for PGF and Ti''k''Z, which is written in TeX. PGF is an acronym for "Portable Graphics Format". Ti''k''Z was introduced in version 0.95 of PGF, and it is a
recursive acronym A recursive acronym is an acronym that refers to itself, and appears most frequently in computer programming. The term was first used in print in 1979 in Douglas Hofstadter's book '' Gödel, Escher, Bach: An Eternal Golden Braid'', in which Hofs ...
for "Ti''k''Z ist ''kein'' Zeichenprogramm" (German for "Ti''k''Z is ''not'' a drawing program").


Overview

The PGF/Ti''k''Z interpreter can be used from the popular
LaTeX Latex is an emulsion (stable dispersion) of polymer microparticles in water. Latexes are found in nature, but synthetic latexes are common as well. In nature, latex is found as a milky fluid found in 10% of all flowering plants (angiosperms ...
and
ConTeXt Context may refer to: * Context (language use), the relevant constraints of the communicative situation that influence language use, language variation, and discourse summary Computing * Context (computing), the virtual environment required to s ...
macro packages, and also directly from the original TeX. Since TeX itself is not concerned with graphics, the interpreter supports multiple TeX output backends:
dvips dvips is a computer program that converts the Device Independent file format (DVI) output of TeX typography into a printable or otherwise presentable form. was written by Tomas Rokicki to produce printable PostScript files from DVI input, and ...
,
dvipdfm The device independent file format (DVI) is the output file format of the TeX typesetting program, designed by David R. Fuchs and implemented by Donald E. Knuth in 1982. Unlike the TeX markup files used to generate them, DVI files are not inten ...
/ dvipdfmx/ xdvipdfmx,
TeX4ht TeX4ht is a configurable converter capable of translating TeX and LaTeX documents to HTML and certain XML formats. Most notably, TeX4ht serves for converting (La)TeX documents to formats used by word processors. It was developed by Eitan M. Gur ...
, and
pdftex __NOTOC__ The computer program pdfTeX is an extension of Knuth's typesetting program TeX, and was originally written and developed into a publicly usable product by Hàn Thế Thành as a part of the work for his PhD thesis at the Faculty of I ...
's internal
PDF Portable Document Format (PDF), standardized as ISO 32000, is a file format developed by Adobe in 1992 to present documents, including text formatting and images, in a manner independent of application software, hardware, and operating systems. ...
output driver. Unlike PSTricks, PGF can thus directly produce either
PostScript PostScript (PS) is a page description language in the electronic publishing and desktop publishing realm. It is a dynamically typed, concatenative programming language. It was created at Adobe Systems by John Warnock, Charles Geschke, Do ...
or PDF output, but it cannot use some of the more advanced PostScript programming features that PSTricks can use due to the "least common denominator" effect. PGF/Ti''k''Z comes with an extensive documentation; the version 3.1.4a of the manual has over 1300 pages. The standard LaTeX picture environment can also be used as a front end for PGF — by merely using the pgfpict2e package. The project has been under constant development since 2005. Most of the development is done by Till Tantau. Version 3.0.0 was released on 20 December 2013. One of the major new features of this version was
graph drawing Graph drawing is an area of mathematics and computer science combining methods from geometric graph theory and information visualization to derive two-dimensional depictions of graphs arising from applications such as social network analysis, c ...
using the graphdrawing package, which however requires LuaTeX. This version also added a new data visualization method and support for direct
SVG Scalable Vector Graphics (SVG) is an XML-based vector image format for defining two-dimensional graphics, having support for interactivity and animation. The SVG specification is an open standard developed by the World Wide Web Consortium s ...
output via the new dvisvgm driver.


Export

Several graphical editors can produce output for PGF/Ti''k''Z, such as the KDE program Cirkuit and the math drawing program
GeoGebra GeoGebra (a portmanteau of ''geometry'' and ''algebra'') is an interactive geometry, algebra, statistics and calculus application, intended for learning and teaching mathematics and science from primary school to university level. GeoGebra is ...
. Export to Ti''k''Z is also available as extensions for
Inkscape Inkscape is a free and open-source vector graphics editor used to create vector images, primarily in Scalable Vector Graphics (SVG) format. Other formats can be imported and exported. Inkscape can render primitive vector shapes (e.g. rec ...
,
Blender A blender (sometimes called a mixer or liquidiser in British English) is a kitchen and laboratory appliance used to mix, crush, purée or emulsify food and other substances. A stationary blender consists of a blender container with a rotating me ...
,
MATLAB MATLAB (an abbreviation of "MATrix LABoratory") is a proprietary multi-paradigm programming language and numeric computing environment developed by MathWorks. MATLAB allows matrix manipulations, plotting of functions and data, implementat ...
,
matplotlib Matplotlib is a plotting library for the Python programming language and its numerical mathematics extension NumPy. It provides an object-oriented API for embedding plots into applications using general-purpose GUI toolkits like Tkinter, wxPy ...
,
Gnuplot gnuplot is a command-line and GUI program that can generate two- and three-dimensional plots of functions, data, and data fits. The program runs on all major computers and operating systems (Linux, Unix, Microsoft Windows, macOS, FreeDOS, ...
, and R. The circuit-macros package of m4 macros exports
circuit diagram A circuit diagram (wiring diagram, electrical diagram, elementary diagram, electronic schematic) is a graphical representation of an electrical circuit. A pictorial circuit diagram uses simple images of components, while a schematic diagram s ...
s to Ti''k''Z using the dpic -g command line option. The dot2tex program can convert files in the DOT graph description language to PGF/Ti''k''Z.


Libraries

Ti''k''Z features
libraries A library is a collection of Document, materials, books or media that are accessible for use and not just for display purposes. A library provides physical (hard copies) or electronic media, digital access (soft copies) materials, and may be a ...
for easy drawing of many kinds of diagrams, such as the following (alphabetized by library name): * 3D drawing3d *
Finite automata A finite-state machine (FSM) or finite-state automaton (FSA, plural: ''automata''), finite automaton, or simply a state machine, is a mathematical model of computation. It is an abstract machine that can be in exactly one of a finite number o ...
and
Turing machine A Turing machine is a mathematical model of computation describing an abstract machine that manipulates symbols on a strip of tape according to a table of rules. Despite the model's simplicity, it is capable of implementing any computer alg ...
sautomata *
Coordinate system In geometry, a coordinate system is a system that uses one or more numbers, or coordinates, to uniquely determine the position of the points or other geometric elements on a manifold such as Euclidean space. The order of the coordinates is sig ...
calculationscalc *
Calendar A calendar is a system of organizing days. This is done by giving names to periods of time, typically days, weeks, months and years. A date is the designation of a single and specific day within such a system. A calendar is also a phy ...
scalendar * Chains:
node In general, a node is a localized swelling (a " knot") or a point of intersection (a vertex). Node may refer to: In mathematics * Vertex (graph theory), a vertex in a mathematical graph * Vertex (geometry), a point where two or more curves, line ...
s typically connected by edges and arranged in rows and columnschain * Logic circuit and electrical
circuit diagram A circuit diagram (wiring diagram, electrical diagram, elementary diagram, electronic schematic) is a graphical representation of an electrical circuit. A pictorial circuit diagram uses simple images of components, while a schematic diagram s ...
scircuits.logic and circuits.ee * Entity–relationship diagramser *
Polygon folding In geometry, a net of a polyhedron is an arrangement of non-overlapping edge-joined polygons in the plane which can be folded (along edges) to become the faces of the polyhedron. Polyhedral nets are a useful aid to the study of polyhedra and so ...
diagramsfolding *
Graph drawing Graph drawing is an area of mathematics and computer science combining methods from geometric graph theory and information visualization to derive two-dimensional depictions of graphs arising from applications such as social network analysis, c ...
with
automatic layout Automatic layout is an option in graph drawing Graph drawing is an area of mathematics and computer science combining methods from geometric graph theory and information visualization to derive two-dimensional depictions of graphs arising fro ...
optionsgraphdrawing *
L-system An L-system or Lindenmayer system is a parallel rewriting system and a type of formal grammar. An L-system consists of an alphabet of symbols that can be used to make strings, a collection of production rules that expand each symbol into som ...
drawingslindenmayersystems * Sequences of basic math
operation Operation or Operations may refer to: Arts, entertainment and media * ''Operation'' (game), a battery-operated board game that challenges dexterity * Operation (music), a term used in musical set theory * ''Operations'' (magazine), Multi-Man ...
smath *
Matrices Matrix most commonly refers to: * ''The Matrix'' (franchise), an American media franchise ** ''The Matrix'', a 1999 science-fiction action film ** "The Matrix", a fictional setting, a virtual reality environment, within ''The Matrix'' (franchis ...
matrix * Mind mapsmindmap * Three-point perspective drawingsperspective *
Petri net A Petri net, also known as a place/transition (PT) net, is one of several mathematical modeling languages for the description of distributed systems. It is a class of discrete event dynamic system. A Petri net is a directed bipartite graph that ...
spetri * RDF semantic annotations (only in
SVG Scalable Vector Graphics (SVG) is an XML-based vector image format for defining two-dimensional graphics, having support for interactivity and animation. The SVG specification is an open standard developed by the World Wide Web Consortium s ...
output)rdf * Special
shape A shape or figure is a graphical representation of an object or its external boundary, outline, or external surface, as opposed to other properties such as color, texture, or material type. A plane shape or plane figure is constrained to lie ...
s and
symbol A symbol is a mark, sign, or word that indicates, signifies, or is understood as representing an idea, object, or relationship. Symbols allow people to go beyond what is known or seen by creating linkages between otherwise very different conc ...
sshapes.geometric and shapes.symbols *
Magnification Magnification is the process of enlarging the apparent size, not physical size, of something. This enlargement is quantified by a calculated number also called "magnification". When this number is less than one, it refers to a reduction in si ...
of part of a graphic in an insetspy * Paths in
SVG Scalable Vector Graphics (SVG) is an XML-based vector image format for defining two-dimensional graphics, having support for interactivity and animation. The SVG specification is an open standard developed by the World Wide Web Consortium s ...
syntaxsvg.path *
Tree In botany, a tree is a perennial plant with an elongated stem, or trunk, usually supporting branches and leaves. In some usages, the definition of a tree may be narrower, including only woody plants with secondary growth, plants that are ...
strees *
Turtle graphics In computer graphics, turtle graphics are vector graphics using a relative cursor (the "turtle") upon a Cartesian plane (x and y axis). Turtle graphics is a key feature of the Logo programming language. Overview The turtle has three attribut ...
turtle * Zooming and panning graphicsviews


Gallery

The following images were created with Ti''k''Z and show some examples of the range of graphic types that can be produced. The link in each caption points to the source code for the image. File:Periodic-table-of-chemical-elements.sv
Periodic table of chemical elements
(libraries used: calc, shapes) File:Rooty-helix.sv
Rooty helix
(library used: calc) File:LighthouseMap.pd
Mind map of ''To the Lighthouse''
(libraries used: mindmap, shapes.misc) File:Lda-gauss-variance-big.sv
Plot of two normal distributed variables with big variance
(libraries used: arrows, positioning) File:Hypersurface-3.sv
Hypersurface rendering
(libraries used: arrows, calc, decorations.markings, intersections, positioning) File:Bayesian-gaussian-mixture-vb.svg, Bayesian Gaussian mixture model (libraries used: arrows, backgrounds, calc, fit, matrix, patterns, plotmarks, shadows) File:Capacitor equivalent circuits.svg, Capacitor equivalent circuits (library used: arrows) File:Batezbestekoak frogak eskema 001.pdf, Diagram showing different types of mean-tests (libraries used: arrows, shapes) File:3d-gradient-colored.sv
Gradient plot of a function
(library used: arrows.meta) File:Csv-2d-gaussian-multivarate-distributions.sv
Multivariate Gaussian distributions
(libraries used: arrows, positioning) File:Feed-forward-perceptron.sv
Feed-forward perceptron
(libraries used: arrows, arrows.meta) File:Shield of the Trinity with the Four Relations.svg, Shield of the trinity with the four relations (libraries used: graphdrawing, graphs, quotes) File:English Length Units Graph.svg,
English length units graph English usually refers to: * English language * English people English may also refer to: Peoples, culture, and language * ''English'', an adjective for something of, from, or related to England ** English national id ...
File:Graph homomorphism into C5.svg,
Graph homomorphism into C5 Graph may refer to: Mathematics * Graph (discrete mathematics), a structure made of vertices and edges **Graph theory, the study of such graphs and their properties *Graph (topology), a topological space resembling a graph in the sense of discr ...
(library used: calc) File:Krausz-Partition 2.png, Subgraphs of the Krausz partition of a given line graph File:Adjacencylist array of linkedlists undirectedgraph.svg, Adjacencylist of a graph implemented as array of linked lists (libraries used: arrows, calc, positioning, shapes.multipart)


See also

* Asymptote (vector graphics language)


References


Further reading

*
Conference talk video
(version archived by archive.org; the previous site is unavailable) based on an earlier version of that paper. * Comparison of several graphics systems in LaTeX. * According t

"It contains a detailed introduction to the TikZ suite—probably one of the best existing descriptions of this highly useful package."


External links


PGF/Ti''k''Z
on
CTAN CTAN (an acronym for "Comprehensive TeX Archive Network") is the authoritative place where TeX related material and software can be found for download. Repositories for other projects, such as the MiKTeX distribution of TeX, constantly mirror mo ...

PGF/Ti''k''Z manual
on
CTAN CTAN (an acronym for "Comprehensive TeX Archive Network") is the authoritative place where TeX related material and software can be found for download. Repositories for other projects, such as the MiKTeX distribution of TeX, constantly mirror mo ...

PGF/Ti''k''Z gallery at TeXample.net
{{DEFAULTSORT:Pgf Tikz Cross-platform free software Free TeX software Graph description languages Graph drawing software Object-oriented programming languages TeX SourceForge projects Vector graphics markup languages