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)

37
votes
4answers
8k views

Vertical and horizontal lines in pgf-tikz

It is easy to produce a path between two nodes consisting of a single horizontal and a single vertical line (from the manual): \begin{tikzpicture} \draw (0,0) node(a) [draw] {A} (1,1) node(b) ...
4
votes
1answer
126 views

how to use \@Alph in the name of node inside a foreach?

In this question we use a lot of possibilities to define a cube. One idea is to name the vertices. I would like to find something to create these names automatically. In my last example in the ...
7
votes
1answer
1k views

Usage of longtable (or equivalent) and pgfplotstabletypeset

I'm a new user of TikZ pgfplots and pgfplotstable and have been stoked to discover how easy it is to go between Matlab (via matlab2tikz and writing to CSV) and LaTeX. I'm getting a little more ...
18
votes
1answer
8k views

TikZ: Get values for predefined dash patterns

Is there a way to get values for predefined dash patterns such as dotted? I would like to use those in another program to create the same visual experience. Or do I have to define my own patterns in ...
8
votes
2answers
1k views

Plot TikZ items with respect to 3D position, not the order of appearance in the code

I have a big bunch of polygons plot in 3D with TikZ. The code is generated by a program, so it's hard for me to print the "foreground" polygons last, so that they are well printed in space. In other ...
4
votes
1answer
184 views

Dynamically calculate fitter in TikZ

I'm creating a command for automatic generation of resources and deadlocks through TikZ. I have the following code that works correctly: \usetikzlibrary{shapes,positioning,fit} \begin{tikzpicture} ...
19
votes
2answers
2k views

Making overlay figures in TikZ

I'm trying to reproduce the following two figures in TikZ. My attempted code for Fig 1 is \documentclass{minimal} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw ...
2
votes
2answers
936 views

Basic tkz-graph usage problems, errors, bad output

I'm using TeXLive 2011 via MacTeX, and I keep my packages updated. I'm trying to start simple with tkz-graph. When I use the following code, copied directly from the tkz-graph documentation: ...
2
votes
1answer
244 views

can the to-path in pgf/tikz circuits be used to name a node

I am trying to define a few components for my circuits library to use with the circuit.ee library, and I have a couple of questions: Does the to-path create a node on its path or just a complex path ...
7
votes
2answers
812 views

number formatting in foreach statement of tikz

I have the following code: \begin{tikzpicture} \foreach \i [evaluate=\i as \ii using \i+5] in {1,2,3,4} { \node at (\i,0) {\ii}; } \end{tikzpicture} I like to print 6 7 8 9, but the above code ...
9
votes
2answers
886 views

Format numbers as a fraction of pi with tikz \pgfmathprintnumber

