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)

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
836 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
819 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
532 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
894 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 ...
30
votes
4answers
12k views

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

I'm having a bit of a headache right now as I can't draw this basic figure: A straight line goes through points A and B. Another line is perpendicular to AB and goes through an arbitrary point P. I ...
1
vote
2answers
5k views

Installing pgfcore.sty

There is a problem with installing pgfcore.sty file for the beamer package. This file can not be installed from the internet (TeX says file not found) and when I plug this file manually into the ...
2
votes
1answer
408 views

Problem when drawing an axis-aligned bounding box around a tilted rectangle.

I need to draw an axis-aligned bounding box containing a tilted rectangle for a report about physic engines. My initial idea was to simply insert a rectangular node, apply a rotational transformation ...
15
votes
3answers
2k views

How to draw text-anchored tikz line below text instead of above?

I wish to mark several pairs of from/to anchor locations in text, and use tikz to draw lines between these. The anchors are not in absolute page locations; the text determines where the endpoints of ...
6
votes
4answers
513 views

(Commutative) diagram with long labels on vertices

I am trying to draw a diagram that looks something similar to the following: ############## ---------> ############## \ / \ / ...
3
votes
1answer
1k views

Tikz arrow starting exactly in the center

I have the following problem. I am using the tikz package to draw figures. I am drawing some sort of a data structure. This includes having nodes and lines which connect nodes. Sometimes, a line has ...
7
votes
2answers
932 views

How to define a random number with xcolor and tikz/pgf

I tried to get a random color with xcolor and tikz: \documentclass{article} \usepackage[xetex, rgb]{xcolor} \usepackage{tikz} \begin{document} \pgfmathsetseed{1} \begin{tikzpicture} ...
5
votes
1answer
504 views

Latex plotting (jagged function)

Hey, I have a function which I would like to plot with latex/tikz. Since I'm just a beginner I really don't know how to do it. Don't get me wrong I don't have any problems with most functions but this ...
4
votes
2answers
2k views

Block Diagrams Multi Input - Multi Output Components in TikZ

My problem is to define blocks (mainly rectangles) that has labels in them in terms of matrices (mostly block diagonal) such that the n-many arrows that goes in this rectangle visually is at the same ...
13
votes
1answer
3k views

Increment loop variable in inner foreach loop

I need the following pairs of numbers: 12 13 14 23 24 34 My first attempt was to use two nested foreach loops: \foreach \x in {1,...,4} { \foreach \y in {\x+1,...,4} { % This would be very easy in ...
12
votes
4answers
4k views

PGF Math Function to compute cube root

When I found that a simple x^(1.0/3.0) does not yield a graph in PGFplots for negative values of x, I attempted to define my own function for CubeRoot using pgfmathdeclarefunction as below. But, am ...
5
votes
2answers
653 views

Passing nodes as parameters to a macro in TikZ

I would like to define a macro which would take two nodes as arguments and "connect" them using a third, predefined node. Like this: \documentclass{minimal} \usepackage{tikz} ...
2
votes
1answer
752 views

using foreach to draw a chain with a branch

This is an extension to How to draw the border of a node using late options I'm drawing a chain of nodes with different colors using foreach from tikz. Now I want to add a branch, also using foreach. ...
10
votes
1answer
1k views

How to have linked axes on plots?

I plot infrared spectra in many reports and I display the energy units in two ways, wavenumbers $cm^{-1}$ on the bottom x-axis and wavelength (nm) on the upper x-axis. The relationship is ...
4
votes
1answer
982 views

set a caption and label in a tikz timingtable environment

Is it possible to set a caption and label within a tikz timing table? Or do I have to do that somehow within a tikzpicture? Here the codefragment: \begin{minipage}{0.5\textwidth} ...
6
votes
2answers
2k views

tikz doesn't work properly

I am trying to toy around with tikz and I have found that the result is strange. When I run the code given here: \documentclass{article} \usepackage{pgf} \usepackage{tikz} ...
8
votes
2answers
160 views

Are there any differences between a “newly defined” path and a path using predefined nodes?

I am not sure how I should phrase my question. consider the following example \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node[inner sep=0] at (0,0) (a) {}; ...
12
votes
1answer
3k views

\ifnum and pgfmath: error

In the following example I want to use \ifnum to compare two numbers computed by pgfmath, for simplicity I use simply 1 and 2 in the example below. Compiling this code gives me the error: ERROR: ...
4
votes
2answers
2k views

Use variable in domain of a plot in tikz

Consider the following example: \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc,patterns,decorations.pathmorphing,decorations.markings} \begin{document} \begin{tikzpicture} ...
14
votes
2answers
4k views

Store \pgfmathresult in a variable

The result of \pgfmathparse is automatically stored in \pgfmathresult. Is it possible to store it in an other variable, too?