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)

5
votes
1answer
1k views

Bar charts: Change the vertical order of different plots and corresponding legend entries

I want to compare percentages of two different years using horizontal bar charts. The values for the 2 years (1996 and 2011) are given via a pgfplots table. I want the 1996 values to be shown in top ...
7
votes
3answers
556 views

What is the TikZ equivalent for the following PSTricks code? Drawing a free fall diagram

I want to learn TikZ using "learn by example" approach because this way helps me to save time by skipping unnecessary concepts. I have made an example, it is a free fall diagram in PSTricks as ...
2
votes
1answer
2k views

how to put two pictures together using minipage

I wish to put two pictures side by side using mini page, however, it seems the two pictures even not in the same borderline. Here is my code, I can not figure out what the problem is. ...
4
votes
1answer
478 views

CircuitTikZ splitting input into two gates

I have LaTeX code using the CircuitTikZ package for drawing a simple logic circuit, but I'm not convinced that my code is the correct way to do what I'm trying to do. Essentially, I have two inputs ...
4
votes
3answers
173 views

TikZ - bad positioning of images drawn by macro

Probably a lame question about how positioning in TikZ works. I'm trying to draw some electrical stuff (starting on the level of single gates) and because many of them repeat over and over, I want to ...
16
votes
4answers
2k views

How to draw a 3D hexagonal structure with TikZ?

What is the best way in TikZ to draw a hexagonal stucture in 3D? For example, graphite crystals, honeycombs or stable racks made of hexagonal aligned stiffeners. I already found this nice solution: ...
0
votes
0answers
54 views

draw the connect line using tikz [duplicate]

I wish to draw the picture as following: I write the code to draw the picture, however, I don't know how to draw the line that connects the diamond to the circle. \documentclass[tikz]{standalone} ...
3
votes
1answer
294 views

Vertical line next to a block, across page breaks

I'd like to mark examples, in an example environment in the text by drawing a vertical bar along the margin. I found a piece of code that uses the framed package to do this, but since the content of ...
19
votes
3answers
42k views

How to shift graphics/adjust placement of figure with \includegraphics

I composed a diagram that takes up the entire sheet of paper in landscape mode, called diagram.tex (compiled it to generate pdf). I'm trying to include that into an article, but only half of it is ...
1
vote
0answers
205 views

Why doesn't yshift seem to work in tikzcd? [closed]

In the tikz-cd documentation, the following code snipped is given: \begin{tikzcd} A \arrow[yshift=0.7ex]{r} \arrow[yshift=-0.7ex]{r} & B \arrow[xshift=0.7ex]{d} \arrow[xshift=-0.7ex]{d} \\ & ...
5
votes
2answers
432 views

Drawing boxes of any size and any location

How can I draw rectangles of any size and any placement on the current page? \PassOptionsToPackage{dvipsnames}{xcolor} \documentclass[landscape]{article} \usepackage{tikz,graphicx} ...
8
votes
1answer
338 views

Best way to connect 2 nodes with path going around other node