I'd like to be able to output something like \frac{\pi}{2} for a input number like .5*pi automatically. I've played a bit with some of the number printing macros available with tikz (closely linked ...
3
votes
2answers
2k views

Changing circle to “-stealth”

I took an example from pgfplots % Preamble: \pgfplotsset{width=7cm,compat=1.3} % [See the TikZ manual if you’d like to learn about nodes and pins] \begin{tikzpicture} \tikzset{ every ...
4
votes
2answers
535 views

Tikz picture contains overlaps of objects and arrows

I'm new at using the TikZ package to make commutative diagrams. I'm trying to draw a triangle with an arrow between each pair of objects. Here's the code I'm using now: \documentclass{article} ...
3
votes
2answers
3k views

How to change text position and angle on the arrows, and how to change the position of boxes in TikZ?

I am using TikZ for making path diagram. Code is given below \documentclass[landscape]{article} \usepackage[latin1]{inputenc} \usepackage{tikz} \usetikzlibrary{shapes,arrows} \begin{document} ...
12
votes
4answers
5k views

PGF/TikZ: How to store strings in array?

I'm trying to generate a lot of name badges. I'm wondering, is it possible to store the names as strings in one array, according to the PGF manual: ...
4
votes
1answer
5k views

tikz and beamer overlays. How to avoid repositioning of images?

I want to slowly uncover nodes in a tree. however when I use overlays the resulting image will jump around in the slides. how do I get rid of that? \documentclass{beamer} \usepackage{tikz} ...
3
votes
1answer
692 views

Plotting line from angle command in TikZ

I'm trying to use the following code to get a line between the perimeters of the circles, the --(b)++(135:16pt) is the bit that I'm having the problem with, it seems that it draws it to (b) and ...
4
votes
2answers
745 views

Nested labeled colored boxes with TikZ

I need nested boxes, as they are shown in this question, but colored ones. I tried both solutions. Using shapes.multipart I totally failed when tried to generate the nodeparts by a foreach command. ...
6
votes
1answer
1k views

How to specify left and right node of a tikz-qtree

I'm drawing a binary tree using tikz-qtree. In my binary tree the order of children is important, so I need distinguish which edge is the left one and the right one. In my sample code I can't ...
5
votes
0answers
666 views

Can't draw ending arrow using tikz [closed]

I need that red edges become arrows, I use \draw[->] but the end of the drawn line is the same as the beginning, this is not an arrow! This is my code: \documentclass[demo]{article} ...
9
votes
1answer
1k views

Cloud with lines as filling in TikZ

I am trying to draw specific portions of a Petri Net with TikZ. For parts of the subnet where the structure does not matter to me I'd like to use a cloud node filled with parallel lines (inspired by ...
6
votes
1answer
660 views

Problem setting a flag inside a TikZ `\foreach` loop

I'm pulling my hair out trying to understand why the following doesn't work. The intention is to calculate whether a given number #1 is prime, and to set \isprime to either 1 (true) or 0 (false). The ...
4
votes
2answers
1k views

tikz: clipping a node

i would like to obtain this effect \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \clip (-1ex,-12pt) rectangle (1ex,12pt); \node ...
7
votes
2answers
435 views

Node at every point of a polyline

Right now I have a code like this: ... mnode/.style={circle,draw=black,fill=black,inner sep=0pt,minimum size=2pt}, ... \draw (0,0) node[mnode]{} -- (1,1) node[mnode]{} -- ...
14
votes
3answers
989 views

Add new symbol to simple TikZ diagram

I'm trying to convert all my LibreOffice diagrams to TikZ, to make my Latex document slightly prettier. I've come across a problem. There are a few symbols that I don't know how to do - and due to my ...
33
votes
2answers
4k views

Drawing heatmaps using TikZ

Introduction I want to create a heatmap using TikZ. You can see the basic idea in the picture below: I basically have a table of values and each value is assigned a color. The picture is the result ...
10
votes
5answers
1k views

Plotting a curve with given values and derivative values

Is there a way, using TikZ, to plot a smooth curve satisfying f( 0) = -1, f'( 0) = 0 f( 2) = 2, f'( 2) = -1 f(-2) = -1, f'(-2) = 1 Of course, I could find a polynomial satisfying the ...
2
votes
1answer
1k views

tikz-uml sequence diagram “Extra \or” error

I was compiling the following code which uses the tikz-uml package. \documentclass{article} %\usepackage{pgf} %\usepackage{tikz} \usepackage{tikz-uml} \begin{document} \begin{tikzpicture} ...
4
votes
1answer
860 views

Tikz figure with multi columns table

I am trying to read from a file with 100000 rows (I plot only the first 600) and 12 columns of data and to plot it with different colors. The data does not contain x components, that is why I use x ...
17
votes
1answer
7k views

Draw a path with dashed start and solid end

I want to draw a line or path with dashed line style at its begining and a solid line at the end, but in only one path (I mean, not drawing two path), something like : \documentclass{minimal} ...
5
votes
1answer
1k views

Tikz positioning in matrices

Due to the help of some posts on StackExchange (mostly [1] and [2]) I think that I got the gist of categorizing matrix rows and columns with braces and separating them with lines in TikZ. However, I ...
2
votes
2answers
453 views

Parameterizing TikZ Figure

I have this code that generates the process gantt chart: \usetikzlibrary{shadows,arrows,positioning} \begin{tikzpicture}[scale=0.75, transform shape] \tikzset{every node/.style={minimum ...
17
votes
4answers
933 views

Make curly braces wrap around part of a circle

Essentially the same question as Draw Curly Braces in TikZ except that I want the brace to wrap around a circle to display an angular sector (for example 0-30 degrees). How can I do this? I dont ...
7
votes
1answer
2k views

pgfplots: log ticks with fixed point on one logarithm axis

I have a graph with two logarithmic axes but I wish to set the labels of one of them to display in fixed point format. Is this possible? Below is a minimum example of how to get both axes using the ...
3
votes
2answers
528 views

Polyline shading in TikZ

Is it possible to apply a shading effect on one side of a polyline in TikZ? I have the following simple code \begin{tikzpicture} \draw (1.06,9.56) -- (1.44,9.78) -- (1.78,9.56) -- (2.14,9.79) -- ...
87
votes
8answers
6k views

Sieve of Eratosthenes in tikz

I am writing notes for my students under the topic of prime factorization and I needed to illustrate the Sieve of Eratosthenes and this is what I came up with in tikz: \documentclass{article} ...
5
votes
1answer
553 views

Nest branches in chains in tikz

I am trying to make a picture illustrating Cocke-Younger-Kasami. I am using tikz for this and already found out how to have arrows between table cells. Now I'm having the following problem: I need to ...
1
vote
2answers
715 views

Drawing Loops in TikZ

I need your kind help to convert this image in TikZ/PGF, if possible: FYI , I want to use the image on a beamerslide and a standard article type document (A4 paper). I used Inkscape (.svg > ...
1
vote
1answer
968 views

Sequent Calculus

What is sequent calculus? See wiki: http://en.wikipedia.org/wiki/Sequent_calculus So basicaly I'd like to produce something like this: Maybe using Tikz?
6
votes
4answers
1k views

Alternative for drawing graphs?

I've been trying to draw a graph with a series of X,Y points in TikZ, but it won't accept my points so I'm seeking an alternative package that might handle scaling a bit better. The kind of points ...
2
votes
1answer
334 views

reading multi columns table with out x column

I have a table (10000 rows and 14 cols) in a ascii file, which contain only the y - components. In my case the x's values are 1 till 10000. Is it possible to tell Tikz to plot from a table only with ...
10
votes
3answers
8k views

export Tikz figures to PDF

I am in the process of writing my master thesis and i am using Tikz to generate few graphs. Unfortunately, the input file for the graphs are not so small, so i already faced the problem that space ...
10
votes
2answers
977 views

How do I center this qtree?

I am trying to draw a tree using the tikz-qtree package, however I am having issues with the nodes of the tree being not centered. \documentclass[10pt]{article} \usepackage{tikz} ...
8
votes
1answer
1k views

mdframed with tikz method: putting line numbers outside of frame

I want to number the lines in a mdframed environment with the line numbers appearing on the left of the frame, outside of it. \documentclass{article} \usepackage[framemethod=latex]{mdframed} ...
4
votes
1answer
2k views

Using beamer overlays to set different styles in TikZ [duplicate]

Possible Duplicate: How to make beamer overlays with Tikz node I'd like to draw a figure in TikZ for a beamer presentation, and color various nodes differently in different overlays of the ...
8
votes
3answers
2k views

Isomorphisms in commutative diagrams in TikZ

Sorry for the basic question. I am trying to get commutative diagrams like \usepackage{tikz} \usetikzlibrary{matrix,arrows} $$\begin{tikzpicture}[description/.style={fill=white,inner sep=2pt}] ...
18
votes
1answer
726 views

Is memoir's page layout incompatible with TikZ?

Can someone explain what's going on here?: \documentclass[showtrims,svgnames]{memoir} \usepackage{lipsum} \settrimmedsize{210mm}{148mm}{*} \setstocksize{236mm}{164mm} \settrims{5mm}{5mm} ...
2
votes
2answers
813 views

Process locking diagram in LaTeX

Does someone know if it is possible to reproduce something like this Diagram (found at this Website) in LaTeX, perhaps with Tikz? Or do I have to draw my diagrams in another program and import them ...
8
votes
2answers
437 views

pgfdeclareshape compilation error

Starting from a more complex trial to add a new shape, I arrive to this minimal example which does not compile. I use PGF 2.10 \documentclass[12pt]{article} \usepackage{tikz} ...
12
votes
2answers
1k views

Inconsistent TikZ multipart node anchors

In the following example, why aren't the node anchors placed consistently? \input tikz \usetikzlibrary{arrows,shapes.multipart} \tikzset{ font=\tt, >= stealth, every picture/.style={thick}, ...