TikZ is a higher-level drawing language built on top of the PGF graphics framework. For questions specifically about the PGF layer use {pgf-core} instead. Both tags are possible on the same question. The tag {diagrams} is also compatible with this tag.

learn more… | top users | synonyms (3)

8
votes
2answers
1k views

Expandable Nested Boxes with TikZ

Could someone please post a minimal tikz example to draw this: I am currently doing this with nested tables, but would like to see how it can be done with tikz. The nodes would ideally have a ...
1
vote
1answer
2k views

Tikz, centering object and correcting an arrow in flowchart

i placed the circle with the word Start in the center of picture using positioning library: \node[start] (start) {start}; % row 2 \node[block] (measurement) [below of=start] {Add new measurement, \\ ...
4
votes
2answers
494 views

PGFplot producing “noise” (incorrect graph)

Update: This has problems if the samples are one of these: {19,21,23,28,30,31,32,34,36,38,39}, so I think something else is going on. I can get this example to work fine if I reduce the number of ...
2
votes
1answer
375 views

How do I make the text in the following figure white and center the figure?

How do I make the text in the following figure white and center the figure? %% LyX 1.6.9 created this file. For more info, see http://www.lyx.org/. %% Do not edit unless you really know what you ...
5
votes
3answers
367 views

Is there a \foreach function that works in the preamble?

Tikz/PGF has an extremely useful implementation of \foreach, which allows for instance the construction \foreach \x / \y in {1/a,2/b,3/c,4/d} {\x is a lot like \y} in which you can iterate over a ...
24
votes
1answer
7k views

TikZ matrix as a replacement for tabular

I would like to use TikZ matrices to for some drawings. I am currently using nodes and positioning them manually to simulate a tabular. That helps in positioning arrows and shading. However, if I ...
14
votes
1answer
553 views

Use node text as argument for a macro

I would like to create a TikZ style that adds a thick outline to the node text using the \contour{<colour>}{<text>} macro from the contour package (as in the answer to the question TikZ: ...
21
votes
2answers
1k views

Is there a collection of national flags in TikZ?

I have tried to search, but I have not been able to found any repository with the flags of the most common countries defined with TikZ. It must be very possible as most flags are really vectors.
3
votes
2answers
3k views

Fit flowchart into one page

I am trying to create a flowchart using TikZ and i have few difficulties... My flowchart doesn't fit into one A4 page The text Yes \ No is on the line and not on the side of it. The size of decision ...
24
votes
3answers
3k views

TikZ: halo around text?

I'd like to label my nodes with text that has a 'halo' around it of a different colour. Is this possible? The reason is that my label text covers different parts of my diagram with different ...
6
votes
2answers
389 views

Modified /tikz/double that doesn't go all the way to the end of lines

I love using the double option to draw a line with a thicker, differently-coloured line underneath it. However, quite often I have several of these lines meeting at a point. They are all separate ...
12
votes
1answer
4k views

TiKZ decoration doesn't work

I am trying to get TikZ decorations to work, but so far without success. In this minimal example, I am trying to compile an example found in pgfmanual.pdf in section 20.2: \documentclass{article} ...
13
votes
3answers
2k views

Draw the discontinuity symbol with tikz

Is there an easy way to draw the discontinuity symbol with tikz? It is the symbol shown at the y axis in the following picture (taken from the pgfplots documentation. I can always draw it manually ...
23
votes
2answers
990 views

Can a shape be composed out of “subshapes” in TikZ?

Suppose one were to make a simple "dumbbell" shape in TikZ. (My actual example is more complicated, but let's stick to this simple one). That is, we want a shape constructed out of two circles, and a ...
47
votes
6answers
17k views

TikZ: Node at same x-coordinate as another node, but specified y-coordinate?

In TikZ, if I have a node (A), how do I create a node (B) with the same x-coordinate as (A), but a given y-coordinate?
5
votes
1answer
1k views

Matrix of nodes column style inconsistency

For the following code: \begin{tikzpicture} \matrix [matrix of nodes, column 2/.style={red}] { 8 & 1 & 6 \\ 3 & 5 & 7 \\ 4 & 9 & 2 \\ }; \end{tikzpicture} This picture is ...
7
votes
1answer
782 views

Shortcut for arrows on curves in TikZ

If I want to draw a curve with an arrow somewhere along its length (say 40% along), I can write this: \draw [decoration={ markings, mark=at position 0.4 with \arrow{>}} ...
6
votes
2answers
613 views

Forcing tikz/pgf to expand macros within commands

I would like to use simple macros within tikz commands, but it seems tikz doesn't expand them in the ways I would expect. For instance, the code ...
8
votes
1answer
1k views

How do I set global lengths in TikZ?

I am stumped by the following problem. I'm not sure if this is a bug in TikZ, or if I misunderstand the way that lengths work in TeX and in TikZ. I'd like to define a length called \mywidth, and use ...
20
votes
2answers
1k views

Accessing the logic values of a TikZ coordinate

In TikZ accessing the coordinate values of a node can be done using the let syntax of the calc library or using the PGF command \pgfpointanchor. However, this values are dimensions/lengths in points ...
3
votes
3answers
702 views

Tikz rectangle hiding text!

Using this code to achieve an effect as in the question Page border coloured. \usepackage{tikz} \usetikzlibrary{calc} \newcommand{\pageframe}{% \begin{tikzpicture}[remember picture,overlay] ...
16
votes
3answers
3k views

Drawing a circle in the complex plane.

I would like to draw the set of points in the complex plane that satisfies $|z-1+i| <= 3$ using LaTeX (with TikZ, or some related system). I would want to fill this circle with say dashed lines, or ...
20
votes
3answers
7k views

How to scale Tikz drawings and text together?

I'm trying to build a diagram (a logo, actually) that I can scale easily through a parameter. I'd like to be able to scale both drawing and fonts through a single parameter. Here's my current MWE, ...
1
vote
1answer
479 views

Missing $ error

Why doesn't this code compile? % Oxidation and reduction % Author: Arne Röhrs % Note that two compilations are necessary. \documentclass{article} \usepackage{tikz} ...
19
votes
1answer
5k views

Draw edges and paths in the background of nodes in TikZ

Is it possible to draw edges or paths in the background of nodes independently of whether they are constructed before or after the nodes are defined? In the following example, the \draw instruction ...
10
votes
1answer
3k views

How to add a shift to tikz baseline.

I use the following code to draw a tikz image between some text: \documentclass{article} \usepackage{tikz} \usetikzlibrary{ calc } \begin{document} Hello\tikz[baseline=(current bounding ...
10
votes
2answers
6k views

simple arithmetic on index of foreach statement in tikz

Is foreach really a tikz statement or is derived from some other package? I would like to draw a horizontal axis with 7 ticks spaced 1 cm apart. I'd like to place a label under each tick that is the ...
10
votes
2answers
3k views

Double arrow in TikZ?

I'm trying to draw two arrows between nodes as follows: A ------> B <--/--- The arrows should be parallel, in opposite directions but not on top of each other. (I can bend the arrows but ...
5
votes
2answers
6k views

tikz: control text size and location

I am trying to create flowchart, using tikz: \begin{document} \tikzstyle{decision} = [diamond, draw, fill=blue!20, minimum size=2em, text badly centered, node distance=2.5cm, inner sep=0pt] ...
4
votes
2answers
691 views

Possible to avoid re-compilation of unmodified part of LaTeX document?

I have some TikZ code in my LaTeX document. Whenever I edit other parts in the LaTeX document, I recompile it. But repeating recompiling unmodified TikZ code can be time-consuming. I was wondering ...
12
votes
3answers
1k views

How can I draw the outline of a path in tikz?

Using the arrow tip library, I can draw thick arrows with triangular tips, like so: \begin{tikzpicture} \draw[line width=2ex, rounded corners=2ex, triangle 90 cap reversed-triangle ...
9
votes
1answer
539 views

TikZ picture too tall

I am typesetting the following equation: \documentclass[12pt]{article} \usepackage{tikz} \begin{document} \begin{equation} f\left( \begin{tikzpicture}[scale=0.5] \tikzstyle{every ...
25
votes
2answers
3k views

How can I produce a 'ring (or wheel) chart' like that on page 88 of the PGF manual?

I really like the 'ring chart' or 'wheel chart' given as an example on page 88 of the PGF manual. It is like a pie chart, but with a label in the centre. Unfortunately, the manual doesn't give the ...
5
votes
2answers
4k views

Successive display of animations in a beamer/tikz environment

i made a simple animated graphic in a tikz/beamer environment. the problem is that when i click on one of the slides, all animations begin to move. what i am looking for is that on slide 2 S begins to ...
4
votes
1answer
916 views

Using Macro Defined Lists in TikZ/PGFplots

I want to be able to use a macro to specify a list (it is a constant list, i.e. will not change throughout the document) and use this macro rather than hard code the list contents in the TikZ/PGFplots ...
4
votes
0answers
259 views

Shiny button-like node style with TikZ [duplicate]

Possible Duplicate: Web buttons with WYSIWYM Would it be possible with TikZ to draw (3D) shiny button-like nodes as those appearing in the mindmap on page 44 of Lukas Doktor presentation ...
17
votes
1answer
1k views

Is it possible to use spot colors in TikZ graphics?

Using ConTeXt and Metapost, it is fairly easy to define spot colors and use them in an image: \starttext \definecolor[MyRed][c=0,m=1,y=1,k=0] \definespotcolor[RedSpot][MyRed][p=1,e=MyRed] ...
11
votes
1answer
503 views

Using ifthenelse for crop marks with tikz

How do I use to insert ifthenelse crop marks in Tikz. I want ifthenelse{\printcrop=true}{\draw(0,0) -- ++(0,1);}{} That is, if yes, make a drawing, else but do nothing. And yet, where I can choose ...
3
votes
1answer
655 views

Variables and basic arithmetics and tikz-euclide

I want to draw a circle using tkz-euclide and n segments of this circle. Since I want to have n as a basic variable I need to divide in the following example. However it doesn't work, any ideas? ...
5
votes
1answer
338 views

Using \IfNoValueTF within a TikZ style specification.

In an answer to Flushing PGF commands and local variable Matthew had suggested using \IfNoValueTF within a TikZ \node specification to determine the text. This solution works great for me. However, ...
23
votes
2answers
3k views

PGFplots foreach equivalent to TikZ's with multiple variables separated by a slash

I like TikZ's capability to traverse multiple variables separated by a slash in the foreach (as in the example below). I am looking for something equivalent in PGFplots? I saw in the documentation ...
9
votes
1answer
762 views

TikZ: Execute code at end of scope OR picture and access its bounding box

TikZ provides the two keys execute at end picture={<code>} and execute at end scope={<code>} which can be used to execute any code at the end of the picture and of the current scope, ...
2
votes
2answers
3k views

TikZ/PGF: I can't find file `tikzlibrarycircuit.code.tex' error

I am trying to use the circuit library from TikZ/PGF 2.1, but get the following error when I call LaTeX: ("C:\Documents and Settings\s0237326\Application Data\MiKTeX\2.9\tex\generic\pg ...
5
votes
1answer
3k views

Probability Tree-diagram with TikZ

Thanks for helping me out. How can I make the following tree-diagrams? http://www.vias.org/tmdatanaleng/cc_prob_cond_independ.html
5
votes
1answer
2k views

Flow (or block) diagram tips?

I've been working on a flow diagram or block diagram using Tikz to show a simplified camera transfer function. I've gotten as far as the code below, but I have a few questions remaining. I started ...
23
votes
4answers
3k views

Pascal's triangle in tikz

I would like to typeset the top part of Pascal's triangle. To get the triangle with the names of the binomial coefficients, i.e., {n \choose k}, I used the following code \begin{tikzpicture} \foreach ...
4
votes
1answer
297 views

How can I pass the body of a TikZ node to a font-changing macro?

After looking around at some other answers on this site, I'm trying to typeset a tree using the tikz-qtree package. It works great, but by design it does not let you use macros in the tree nodes, ...
9
votes
1answer
1k views

Conditional using non-integer numbers

I am trying to generate fractals using affine transformations. I need to generate a random number in the interval (0,1), and depending on the value of this random number choose a function to ...
3
votes
1answer
462 views

Using color variable in TikZ before they are declared

I want to use the color of a path to set the color of the nodes. But I want the nodes to be lighter than the path color. And I want to do this before knowing what the path color will be. Hence, how do ...
7
votes
2answers
2k views

Centering a TikZ picture around an area

I often find myself in the following situation: A tikzpicture of mine consists of a main area and some outer material like text labels which are hardly symmetric around the main area. If such a ...