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)

12
votes
1answer
2k views

Stacked barplots/groupplots with text labels in x-coordinate

I was trying to stack a groupplot, or was it grouping a stacked plot? However I was trying to get something like: The ybar stacked option works quite nice here. But when I try to adapt it to a ...
14
votes
1answer
5k views

How to align TikZ figures in subfigs

I use subfig to show an array of tikz figures. Unfortunately these figures are sometimes of different height, so they don't show up properly aligned: I'd like to see all nodes on the same line. I'm ...
10
votes
1answer
2k views

How to use shading in TikZ when rotating the picture?

I have the following problem: I want to draw a rectangle and around it, there should be some smooth fading to the background (white). I found the shading technique of tikz quite interesting. The ...
3
votes
1answer
777 views

Add text to absolute position in every slide automatically IN ADDITION to theme footer

I know this sounds like a repeat question, but I'm pretty sure it's not. I am trying to add text to an absolute position in every slide of the presentation, in addition to to content already provided ...
8
votes
2answers
2k views

How to draw just the arrow tip in TikZ

How can one draw "just the arrow tip" from one of the arrows in the arrow tip library in TikZ? The problem is that if you try a brute-force solution, eg. \tikz \draw[-triangle 90] (0,0) -- +(.1,0); ...
3
votes
1answer
380 views

foreach within \draw, without giving the first point explicitly