Imagine the following MWE: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node [draw, circle, minimum width=1cm] at (0,0) (n1) {n1}; \node [draw, circle, minimum ...
3
votes
2answers
2k views

subfigures using subfloatrow, overpic, tikz to add rows to annotate imported images/figures

I did my diligent search for a combination of subfloatrow, overpic, and adding arrows for annotation of imported images using tikz, but couldn't find one. These kind of images are typically found in ...
5
votes
2answers
891 views

TikZ Function Number Too Big

I want to draw two beta distributions comparing a prior and posterior distribution but it seems that the coefficients are too large for LaTeX? How do I fix it without changing the function? It has a ...
13
votes
1answer
3k views

Dependent node size in TikZ

I'm producing some control theory flow sheets in TikZ where I have specified the node box size. Since I'm making a lot of these flow sheets, I have set global styles for them, for instance the box ...
2
votes
1answer
300 views

difference between pdfLaTeX and LaTeX outputs

I am trying to render the following: \documentclass[10pt]{article} \usepackage{chemfig} \usepackage{tikz} \usepackage{etoolbox} \usepackage{float} \usepackage{xkeyval} \usepackage{chemmacros} ...
6
votes
1answer
176 views

Piecing together a diagram from other files

I'm in \documentaclass[landscape]{article} and I'm trying to figure out how I can put together a bunch of figures I've created (with the generous help of TSE users) on this document. What I'm trying ...
2
votes
1answer
216 views

Labeling user-defined shapes in TikZ

I have modified code for rotating a primitive 'match' shape (adapted from rotating camera code found here (Use a custom shape as a "building block"). How do I pass the label parameter in ...
4
votes
1answer
1k views

Manipulating isosceles triangle

\documentclass{article} \usepackage{tikz} \usepackage{pgf} \usetikzlibrary{shapes.geometric} \usepgflibrary{decorations.shapes} \usetikzlibrary{decorations.shapes, shapes, fit, arrows, ...
3
votes
1answer
336 views

Fixing fill on arrows in “compass”

How do I fix the coloring in the arrow head? It doesn't fill like the line width does. Also, you'll notice that the arrow touches D. How do I push D down? (Or is it best to just manually adjust it?) ...
3
votes
1answer
167 views

How to fill a rectangle with two corners on the function

I would like to be able to apply the same thing in the following figure for any function: Right now my code is like this(which is an edited version of some post here in Tex.sx): Wich only fills ...
7
votes
1answer
309 views

What is the “#” for in TikZ?

I am a newbie and I asked in How to create rectangles like in this example? about how to make some rectangles. I am trying to read the code and understand it as I need rectangles rather than squares. ...
9
votes
1answer
12k views

Changing line thickness of arrow

\documentclass{article} \usepackage{tikz} \usetikzlibrary{arrows} \begin{document} \begin{tikzpicture} \draw[step=1cm,color=gray] (0,0) grid (3,3); \draw[draw=black,solid, -triangle ...
3
votes
1answer
187 views

Tikz for loop for nodes

How do I construct a for loop so that I get \draw [step=0.5cm, gray!80] (0,0) grid (4,4); \draw [orange] plot [only marks, mark size=2.5, mark=*] coordinates {(0,0) (4,4)}; at every intersection?
3
votes
1answer
483 views

Arcing arrow and keeping proper arrow head orientation [duplicate]

I have \draw[draw=black!80,solid, -triangle 90,fill=black!80] (2.6, 4) -- (3.3, 4); I'd like the endpoints to be where they are, but I need it to arc. How do I do this? Edit: I'm looking for ...
32
votes
2answers
54k views

Adjusting font size with TikZ picture

Taking from the PGF manual, \begin{tikzpicture} \draw [help lines] (0,0) grid (3,3); \coordinate (a) at (rnd,rnd); \coordinate (b) at (3-rnd,3-rnd); \draw (a) -- (b); \node (c) at (1,2) ...
6
votes
1answer
2k views

How do I set top left position as the anchor for a node (TikZ)

Is there a way to position a node in terms of left/right coordinates of bounding rectangle? It appears to me that I can only specify center position.
2
votes
0answers
289 views

Combination of LuaLaTeX and TikZ lead to lots of undefined control sequence errors [closed]

I have a document that compiles fine under LuaLaTeX, until I add to the preamble the line: \usepackage{tikz}. Compiling after adding that line yields a lot of errors like this: ! Undefined control ...
13
votes
1answer
2k views

Package for drawing RDF graphs

Is there some package to draw nice RDF graphs, such as the one below (taken from there)? Can such a graph (with the same style) be produced in TikZ?
6
votes
1answer
216 views

Selecting specific nodes and changing style (for those nodes)

Is it possible to select specific nodes and color them green? I was thinking of using another for loop, but it doesn't seem like I can define more than 1 style. \documentclass{article} ...
5
votes
1answer
4k views

Drawing parallelogram with fixed angle, width and height?

I want to draw parallelograms with fixed angle, width and height, but it seems that trapezium in PGF/TikZ cannot specific the height without changing angles. \documentclass[tikz]{standalone} ...
4
votes
1answer
157 views

Fixing ordering of nodes and color (TikZ)

This is my first time using TikZ. I can't figure out how to change the ordering of the nodes from bottom up starting from the bottom left corner? Also, when I try to use package xcolor midnightblue ...
3
votes
1answer
1k views

Bringing the nodes of a TikZ decision tree closer to each other vertically

I am currently working on creating a decision tree for a journal publication and need to save space. As of right now, my decision tree looks like Although this is nice, I would like to "compress" ...
9
votes
1answer
554 views

Custom, space-saving ellipse as TikZ node shape?

in some applications, one wants to use ellipses as node shapes in figures, e.g., when in the literature on a subject typically uses ellipses to denote certain things in figures. The problems with ...
2
votes
1answer
99 views

Custom symbol on top of a variable which automatically gets scaled?

I want a custom symbol on top of a variable. The problem is that the symbol size always keeps the same if the variable size is changed. In a more sophisticated formula with fractions etc. that looks ...
4
votes
2answers
252 views

Graphical vertical rule in tikz

I would like to make design (class), where I would like to have special type of paragraph that will have { character on left and will have height exactly same as height of whole paragraph. Also, I ...
3
votes
1answer
289 views

Table and \tikzexternalize

It might not be a usual thing to do but I need to put some tikz pictures in a Table with externalization. I did \documentclass{report} \usepackage{tabu} \usepackage{tikz} \usetikzlibrary{external} ...
4
votes
1answer
665 views

Drawing on multiple images inside the same tikzpicture, how to get the right transformation of coordinates?

Following Drawing on an image with TikZ, I've had many succesful instances of drawing on a picture with TikZ. However, now I have a tikzpicture environment with several graphics, and I want to draw ...
6
votes
2answers
1k views

Align environment inside TikZ

I'm new to TikZ, and I'm trying to use the align enviroment to align some text then draw something on it using some TikZ lines. But the problem that pdfLaTeX is generating an error whenever I try to ...
7
votes
1answer
464 views

Typesetting straight baselines in a circular arrangement

I was wondering how one might go about setting the circular arrangement seen here in Figure "(2)"--i.e.,in a series of straight lines radiating from a central point. The most useful thing I've ...
3
votes
2answers
305 views

Optimizing a piece of TikZ code (involving rotation of ellipses)

I have the following piece of TikZ code and I was wondering if it can be optimized? (I am actually sure that it can be!) The main issue is this: When I rotate the first batch of nodes surrounded by ...
25
votes
3answers
12k views

How can I set the TikZ label anchor explicitly?

I want to add a label to a node, but "inside" the node. Something like this: The manual seems to indicate it might be possible, although no actual key is named. The ... anchor point for the ...
2
votes
2answers
650 views

How to position qtrees

Suppose, I have 2 qtrees, that I want to put below each other: \documentclass{article} \usepackage{tikz} \usepackage{tikz-qtree,tikz-qtree-compat} \usetikzlibrary{positioning} \begin{document} ...
2
votes
0answers
186 views

Stacked bargraph nodes near coords too bunched up vertically tikz [duplicate]

How do I center the coordinates in their bars vertically? This shows horizontally in ybar \documentclass[tikz,border=12pt]{standalone} \usepackage{pgfplots} \pgfplotsset{compat=newest} ...
35
votes
2answers
31k views

Increase the thickness of node border in TikZ

Suppose I have a node in the shape of a circle. How can I make its border thicker? \node[circle, draw=blue!80, inner sep=0pt, minimum size=12pt] (1) at (0,0) {1};
5
votes
1answer
558 views

Beamer and \foreach operator

This is my first figure trying to have it in the beamer with \foreach. For some of you may be it is work five minutes ... but for me it has consumed the whole morning ... So my question: How can I ...
2
votes
1answer
772 views

Change axis number format for external tikz file

I'm using \input{filename.tikz} to include .tikz graphs created by matlab2tikz in my LaTeX document. As shown in a comment on this question it is possible to change the plot marker size when the ...
16
votes
1answer
658 views

how to draw a chain of gears

I'd like to draw a chain of gears, like this: I'm using the macro provided by Alain Matthes in Creating gears in TikZ for drawing a single gear with some modification to obtain the "double gear" ...
3
votes
1answer
152 views

Node placement problem

This is my first question in tex.stackexchange. It might be relatively simple problem but I am having difficulties with the placement of the nodes inside graphics. The problem is that when I try to ...
4
votes
1answer
657 views

Grid lines in top-view surface plot

I'm almost satisfied with my graphs, only grid lines are missing. What I'm basically doing is a sort of density plot / color plot by letting pgfplots generate a surface and viewing it from the top: ...