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
1answer
777 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 ...
0
votes
1answer
584 views

Profile face TikZ

My goal is get such head drawing: http://www.shutterstock.com/pic.mhtml?id=87217450
-6
votes
1answer
473 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
1k 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
846 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 ...
37
votes
1answer
20k 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 ...
16
votes
2answers
6k 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
486 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
2k 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
503 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 ...
17
votes
3answers
3k 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
324 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
3k 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
312 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 ...
4
votes
1answer
956 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
138 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
2answers
2k 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
828 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
563 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}} ...
3
votes
1answer
880 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
549 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
473 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. ...
27
votes
2answers
20k 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
2k 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
2k 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 ...
3
votes
1answer
3k 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
374 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
667 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) ...
66
votes
6answers
3k 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. ...
5
votes
1answer
856 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
7k 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 ...
32
votes
1answer
13k 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
420 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
1k 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 ...
8
votes
2answers
1k 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 ...
19
votes
1answer
4k 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 ...
5
votes
3answers
2k 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
600 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
568 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: ...
6
votes
2answers
580 views

How to draw a QOC diagram maybe with TikZ

I would like to draw the following diagram in LaTeX. The image is: I was looking at the TikZ package and it seems to be what I need. However, I need to automate somehow the task of drawing this ...
3
votes
1answer
2k views

Tikz's picture: out of the page margin [duplicate]

Possible Duplicate: How to scale a tikzpicture to \textwidth Shrink figure only when necessary? As you can see the third rectangle is out of the right margin...how can I fix this issue? ...
11
votes
1answer
2k views

Minimum height in split rectangle

I have a split rectangle node, and I would like either for the entire node to be a certain height, with the splits spread equally, or each nodepart to be a certain height. I have the following code, ...
8
votes
1answer
1k views

Titles aligned horizontally above nodes in figure

I am trying to create a flow chart going left-right where each stage has a header aligned with it, at a certain height above the chart. I am trying to use the Hydrogen Splitting Example (see the ...
2
votes
0answers
65 views

Clash between tikz externalization and references to plots [duplicate]

Possible Duplicate: pgfplots: externalization and legend referencing I am trying to implement references to plots using there legend image with pgfplots. I use the example on page 164 of ...
32
votes
4answers
8k views

How to draw a shaded sphere?

Andrew Stacey pointed out that the Rosetta Code entry "Draw a Sphere" doesn't have a TikZ entry yet. Is there a way to draw a "properly" shaded sphere using TikZ? The ball shading would seem an ...
6
votes
2answers
747 views

Proper fill when chaining curves

I'm trying to chain multiple bezier curves but when I try to fill them I cannot fill the complete closed curve but it seems to close each intermediate curve before filling. I've tried various things ...
25
votes
4answers
14k views

TikZ: Drawing an arc between two coordinates?

I am up with the following: Using the code given at the bottom. Suffice to say, I don't really like the result: I wanted to draw this picture without explicitly calculating the circle and the ...
2
votes
1answer
1k views

Tikz's picture scaled and wrapped

I need to wrap the text around my tikz picture. But as you can see, scaling the picture give me problems about the position of the shaded axis between "pompa" and "turbina". How can i fix this ...
10
votes
1answer
9k views

Annotating a pgfplots graph

I tried the solution proposed in : How can/should I include annotated images? However, the coordinates don't match with the coordinates I used when plotting the diagrams (data coordinates). For ...