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)

10
votes
2answers
2k views

Natural transformation arrow with TikZ

How do you draw natural transformation arrows as mentioned in this question but using TikZ rather than xy? More generally, is it possible to draw edges between edge labels, from an edge label to a ...
11
votes
1answer
716 views

Efficient way to partially fill a cylinder?

I am new to tikz and am using it to draw cylinders. I understand how to invoke cylinder body fill to completely fill one, but I also need some cylinders that are only shaded to a certain height. Is ...
12
votes
2answers
3k views

TikZ animated Equation in Beamer

I'm trying to reproduce the example on creating a Presentation with LaTeX Beamer – Equations and tikz and the given code throws the following error Package pgfkeys Error: I do not know the key ...
10
votes
3answers
1k views

How to achieve a rotating figure animation

I have a figure, in *.eps, say a pentagon which is already drawn and then included in TeX, and I want to achieve a rotating animation. So the polygon will be rotating about some point (usually its ...
4
votes
1answer
4k views

Block Diagrams in TikZ

for my thesis i need to put some block diagrams in my LaTeX document. I was recommended to use TikZ for that. This is the only sample code i could find. Do you guys maybe have some tutorials / doc ...
6
votes
1answer
2k views

Left and right align inside one TiKZ rectangular node

I'd like to create a PID controller block diagram similar to the one here. At the moment my diagram looks as depicted below. What I still need is to right-and-left align the text inside the ...
23
votes
2answers
512 views

Is there a TikZ equivalent to the PSTricks \ncbar command?

Although I now use TikZ, every so often I find myself looking for very useful PSTricks commands which don't seem to exist in TikZ. The pst-node package has an \ncbar command which allows one to ...
2
votes
1answer
2k views

Installation of pgf

I was working with an old version of Tikz. It appeared I could not use some features, probably because I had an outdated version. So I tried to reinstall a new version of pgf. I downloaded it and ...
19
votes
3answers
1k views

Amoeba shape with TikZ

I would like to draw generic amoeba-like shapes with TikZ and don't really want to think too deeply about its boundary. Basically a closed connected set with smooth locally convex boundaries. Any ...
5
votes
1answer
288 views

How can I align captions with each level of a tree drawn with tikz-qtree?

I have drawn a binary tree using the TikZ-qtree package. 1) I now would like to align captions on the right of tree with each of its level---and I would like the placement to be automatic (ideally I ...
8
votes
1answer
545 views

'Undefined control sequence' error when defining a color through a macro

I'm trying to color a cell using its data value. However, when I try to compute some value (using the content of the cell) then the definition of the color color!\somemacro in the \cellcolor does not ...
-1
votes
1answer
415 views

Profile face TikZ

My goal is get such head drawing: http://www.shutterstock.com/pic.mhtml?id=87217450
-6
votes
1answer
289 views

tikz code for frame dragging

I'll appreciate suggestions for a code that create the following nice visualization of frame-dragging (or anything alike):
8
votes
1answer
921 views

Appending a line (of fixed length) to a spring drawn with tikz coil

Looking at the nice answer here: Draw mechanical springs in TikZ, I would like to attach a line of fixed length (say 5mm) to the top of the spring (to the platform) and bottom of the spring (to the ...
6
votes
1answer
556 views

Extract coordinates from 3D point

How do I extract coordinates from a three-dimensional point defined when using tikz-3dplot? I would like to perform some calculations on these (more specifically a cross-product of two vectors), but ...
24
votes
1answer
9k views

How to set default style for arrow tips in TikZ?

I am creating multiple TikZ pictures within one document and would like to set the default style of arrow heads for all the pictures to the latex style, i.e. like -latex does, so that I don't have to ...
11
votes
2answers
2k views

Using a pgfplots-style legend in a plain-old tikzpicture

I am using a plain-old tikzpicture to produce a pie-chart-like plot. Now, all other plots in my paper are handled using pgfplots (which doesn't do pie charts) and have their legend typeset by ...
5
votes
0answers
421 views

Beamer/TikZ shadow printed via Adobe Reader (PostScript) cause errors [closed]

Consider the example below compiled using pdflatex. Basically it is a simple test of the Frankfurt theme and the Whale color theme (just attempting to make something smaller). We experience problems ...
7
votes
1answer
1k views

Tikz: question about arrow tips color and width of paths

Why 4-6, 4-7, 7-5 get these colorings? More precisely, what is the difference between [draw=green, fill=green] to [color=green]? Why the 4-5 arc has a slightly bigger width that 7-6? You can see a ...
7
votes
1answer
393 views

Multiple inclusion of the same image gives huge PS file

I am using beamer and having included the same image many times with pgf, declare once and insert. It looks like the PS file from dvips grow linear as I create slides (the image is on the ...
13
votes
3answers
2k views

\pgfmathsetmacro - dimension too large (biggest value allowed?)

I want to import some data with parameters to parametrize some plots. After importing a table, I assign specific variables of the table to a placeholder by using \pgfplotstablegetelem. And it works ...
8
votes
1answer
270 views

Passing a TikZ matrix to a TeX macro

When I pass code containing a TikZ matrix to a TeX macro it prints the following error message: ! Package pgfbasematrix Error: Single ampersand used with wrong catcode. \documentclass{article} ...
2
votes
2answers
2k views

Putting labels on arrow mark in Tikz's picture

I've tried to manually put labels (1-2-3-4) on the arrows tip in the center of the connection lines but it seems not working good..How can i fix this? \documentclass{standalone} \usepackage{tikz} ...
10
votes
2answers
273 views

Why is fixltx2e incompatible with tikzexternalize

I had some weird problems with tikzexternalize sometimes working sometimes not. I narrowed it down to the culprit fixltx2e. Here is a MWNE (Minimal not working exmple) @ ALtermundus: Yes this is ...
3
votes
1answer
578 views

Generated Figure seems cut when using tikzexternalize

When I use the following code, the Figure seems cut, as from a too tight bounding box. \documentclass{article} \usepackage{pgf} \usepackage{tikz} \usepackage{pgfplots} ...
2
votes
1answer
128 views

Why does to [bend right] change the node placement behavior

Consider the following example \begin{tikzpicture} \draw[<->] (0,0) -- (1,1) node[right,midway]{\small$\alpha$}; % \draw[<->] (1,0) to [bend right] (2,1) node[right,midway] ...
4
votes
1answer
1k views

AVL Trees in TikZ: draw outside of node

I'm trying to draw an AVL tree with TikZ. I got the basic tree structure covered, but I'm not sure how to draw the balance factor outside of the node (see picture below). Any suggestions?
7
votes
1answer
766 views

pgf's \foreach macro

Please is there a way of turning the group scoping of \foreach off? The following problem illustrates my difficulty. Without global assignment the aim is not achieved, but global assignments might ...
4
votes
1answer
373 views

Lengths and for-loops

It seems that lengths are not updated in for loops. Compiling the code below: \documentclass{article} \usepackage{tikz} \newlength{\test} \newcommand{\inc}{\addtolength{\test}{1cm}} ...
2
votes
1answer
696 views

How to draw an optical lattice

I want to make in TikZ or MetaPost an image of a two dimensional lattice with oscillations like these: (Source: http://www.uibk.ac.at/th-physik/qo/research/opticallattices.html) or this one: ...
4
votes
2answers
353 views

How to iteratively draw a path e.g. with foreach

I have a long path and want to draw parts of it in an iterative manner \documentclass{article} \usepackage{tikz} \begin{document} \usetikzlibrary{shapes,arrows} \usetikzlibrary{calc} ...
2
votes
1answer
401 views

Tikz'spicture: problems positioning shapes inside nodes and arrow's tips in the middle of the line

I need to draw the picture above with tikz's code, and i would know the better way for placing the "zig-zag" lines. Also I would like to put the arrow's tip in the middle of the connection line. ...
13
votes
2answers
8k views

Hatch a rectangle in TikZ

I know how to make a rectangle and fill it. But what shoud be done to hatch this rectangle with thin 45 degree inclined line with 2mm gap. \documentclass{article} \usepackage{tikz} ...
7
votes
1answer
1k views

Tikz - Nodes highlighting / background coloring

Here is the MWE, it works leaving the unicode devanagari text. \documentclass[fleqn,12pt,a4paper]{article} \usepackage{tikz} \usepackage{tabularx} \usepackage{color} \begin{document} ...
1
vote
1answer
1k views

pgfplots and exp(x) throws error: Dimension too large

I hope, someone can help me. I've the following problem: I want to draw a Graph like this The picture shows the following graphs: exp(x), ln(x), x my code is: \begin{tikzpicture} \draw[ultra ...
2
votes
1answer
2k views

Is it possible to use xshift and a variable to place several (different) paths

Is it possible to use xshift and a variable to place several (different) paths with variable equidistance. I want to configure the space between the paths so giving a variable e.g. to xshift in scope ...
3
votes
2answers
265 views

How to cycle colors through the lines of a polygon

I want to shift the lines specification through a polygon. My current code looks like this (not DRY at all): \documentclass{article} \usepackage{tikz} \begin{document} \usetikzlibrary{shapes,arrows} ...
1
vote
1answer
449 views

newcommand with node confusion [closed]

I'm just getting warmed to tikz so please forgive me if this is a dumb question I want to declare an newcommand containing a node with text: \newcommand{\mydoor}[1] { \draw[black] (1,-1) -- (1,-0) ...
59
votes
6answers
2k views

Curve through a sequence of points with Metapost and TikZ

This question led to a new package: hobby I found Metapost best for drawing complex smooth curves (i.e., Bezier, splines), since you do not have to directly specify Bezier control points. ...
4
votes
1answer
637 views

How to shift error bars along with data bars?

I am trying to create a figure with two bar graphs with bars grouped two by two. I use bar width and bar shift to separate the bars. My problem is that I want to add error bars to these plots but I do ...
10
votes
1answer
5k views

tikz nodes: centering with small font

I am trying to create tikz nodes with centered text, but changing fontsize. Unfortunately, while normally-sized text is nicely centered inside the nodes, the smaller text is not centered, but shifted ...
21
votes
1answer
7k views

Custom and built in TikZ fill patterns

I can't find much information about creating TikZ fill patterns or even using the custom built-in patterns. Look to do all the common fills like lines, hatches, dots, stars, etc... I need to be able ...
2
votes
1answer
304 views

Grouping / Components in TikZ

I am creating pictures in TikZ. Now, I have a certain C component, which consists of 4 nodes ( (a), (b), (c), (d) ). I want to create 5 copies of this component, call them (A, B, C, D, E). Then, I ...
9
votes
2answers
687 views

Step-pyramid in LaTeX

How can I generate a step-pyramid in LaTeX? I'm guessing I would use a graph module to centre chart bars... I want to be able to select the length of each "row" of the pyramid, and show that number ...
7
votes
2answers
776 views

Create a command to draw edges in a bipartite graph

In a document I need to insert several bipartite graphs, each one with different number of nodes and edge composition. My idea was to create a command with two arguments: the first one for the ...
16
votes
1answer
3k views

How to draw nanotubes with TeX?

I am working in the field of Nanostructures and have to draw many figure like :
0
votes
0answers
40 views

Manually Install tikz.sty [duplicate]

Possible Duplicate: How can I manually install a package on MiKTeX (Windows) I have MiKTeX 2.9. My questions is my Latex prompts me to install tikz.sty from the package pgf however its ...
2
votes
1answer
1k views

TikZ - game tree representation with continuum of moves

I have been using TikZ to draw game-trees for my game-theory lectures (mostly using the automata package) but I could not figure out how to draw an arc across the edges the leave a given node. When we ...
3
votes
1answer
437 views

How to use tikz-timing together with the external library

I would like to generate a tikz-timing signal in my LaTeX document and to save it, using external library as pdf file. Here is an example of a combine code: \documentclass[border=5pt]{scrbook} ...
3
votes
1answer
426 views

Changing grid size in tikz-timing package

The grind in the figure contain a grid of 2x8 squeezers (2 rows and 8 columns) and I use 4 elements. How could I tell tikz-timing to use a grid of 1x4 squeezers? Below is an example of my code: ...