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)

21
votes
1answer
616 views

Drawing Bruhat--Tits trees with TikZ

I am not a regular user of TikZ, and I was wondering if there was a quick way of drawing trees that look like ? (the picture seems to have been taken from page 71 of J. P. Serre's book on trees). ...
8
votes
2answers
549 views

Drawing a square with colored hatched little subsquares

I would like to draw a as shown below. It is a square grid. Some regions are hatched in blue, others contain a red cross. Some edges are blue, others are red, but the red color don't reach the ...
7
votes
1answer
144 views

Use brackets in a \def macro doesn't work

I am using TikZ to draw some graph drawings (with nodes and directed edges/paths). I have two nodes and an arrow pointing from one node to another. I have made a macro called \pathedge so I can use ...
1
vote
1answer
535 views

Can I calculate a square or square root to include as coordinates in a tikz picture?

I am trying to draw the folding lines of a paper plane. This as a template for my kids to learn how to fold a paper plane. I came as far as: % based on ...
3
votes
2answers
693 views

Reusing circuit code with nodes in TikZ

I'm new to TikZ/PGF (a week or so in), and am loving it. I've had good success making figures so far, but have a question about best practices for including multiple copies of a sub-circuit in a ...
3
votes
1answer
108 views

Why does `align` break `tikz` node placement?

I want to put some marks in the document and place desciptions of these marks in the margin area, one below another. It works fine, however if I place a mark inside align environment corresponding ...
5
votes
1answer
314 views

Add background pattern to tikzpicture vertical bars

How do I replace the blue backgrounds as indicated in the picture with a diagonal and grid pattern respectively? I currently can't find a neat solution for my kind of graph. Code ...
3
votes
1answer
115 views

Inclusion of pgfplotstable in tikzpicture

Is there any way to include a table generated by pgfplotstable in the tikzpicture environment, where other figures generated by pgfplots exist, in order to save them together as one figure with ...
5
votes
1answer
3k views

FlowChart with TikZ

I'm trying to build a flowchart using the tikz environment but I'm having some trouble connecting the "No" line from decision to int (and from update to int). How can i draw a line avoiding ...
5
votes
1answer
210 views

Drawing transitive diagram in Tikz

I am very new to Tikz. How to draw rounded arrows and nodes without rectangular boundary. I want to draw something like this:
7
votes
2answers
1k views

Increasing precision in \pgfmathsetmacro

I would like to use \pgfmathprintnumber[/pgf/number format/frac]{\var} where \var is a variable set by \pgfmathsetmacro and I'm having similar difficulties as in this and this question. I'm aware ...
5
votes
1answer
228 views

Coons patches in pgfplots

The current method of drawing Coons patches in pgfplots requires four cubic Bézier curves along with point meta values for each corner point. This closely follows the format used in the PDF ...
5
votes
1answer
793 views

TikZ ER diagrams: really can't underline keys?

I'm creating an ER diagram with the TikZ ER library. The manual warns that although key attributes are conventionally underlined, it is hard to implement in TeX and the library uses italics instead. ...
1
vote
1answer
104 views

How to prevent a series of tikz nodes from overlapping?

I have the following MWE for the note command I'm working on. \documentclass{article} \usepackage[a5paper,marginparwidth=15mm]{geometry} \usepackage{tikzpagenodes} \usetikzlibrary{calc} ...
4
votes
1answer
706 views

TikZ - move calculated point to origin

i am trying to draw a point relative to a rectangle and than shift the whole rectangle so that this point is aligned with another point. \documentclass{standalone} \usepackage{tikz} ...
3
votes
2answers
170 views

TikZ-PGF child nodes in different locations

When I use TiKz to draw two trees, each in a nested picture, the position of the middle child of the second tree is different from the first. This is even though the code for the trees is basically ...
9
votes
2answers
8k views

How to draw Bar & Pie Chart

I'm want to include two graphs mentioned below in a document. I'm able to draw pie charts using pgf-pie. Is there any package which is capable of generating BAR & PIE Chart both? [Also which ...
4
votes
2answers
457 views

Problem with titlesec/titletoc/tikz

I have a problem in the sheet dedicated to the table of contents. I'm using titlesec/titletoc/tikz which works fine except in the page "table of contents". I have this result : The problem is that ...
5
votes
1answer
534 views

knitr and font style consistency in graphics

I am starting to use knitr to print graphics from R in my document. So far what I have been doing (I don't know if this is the best approach, but it is working) is to load the my R workspace with ...
5
votes
1answer
279 views

An overview of node positioning?

I've been making tikz pictures for a while now, and there seem to be a number of different ways to position nodes within a diagram. Absolute coordinates, east/west, left/right, the $ $ things, minimum ...
8
votes
1answer
186 views

Difficulty placing a dynamic fill command within a “\path let …” TikZ structure

I wanted to create a sequence of images that show a rhombus being folded. I'm able to do what I want, but the code is not very elegant. I wind up (needlessly?) repeating chunks of code to get the ...
5
votes
2answers
1k views

Text alignment using fix anchor positions in TikZ

I created some biological drawings using Dia and exported them as TikZ TeX code. I want to define some commands that insert these drawings and add some text to them. As there is a lot of text and ...
3
votes
0answers
47 views

Pgfplots bar chart - One plot, different colors [duplicate]

Is there a possibility to color bars of one plot in different colors? \begin{tikzpicture} \begin{axis}[ xbar, xmin=0, width=12cm, height=3.5cm, enlarge y limits=0.5, xlabel={\#participants}, ...
12
votes
1answer
8k views

How to fix the node size in TikZ?

I am simply looking for a way to fix the size of my node (block) regardless of the text inside. I find several posts similar, but not the same. All the solutions given make use of minimum width=0.1cm ...
2
votes
1answer
345 views

Error trying to compile tikzpicture code

Some of my tikzpicture code won't compile anymore. The following code used to compile (2 years ago), but now I get "ABD: EveryShipout initializing macros ! Package pgf Error: No shape named B is ...
4
votes
2answers
177 views

One big box contains three parallelly placed small boxes?

I am trying to make the three small boxes inside a big box with tikz. The three small backs are placed side by side at the bottom of the bog box. What I have tried so far is: ...
6
votes
1answer
631 views

pgfplots intersection with path

I am trying to find the intersections of a path with plots from pgfplots via the intersection library. The intersections found clearly do not match the visable intersections. It seems as if they are ...
1
vote
0answers
172 views

Scaling arrows in TikZ [closed]

I followed the link to sourceforge.net from Is it possible to change the size of an arrowhead in TikZ/PGF?. The last comment by left by Till Tantau led me to believe that I could implement code where ...
6
votes
1answer
413 views

\Mapsto in tikz-cd

I'm loving using tikz-cd to draw compiler correctness diagrams, but I can't manage to get quite the same arrows for relations that I'm using in the text. In particular, I'm not sure how to get \Mapsto ...
3
votes
0answers
113 views

Scalable node shape size [duplicate]

I can adjust the shape of nodes using commands such as minimum width or inner xsep, but these require explicit units. When I scale the entire figure (\begin{tikzpicture} [scale=0.5]) it does not scale ...
2
votes
1answer
389 views

tikzpictures positioning

I am having trouble trying to position tikzpictures in their correct position... I want to place the 3 plots with the green filling in a single line above (with the alpha/2 right below), and the 3 ...
1
vote
0answers
70 views

Trim/Clip scope by a defined curve [closed]

Hy I have to plot a vector field inside region in tikz. The arrows of the vector field should not appear outside the region. The region is the interior of : \draw [black, fill=white] plot [smooth ...
7
votes
1answer
247 views

Change filling of TikZ nodes in repeated picture

A diagram drawn with TikZ is used a couple of times and I defined a command for it. In the first picture I want to mark a subset of the nodes by filling them with light gray, and another subset of ...
8
votes
3answers
320 views

box the size of A containing B

A thing I'd often like to do is put in my document a box the size of some text A and containing some other text B. For instance, I have two tikz nodes, one containing $n$ and one containing $n+1$, and ...
7
votes
1answer
291 views

Breaks in tikzpicture graph

I have a graph drawn using tikzpicture and even though I've increased the resolution there are still gaps in the graph itself. \documentclass{article} \usepackage{tikz} \begin{document} ...
2
votes
1answer
167 views

Why do these two plot commands give different results?

Why the following two MWE codes, using pgfplots with and without gnuplot give different results (a phase shift)? \documentclass{article} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} ...
5
votes
2answers
718 views

Drawing molecules with tikz

I have to draw a molecule in 3D with a little pore represented by a 3D sphere inside of it with the same center. I have never used TikZ but I know that it's useful for drawing in LaTeX and I hope ...
4
votes
1answer
407 views

Wrong point when barycentric coordinates in triangle add up to one

I am trying to plot points on a triangle using areal coordinates (barycentric coordinates that add up to one). Using TikZ and the barycentric coordinate system, however, this gives the wrong point in ...
16
votes
1answer
1k views

How to rotate a pgfplot?

I'm trying to create a plot like this: So far, I arrived here: With the following (minimalized) code: \documentclass{report} \usepackage{pgfplots} \pgfplotsset{compat=1.8} \begin{document} ...
0
votes
1answer
1k views

Drawing database tables in tikz

I am bit confused about how can i draw a table like this using tikz. Any ideas please?
5
votes
1answer
218 views

Array indexing does not work for the node label

There is something I cannot understand. I'm using array indexing and it works for determining the radius of the circles and to positioning the nodes. However it does not work as the node content. ...
4
votes
1answer
425 views

How to label a TiKz shape for referencing its legend in the caption

How can I label a TiKz line style for further referencing in figure caption. For \addplot the label just follows it. However, I don't know how to do it for \draw. MWE: \documentclass{book} ...
9
votes
2answers
594 views

Label variables of equation using tikz without using itemize

I'm trying to use tikz to label the variables of an equation. I know of a similar question (Itemized Equation) but the answer uses itemize to label the variables. I would like to do something similar ...
3
votes
1answer
192 views

TikZ multiple coordinate frame implementation not working

I'm attempting to use TikZ to draw three different coordinate frames. I have successfully done it already. However, in an attempt to make my code more readable, I tried breaking it down into a more ...
11
votes
1answer
705 views

Why does TikZ ignore my instructions for setting the bounding box?

The bounding box for the following image is wrong (even though I've tried to set it) \documentclass{article} \usepackage[margin=0.25in]{geometry} \usepackage{tikz} \usetikzlibrary{calc} ...
11
votes
1answer
439 views

Telling Tikz/Tex to produce raster instead of vector in resulting PDF

I am using MikTeX and Tikz package to generate images (playing cards on A4 paper). The result is nice, but slow (too many vector objects, printing is hell slow). Is there a way to directly tell TeX ...
6
votes
2answers
219 views

How to highlight a pair of terms with compact, rectangular, semi-transparent, colored regions?

I want to create a GIF animation showing the process of multiplying 2 binomials. Each frame must only show a pair of terms that are highlighted with a compact, rectangular, semi-transparent, colored ...
2
votes
2answers
393 views

Thermistor in Tikz circuit library

Is there a symbol like a thermistor in the Tikz circuit library? I read the documentation and couldn't find anything like it. There is a symbol for a varistor but what I'm looking for would be ...
8
votes
1answer
170 views

How to draw a double continous arrowhead [tikz]

I want to draw lines with double arrowheads which continously following each other (e.g. torque in mechanics) Now I draw two following lines which complete each other like \draw[] (0,0) ...
2
votes
1answer
5k views

TikZ: Label nodes on to path

I use the to syntax to set a node in the horizontal middle between to other nodes. My problem is, that a label does not fit well at this middle node. Compare the label of node 2 and node 3 in the ...