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)

16
votes
3answers
2k views

Drawing different tikz shapes parameterized by data from a file

I have a file with three columns of data, x, y, r. # x y r 1 1 0.1 2 2 0.5 3 3 1.2 and so on. I'd like to loop over the rows, and draw a circle at x,y with radius r for each row. I first thought ...
1
vote
4answers
964 views

Help with figures in TikZ

How can we make Figures 1 and 2 below with TikZ and LaTeX? In Figure 2, I want to give different colors to different quadrants.
7
votes
2answers
1k views

Draw a longitudinal wave in TikZ

I'm trying to obtain this longitudinal wave with TikZ: Here's my code \documentclass{article} \usepackage{tikz} \begin{document} \usetikzlibrary{decorations.pathmorphing} ...
7
votes
1answer
2k views

Abbreviated month names as tick labels in PGFplots

How can I modify the following example from PGFplots package to have the x-axis represent months and labelled as JAN, FEB, MAR etc.? \begin{tikzpicture} \begin{axis}[ smooth, ...
31
votes
2answers
4k views

“Z-level” in TikZ

This is an idle question, but neverthless, I think it's interesting. Does TikZ have a simple way to implement a "z-level" specification. By this, I don't mean 3D drawing, I mean specifying which ...
6
votes
2answers
1k views

xyz coordinates rotation

is it possible to set a different orthonormal base for the xyz coordinate space? for example, the default one is x=(1,0,0) y=(0,1,0) and z=(0,0,1). I would want to set this base: x=(1,0,0) y=(0,0,1) ...
2
votes
1answer
480 views

Conflict between mindmap and tikz-qtree

I have some trouble trying to put a mindmap graph and a tikz-qtree graph together in the same document. With the example below, the mindmap is all scrunched up. But if you comment out the ...
6
votes
3answers
3k views

Using TikZ, how do I draw a box having an adjustable width?

I want to box text using TikZ and adjust the box width such that the text is appropriately put on different lines within the box. I also want the text on each to be centered within the box. As this is ...
5
votes
2answers
1k views

Looking for an example of an OLAP cube with dimensions drawn in TikZ

I am looking for an example of a TikZ picture of an OLAP cube with dimension hierarchy. More-less something like this cube: I know how to draw a cube based on What is the easiest way to draw 3D ...
6
votes
1answer
2k views

newcommand containing tikz node

I am using tikz-qtree to draw a binary tree. As I need to have them labeled I wanted to ues the following macro which work in ordinary tikz: \newcommand{\A}[1]{\node(a#1){Activity #1};} However, ...
4
votes
1answer
485 views

pgfmath expansion - call a command from within a pgfmath environment

I am trying to define a newcommand using pgfmath. This commands calls a previously defined command but it fails. It propably has to do something with expansion. I've read this question about ...
10
votes
1answer
2k views

How do I put loops at an angle in TikZ?

I'm trying to draw a graph in TikZ that has self-loops, and I'd like to be able to specify their position not only as "right" or "above", but something like "above right", i.e. at a 45° angle. How do ...
5
votes
1answer
264 views

Unit-free ratios in \path let

I want to compute pure ratios of distances in a \path let construction; for example, in the document fragment \path let \p1 = (1cm, 2cm), \n1 = {\y1 / \x1} in ... I would like \n1 to be the number ...
13
votes
2answers
2k views

Using brackets as delimiters for matrix in TikZ-PGF Matrix Library

The TikZ-PGF manual is clear that for the matrix library, the delimiters are parentheses and braces: Delimiters are parentheses or braces to the left and right of a formula or a matrix. I ...
3
votes
1answer
190 views

Create B-Lymphocyte picture

I would like to create B-Lymphocyte picture (antigen) and i would like to know if someone could give me a start point (e.g. online examples, etc.). Here are some examples of what i would like to ...
2
votes
0answers
130 views

Is there an easy way to make bifurcating/converging edges in TikZ? [duplicate]

Possible Duplicate: Using relative coordinates in TikZ to draw joined curves The problem This problem is thematically related to this question, in fact, I was going to ask roughly the same ...
2
votes
3answers
654 views

Length, surface, and coordinates of a tikz-pgf path

I need to perform computations on the points that belong to a tikz-pgf path. More specifically, I want to know how many points have a y coordinate exceeding a given value, and I want to calculate ...
2
votes
3answers
1k views

pgf macro that returns a node

How can I write a macro that returns a coordinate (or a node). The node must be usable within a tikzpicture environment and preferably inside a path declaration. I need something like the following ...
6
votes
1answer
629 views

What one CANNOT do with TikZ?

I am about to give a short introduction to TikZ, and I was asked to add a slide of what cannot be achieved with TikZ. So, are there certain types/categories of graphics where one should use something ...
7
votes
1answer
2k views

How to make (1,1) mean (1cm,1cm) in TikZ? (Setting the units of coordinates)

I have a picture in TikZ and I'd like to change the basic units of the coordinates I specify. I know I could just scale the picture, but I don't want to do that. For any given coordinate, I can write ...
2
votes
4answers
371 views

Debugging pgf-math

Just learned about pgfmath, but how can I debug it? \pgfmathparse{..} \pgfmathresult doesn't print anything inside a tikzpicture environment. How can I simply print the result of an expression to ...
15
votes
3answers
3k views

TikZ Drawing a changing vector field in a grid

So far I succeeded in drawing a simple grid along with it's centres using grid and nodes. \draw[step=1] (0, 0) grid (4, 3); \coordinate (a) at (0.4, 0.3); \coordinate (b) at (3.8, 0.8); ...
0
votes
3answers
321 views

Help drawing a figure with pgf

Here's an image of what I am trying to draw:
5
votes
1answer
1k views

Drawing a bijective map with TiKz

I am trying to produce a diagram similar to the following (from Wikipedia) in TiKz. Now, I thought this would be relatively simple, however, I am having trouble getting the elements (the dots) to ...
5
votes
1answer
3k views

Draw a plane in space and a coordinate system using tikz

Suppose I have a plane $E: a*x_1 + b*x_2 + c*x_3 = d$ (a,..,d should be concrete numbers) in space and a point P. Is there a way to draw a 3-d coordinate system, E, P and perpendicular line to E ...
9
votes
2answers
11k views

Missing number, treated as zero

A follow-up question to this one Aligning subcaptions with tikz pictures vertically This is the code I am using, worked to a pretty minimal scenario: \documentclass{article} \usepackage{float, ...
3
votes
1answer
2k views

Example of system architecture picture in TikZ

I am looking for an example of a system architecture diagram in TikZ. I would like to draw a picture similar to this one: Therefore I search for existing shapes for: cloud (Current State), database ...
8
votes
3answers
2k views

Is there any easy way to draw a ruled surface like a hyperbolic paraboloid in TikZ?

At the risk of asking YET ANOTHER TIKZ question on a general TeX forum :), I was wondering if there was any easy way to draw a ruled surface like a hyperbolic paraboloid in TikZ? I'm not particular ...
12
votes
2answers
2k views

Optimising TikZ pictures for greyscale printing

I often use colours in my TikZ pictures. Are there simple ways to make versions of these that will come out looking good if I print them on a B&W printer? For example, say I have some filled ...
4
votes
1answer
1k views

Draw shifted plots from the same data

I need to draw a shifted plot from a data table (or a external file) without edit table coordinates. Using the shift={(x,y)} option works but x and y are not related to the axis coordinates s and f. ...
46
votes
1answer
3k views

AucTeX extension for TikZ

Is there an AucTeX extension which supports the TikZ syntax and that one of the tkz-collection as well? In particular I want thinks like: syntax highlighting proper indentation that ...
4
votes
3answers
1k views

Probability tree using TikZ for Bernoulli experiments?

Consider the tree below. Is there an easy way to label every left edge q, every right edge p, every left node f and every right node r, without doing it manually for every level? Second question: Is ...
8
votes
1answer
467 views

How to make multiple lines precisely converge in one point on an axis?

I am trying to produce a sequence/time diagram showing the synchronisation process of a master and slave in the Precision Time Protocol using TikZ. Being very new to TikZ I don't know much more than ...
6
votes
1answer
835 views

Aligning subcaptions with tikz pictures vertically

A simple follow-up question to this one How to place and scale TikZ pictures in subfigure? I shamelessly copied the same code that was presented in the answer there because it fits my needs exactly as ...
25
votes
1answer
4k views

How to customize the table of contents using TikZ?

Are you aware of tentatives to customize the table of contents with TikZ? I am thinking of fancy graphical objects (coloured ovals, squares, rectangles...) coming with "chapter" or the numbering, for ...
8
votes
1answer
816 views

Parameters for newly-defined shapes

I want to declare a new shape in TikZ using \pgfdeclareshape. This shape will be formed from several parts, but often, when invoking the shape, I won't want all of the parts displayed. It would be ...
10
votes
3answers
7k views

Problem with TikZ and vertical alignment of text inside nodes

I have a problem in TikZ with the vertical alignment of text inside nodes. With a very minimal example like this: \usetikzlibrary{arrows,positioning,shapes.geometric} \begin{tikzpicture}[% ->, ...
5
votes
1answer
2k views

Reducing left margin inside a TikZ node

I would like to reduce the left margin inside this node: \documentclass[a4paper,12pt,twoside]{article} \usepackage{tikz} \usepackage{enumerate} \usetikzlibrary{shapes,arrows} \begin{document} ...
11
votes
4answers
2k views

Programming in TikZ

How do I write a macro that will return a path or a coordinate? Here's an example: \documentclass[border=2em]{standalone} \usepackage{tikz} \usetikzlibrary{calc} % \circleByPoint{centre}{point} ...
3
votes
1answer
531 views

Using a macro for the coordinate in \coordinate

It seems that the two lines in the following code are not equivalent: \documentclass{article} \usepackage{tikz} \def\coord{(0,0)} \begin{document} % \tikz \coordinate at \coord; \tikz ...
25
votes
6answers
2k views

Are there examples written in PSTricks and they cannot be done using TikZ?

I am comparing the cores of PSTricks with TikZ and their capabilities. I am not considering whether or not a library has been implemented. Are there examples written in PSTricks and they cannot be ...
6
votes
1answer
7k views

How to place and scale TikZ pictures in subfigure?

I have a problem with placing four TikZ pictures in one figure. I use subfigure to embedded TikZ pictures. Now I have the following problem: I do not know how to scale the TikZ figures. When I use ...
8
votes
1answer
5k views

Plot a function of a binary logarithm with TikZ

How do I plot a function of a binary logarithm with TikZ? Say that I want to plot f(x) = log_2 x.
11
votes
1answer
2k views

How to control the fading size in TikZ?

I am trying to create a fading using tikzfadingfrompicture, but I cannot understand how TikZ computes the size of the fading. I assumed that TikZ calculates the bounding box of the image to fade, and ...
3
votes
1answer
891 views

Does a workaround or solution exists for the label conflict of circuitikz and TikZ?

I would like to use circuitikz with TikZ. However, I find that circuitikz modifies or does not recognize TikZ labels. The author of circuitiz has commented that in the "released version of CircuiTikz ...
4
votes
2answers
2k views

How to prevent a TikZ arrow from touching a node?

I am using TikZ to draw some trees in my thesis. This is a sample of what is being done: \documentclass{article} \usepackage{tikz-qtree} \newcommand{\Ta}{ \begin{tikzpicture}[level distance=30pt, ...
3
votes
1answer
516 views

TikZ's externalization and mylatex

I know I am greedy... I have tried for quite a while to get TikZ's externalization facilities to work nicely with mylatex, without any luck. My document currently looks like \documentclass{article} ...
0
votes
1answer
9k views

pgf install error - MiKTeX [closed]

i have this code taken from another question trying to produce a tree: \documentclass{article} \usepackage{tikz-qtree} \begin{document} \tikzset{edge from parent/.style= {draw, edge from parent ...
10
votes
1answer
2k views

How to draw a line passing through a point and parallel to another?

How to draw a line passing through a point and parallel to another? \draw (0,0) -- (1,0); \node (A) at (1,1); I need \draw (0,1) -- (1,1); parallel to first line.
13
votes
3answers
7k views

How to control spacing in a TikZ tree?

I want to draw a tree and I don't know how to enforce the spacing between them. Some are overlapping. This is my code: \begin{tikzpicture} \tikzstyle{every node}=[circle,draw] \node {A} child { node ...