I am plotting line given by y(x) expression evaluated at regularly spaced points, e.g. \def\ffIiC{+0.0436275-1.18778*\x^1+0.542693*\x^2} % ... \draw (0,0.0436275) \foreach\x in {0,.1,...,4}{ -- ({\x},...
8
votes
3answers
2k views

Drawing Multiple Diagonal Arrows in a Table

My question is basically the same as this one, but with many arrows instead. (I'd like to see the TikZ solution--I feel like once I get it here, I'll be able to extrapolate and do it in other cases ...
8
votes
2answers
833 views

Alignment base on two reference nodes

I am new to tikz. If I have two nodes [A] and [B] as: [A] [B] How do I align [C] so that it is vertically below [A] and horizontally left of [B] such that: [A] [C] [B] without ...
5
votes
4answers
806 views

Rectangular diagram with TikZ

I have a problem with getting rectangular diagrams in LaTeX. For example, the diagram below gives a diagram which looks like a trapezium. What do I need to change to get what I want ? \begin{center} \...
12
votes
5answers
2k views

Create an array in TikZ with \underbrace in different colors

I would like to create TikZ something like: ------------------------------- ... ---------------- | 0000 | 0001 | 0010 | 0100 | | 0111 | 1111 | ------------------------------ ... ------...
18
votes
3answers
8k views

How to get correct arrow orientation on TikZ arc?

I'm trying to fix the following TikZ figure, where the circle device in the middle should be embraced by two bended arrows pointing counter-clockwise. I have drawn these arrows with an arc path, ...
5
votes
2answers
1k views

Problem with preview package (and standalone class) with tikz

I updated MacTeX recently with TeX Live Manager and I installed the last tikz/pgf CVS (02/12/2011) and I got a problem with the standalone class. The size of the picture seems fine but nothing is ...
12
votes
1answer
240 views

One path or several paths for a tikzpicture?

Perhaps the title of my question is not fine (let me know). I try to finish a document about the best practices when programming with TikZ. I remark in several answers that a lot of users like to use ...
23
votes
3answers
2k views

Draw dimension of a line as a decoration in TikZ

Is it possible to define in TikZ a new decoration or something like that, such that it is possible to write something like: \draw[dim={text,above}] (A) -- (B); \draw[dim={text,below}] (C) -- (D); ...
8
votes
1answer
1k views

Multiple marks on a path

I want to add a multitude of marks to a single path. However, sometimes these marks are heavily misplaced. For example, the blue arrows should be a little bit ahead of the red ones. \begin{...
35
votes
3answers
5k views

How to draw tangent vectors and component vectors on a curve

I am searching for a way to have a figure drawn using LaTeX. I am aware of some packages TikZ and PSTricks that could accomplish this, and have been tinkering around with them recently but do not have ...
4
votes
2answers
795 views

How to get consistent positioning for a node with \usebox containing a \tikzpicture

I'm using beamer and tikz to create an animation of a photon travelling between snowflakes. I have ten Koch snowflakes (hence the \newcommand in my MWE) typeset with decorate{ decorate{ decorate{ ...
8
votes
3answers
570 views

Clash between aligned environment and TikZ?

The following code mis-renders the multi-line label: \documentclass{article} \usepackage{tikz} \usepackage{amsmath} \begin{document} \begin{equation} \begin{aligned} \begin{tikzpicture} \node (A) at (...
3
votes
2answers
2k views

Drawing Arrows in Tables

What is the best way to draw a diagonal line through the following table? \begin{center} \begin{tabular}{*{9}{c}} $e_{1}$ & = & $0$ & $.$ & $d_{1}^{1}$ & $d_{1}^{2}$ & $d_{1}^{...
7
votes
2answers
3k views

How to label complex edges with graph library?

I would like to use graph TikZ-library from CVS version (sourceforge or tlcontrib) to draw flowcharts. Something like the one shown in chapter 5 from TikZ manual. In this tutorial, some styles are ...
4
votes
1answer
1k views

How can I get a counter-clockwise loop with the TikZ automata package?

Using \draw [->] (2) to[loop above] node[auto] {$\beta_2$} (2); I get "clockwise" loop. Is it possible to get a counter-clockwise loop?
33
votes
1answer
603 views

How can I know if a node is already defined?

I think I've seen this question before, but I can't find it. The problem is simple; before I assign a name to a node I would like to know if the name is already used. I think when a node is created \...
16
votes
5answers
1k views

Triangular numbers in TikZ

I need to draw an image of the first three triangular numbers inscribed in a square. Now, I have two problems constructing this image. Construct the circles perfectly centered The shading It ...
10
votes
1answer
1k views

Contour plot labeling applied to ordinary 2D plots

I was trying to obtain the effect that I manually created below,shown with the letter n. Now, I know that this is customary to do in contour plots, hence I've checked the manual and saw that it is ...
4
votes
1answer
1k views

Reverse arrow in TikZ

How can I reverse some arrows of the diagram given by the code below? \begin{tikzpicture} % Tell it where the nodes are \node (A) {$A$}; \node (B) [below=of A] {$B$}; \node (C) [right=of A] {$...
13
votes
1answer
1k views

Possible to combine “…” and “x/y” in TikZ's foreach?

I'll start with a simple, minimal non-working example: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \foreach \x/\y in {1/20,2/18,...,10/2} \node at (\x,0) {\y}; \...
7
votes
3answers
1k views

Wrong line spacing when changing the font size inside of a rectangle

i'm trying to change the font size inside of a rectangle and always the line space between the last and the second last line is getting wrong. How can that be fixed? \documentclass[]{article} \...
7
votes
2answers
438 views

Axis background has missing draw/stroke

I want to draw a rectangle around an axis created using pgfplots. This is a minimal example: \documentclass{minimal} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \...
4
votes
1answer
2k views

Placing a triangle around nodes in a tree

I have a tree filled with numbers and I want to mark a subtree by drawing a triangle around it. I can't seem to get it working. My attempt: \documentclass{article} \usepackage{tikz} \usetikzlibrary{...
20
votes
2answers
4k views

Draw a prism in TikZ or PSTricks

Is there a way to define an polygon in plane and output an (orthogonal) prism with that polygon as its base? The prism should be drawn in 3D in parallel oblique perspective with controllable height h, ...
18
votes
5answers
2k views

Matching arrowheads in TikZ with math mode arrowheads

TikZ is great at drawing diagrams but there is one feature which I find quite annoying and that's the fact that the default arrowhead provided by TikZ does not necessarily respect the math mode in ...
5
votes
2answers
3k views

How to set lines, arrows and text in this block diagram on tikz?

Im quite new learning tikz, it rocks!. Well, Im trying to get the following block diagram working, but having kinda trouble: And this is what I got so far: \documentclass[12pt,a4paper]{article} \...
10
votes
1answer
3k views

Drawing grid with random color in TikZ

I'm trying to draw a 10x10 grid in TikZ like so: \documentclass{minimal} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture}[scale=1] \foreach \y in {0.05,0.15,...,0.95} ...
4
votes
1answer
1k views

tikz-timing: text labels in symbols other than D, and time axis discontinuities

This is (more-less) two (or more) questions in one - however related; so I'll try to cover all in one post. I have a specific timing diagram layout in mind, and I'm almost there: The complete code ...
2
votes
1answer
551 views

Intersection between line and circle (tkz-euclide)

Now once, again I am trying to reconstruct one of these odd images in tikz. Now, what is supposed to show, is only the triangle, the angle, and the line CD. My attempt to do this is shown below \...
6
votes
2answers
1k views

Rotate a node but not its content: the case of the ellipse decoration

What I want to do: Draw a node decorated with bumps, but with the decoration starting from the right (ie, opposite to the usual) of the node. Why I want to do it: I will have a node hiding the part ...
2
votes
1answer
3k views

Can't find TikZ library calc

I am using a Mac operating system and am not a sophisticated programmer. I am trying to run code that uses the line \usetikzlibrary{calc} but I keep getting the error "I can't find file ...
15
votes
1answer
17k views

Typesetting a directed, weighted graph with TikZ

I just started doing things with TikZ today and I run into a problem: there is just no example code snippets for typesetting directed, weighted graphs. Can anyone supply one simple example in an ...
5
votes
1answer
3k views

Voltage sign convention (European vs. American) in Circuitikz

This time I dive into Circuitikz. Anyway, I've got a problem with the american and european styles of e.g. voltages. IIRC Voltage drops are counted positive which means the voltage arrow in the ...
13
votes
5answers
2k views

TikZ: complicated paths, e.g. for complex integrals

I would like to illustrate lecture notes on complex analysis, which by its nature is a lot about how the lines of integration are running through the complex plane. However, I'm having trouble finding ...
1
vote
1answer
1k views

TikZ figure always positioned at the center of a new page [closed]

I run into this rather strange problem when using TikZ with LyX 2. I have this graph programmed using TikZ, and it is supposed to follow a paragraph of text and be positioned at the top of next new ...
10
votes
1answer
428 views

Is there a polar coordinate registers in the let command?

I have seen that we ca use \x1 and \y1 to access cartesian coordinates of point register \p1 declared in let. Is there a way to access the polar coordinates (something like \a1 for the angle and \r1 ...
13
votes
2answers
1k views

TiKZ make lines connecting nodes have the same endpoints

Using the MWE below: \documentclass{standalone} \usepackage{tikz} \usepackage{tikz-qtree} \usepackage{tikz-qtree-compat} \usepackage{ textcomp } \begin{document} \begin{tikzpicture} \Tree [ .TP [ ...
13
votes
3answers
1k views

Book cover, integration multilayered equations. (Suggestions?)

I am sort of writing a compendium about integration, everyhting from basic substitutions, to contour integrals, Gamma, beta integrals and so forth. I feel that no standard frontcase suffices and I ...
8
votes
1answer
1k views

gnuplot true standalone

Finally I have decided to go PDF. I can add pictures without EPS wrapper, and do drawings with TikZ - life is good :o) But how do I use gnuplot? For consistency I would like to use the tikz terminal, ...
10
votes
1answer
861 views

Is it possible to use marking of decoration with edge?

The initial code is \documentclass{article} \usepackage{tikz} \usetikzlibrary{decorations} \usetikzlibrary{decorations.markings} \begin{document} \pgfkeys{ /pgf/decoration/.cd, pre fraction/.style={...
4
votes
1answer
1k views

Arrows in tikz-qtree with symbols in node names

I have a syntax tree with angle brackets to represent movement: \begin{tikzpicture} \Tree [ .TP [ .T' \node{T+verb}; [ .vP \qroof{`ana}.DP [ .v' \node{v+{\textlangle}verb{\...
20
votes
3answers
9k views

TikZ - multi-color double circle node

How do I draw a node with a double circle shape where one circle has a different color than the other circle? A single \node[whatever] {content} would be nice!
3
votes
1answer
526 views

Automatically clipping undrawn objects in TikZ

I have used the trees package to construct my drawing, but I don't actually need the edges. So I have set the following to suppress them: \tikzstyle{edge from parent}=[] This works, but TikZ still ...
3
votes
1answer
1k views

Strange behavior in smooth pgfplot with sudden changes in the slope

I'm trying to plot some points with sudden changes in the slope. But I get some strange behavior like this: as you can see in the peaks, there is no smoothness in there. However, I think the ...