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)

3
votes
0answers
224 views

TikZ: Unexpected difference between \draw and — vs \path and edge [closed]

While modifying this answer for my own use, I encountered something unexpected. In my experience, using \draw (1) -- (2) is equivalent to \path (1) edge (2). However, adding the option to draw or ...
4
votes
1answer
427 views

What is the easiest way to accomplish textual tick labels in tikz?

Consider the following simple PV-diagram: The code below created it and the output is fine. I used kind of a workaround with an array to get the right tick labels on both of the axes. That works ...
13
votes
3answers
363 views

How to improve on this “twolines” decoration?

I'm typesetting an article on graphical calculus in tensor categories in TikZ and I wanted to define a decoration that draws two parallel lines at the same time. Here is my first try: ...
4
votes
1answer
714 views

style odd and even nodes near coords differently

I'm using this style definition in the preamble: \pgfplotsset{ base/.style={ ymin=0, xtick=data, nodes near coords, } } \pgfplotsset{ random/.style={ ybar=3pt, bar ...
4
votes
1answer
120 views

TikZ: computation in node name

I want to place a variable number of nodes on a page, but I also want to be able to give these nodes a (integer) name. However, I run into the problem that only certain kind of commands can appear in ...
5
votes
1answer
233 views

TiKZ generates unneeded whitespace

Edit: I did compile this document: \documentclass[DIV14,parskip=half-]{scrartcl} \usepackage[utf8]{inputenc} \usepackage[ngerman]{babel} \usepackage[T1]{fontenc} \usepackage{tikz} ...
3
votes
2answers
327 views

Optimized creation of text nodes

I have created a block diagram with several nodes with text and I need to optimize the node creation and hopefully use the \foreach construct to automate the creation of each node with its associated ...
3
votes
1answer
89 views

Alter location of edge in graph in tikz

So I have the following: \begin{tikzpicture}[shorten >=1pt,node distance=1.75cm,thick] \node (A) {$A$}; \node (B) [below left of=A] {$B$}; \node (C) [below right of=A] ...
2
votes
2answers
186 views

Creating Multiple-State Models (rectangular nodes)

I would like to replicate the following image for my work: I now have the following MWE: \documentclass[12pt]{article} \usepackage[margin=2cm]{geometry} \usepackage [english]{babel} ...
2
votes
1answer
191 views

Tikz externalization: Latex dvi/ps produces a4paper boundary-box around figure

I am successfully using tikz in combination with externalization and pdflatex for some time now. But now I need to switch to latex->dvi->ps. I followed the instructions from the tikz documentation ...
5
votes
1answer
532 views

Rotate only the shape

Is it possible to rotate only the shape, keeping the anchors and text inside the same? \documentclass[12pt,a4paper,preview,multi={tikzpicture},border=0pt]{standalone} \usepackage{tikz} ...
5
votes
1answer
260 views

How can I remove the white space within a cloud in TikZ?

I am trying to produce a figure which contains a cloud drawn around a set of images. The code I have so far is: \node [draw, cloud, cloud puffs=20, aspect=2, inner sep=0cm] (pathways) ...
3
votes
0answers
355 views

Custom tikz pattern: hatchangle

In PSTricks there exist the fillstyles vlines, hlines, crosshatch which have counterparts in tikz patterns library. However, in PSTricks they can be modified by following options: hatchwidth, ...
1
vote
0answers
94 views

Can I make an alias for a node argument in TikZ

When I am drawing illustrations with TikZ, the most common mistake I make is incorrectly writing the relative position of a node. I would for example write "left above" in stead of "above left". It is ...
3
votes
1answer
2k views

Undefined control sequence \draw and \end{tikzpicture}

I am trying to draw a picture in LaTex. When I compile the file it gives me an undefined control sequence error. I tried to compare it with my other documents but I can't find where the error is. I am ...
3
votes
3answers
1k views

How do I draw shapes inside a tikz node?

I know how to draw different shapes using tikz, like this: \documentclass{minimal} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw (0,0) ellipse (1 and 1.5) (0,2.5) circle (1) ...
6
votes
1answer
824 views

Why does \resizebox around tikzpicture gives me undefined control sequence }?

As indicated in Scale tikz figure to a percentage of \textwidth I was expecting this to work: \documentclass{memoir} \usepackage{tikz} \usetikzlibrary{matrix,positioning} \begin{document} ...
4
votes
1answer
199 views

Making tikz draw go almost all the way

I have by looking at examples at this site got quite far with tikz but not all the way. I know this might be considered a bad question -- but since I got this far by looking at similar question this ...
5
votes
1answer
694 views

Tikz fill double line with pattern not with color

I'd like to fill the inner of a double line path with different patterns: hatch, random dots, Poisson discs, grid. Consider following hexagon, where I would like to fill the inner of the edges. ...
5
votes
1answer
355 views

Custom draws in matrix nodes in tikz v3 with referencing

With tikz v3 the matrix behavior has changed slightly. The great example at http://www.texample.net/tikz/examples/BER-measurement/ doesn't seem to compile any longer. The problem is that the default ...
3
votes
1answer
273 views

How to simplify path?

I have the following MWE: \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \coordinate (a) at (0,0); ...
0
votes
1answer
333 views

Combination Function with Factorial - Not correct result - Pgfplots

\begin{tikzpicture} \begin{axis}[ axis lines = left, xlabel = $Number of Elements$, ylabel = {$Combinations=\frac{(n)!}{(n-r)!(r!)}$}, ] %Axis \addplot [ domain=2:10, samples=100, color=red, ] ...
1
vote
1answer
156 views

Using TikZ to label a Commutative Diagram with a Picture

I'm writing a beamer presentation and having some diagram troubles. Is it possible to label an arrow in tikzcd with a tikzpicture? For example, the code \begin{tikzcd} S^1 \arrow{r}{ ...
4
votes
2answers
260 views

representing a null child in a binary tree using `ground` symbol

I'm using ground symbol to represent a null child in a binary tree. But the ground symbol has arrows in it. How do I remove them? \documentclass{llncs} \usepackage{llncsdoc} \usepackage{tikz} ...
1
vote
1answer
478 views

PGFPlots - trying to combine legends

I have an interesting problem. I am trying to create two graphs using the groupplots environment, side-by-side, that show different sets of data elements with different legend entries and different ...
6
votes
1answer
243 views

Overcome 'Dimension too large' when using the forest package with a lot of nodes

I am drawing a genealogical tree with the forest package in which I have approximately 50 nodes. I have reached a point where I get the message "Dimension too large" when I try to add another node. I ...
3
votes
1answer
262 views

Centering / horizontal alignment of text inside tikz boxes

I am facing a problem with centering the text inside the boxes: \documentclass[a4paper,fontsize=12pt,a4paper,DIV=10,BCOR=10mm,twoside,titlepage=false,openany,pagesize]{scrbook} ...
2
votes
1answer
283 views

LaTeX beamer: get a picture in the foreground

I am trying to write some style file for a poster framework, we can use. The header is almost ready: \setbeamertemplate{headline} { \begin{beamercolorbox}[ht=15cm]{headline} ...
5
votes
1answer
1k views

Change node style in a tikz picture

I'm trying to change the node style so a node looks like a cylinder with a variable height. currently i'm using this code \documentclass{scrartcl} \usepackage[utf8]{inputenc} \usepackage{tikz} ...
6
votes
1answer
430 views

Aligning both tikz pictures and their captions

I am using two tikz pictures in subfigures. The baseline parameter allows aliging the subfigures via the nodes, however the caption (b) is much above the caption (a) in such case. If I don't you ...
3
votes
1answer
528 views

How can I draw an ellipse with a rainbow color?

I need to draw a rainbow-colored (hue colormap) ellipse in tikz. Something like this but then in an ellipse shape, and in tikz. I've thought about drawing to ellipses, one with rainbox filling, the ...
3
votes
1answer
408 views

Using tikz to create fancy Table of Contents

I am trying to create a fancy thesis style and I am stuck in the table of contents. I am adopting Pluton's idea from How to customize the table of contents using TikZ? but I get an error stating that ...
7
votes
2answers
388 views

Why is beamer+pstricks+preview no longer compatible now?

The following code is taken from Gonzalo Medina' answer here (click). At the time he posted the answer the code was compilable. \documentclass{beamer} \usepackage{pstricks-add} ...
12
votes
3answers
433 views

Plot 3D stacked squares with shadow

This is an image I draw with tools. But I need to draw it with Tikz. And The 3 squares in the middle, I need to make them looks like 3D stacked with shadow. And the fonts on it, like 'a1', 'a2', ... ...
3
votes
1answer
3k views

Add a horizontal line to a PGFPlot and add it to the legend

I have a PGF Plot with some computational results from a CSV file. At the time the CSV file was generated, there was a value that was not known. That value needs to be on the plot also, however. What ...
3
votes
0answers
182 views

Getting a value, which has been given to a TikZ key

I'm trying to write a package based on TikZ, and this is the problem i'm currently stumbling upon. Let's assume, that I have a key, for example /tikz/circuit symbol unit, which executes some code. ...
3
votes
1answer
443 views

How do i get the coordinates (east, west, north) of an ellipsoid? (code does work for rectangulars)

\documentclass{report} \usepackage{tikz} \tikzset{add reference/.style={insert path={% coordinate [pos=0,xshift=-0.5\pgflinewidth,yshift=-0.5\pgflinewidth] (#1 south west) coordinate ...
8
votes
1answer
353 views

Draw background lines dashed in TikZ-3dplot depending on view position

In the graphic the red line is partly covered (in the background) of the 3d-object. Is it possible to draw the background parts of the lines dashed (or calculate the "intersection" points)? After ...
5
votes
1answer
1k views

Using TikZ to draw array figures

I am new in LaTeX and even more on TikZ. I want to use TikZ to draw the kind of figure described in the below picture. I looked for some tutorial or particular topics that deals with that but never ...
4
votes
1answer
86 views

tikz edges too long, how to control the distance of nodes

I have in a beamer class document the following graph: \begin{center} \begin{tikzpicture} [auto] \tikzstyle{every node}=[font=\small] \tikzset{ inst/.style={draw=black, rectangle}, ...
24
votes
4answers
2k views

How to shade text in different colors?

I need a single character in two colors. Figuring I could use the shadings library of TikZ, I followed the manual (section 23.4.1, the TikZ example): \documentclass{article} \usepackage{tikz} ...
3
votes
1answer
3k views

PGFplots - single legend in a group plot [duplicate]

I have a group plot and when I try to add a legend it repeats on all subgraphs. I want a single common legend line at the top of the whole graph. \documentclass{standalone} \usepackage{graphicx} ...
1
vote
1answer
190 views

PGFplots multiple ylabels

I want to have multiple y labels in a group plot. Now I have 4 different values for ylabels:Range1, Range2, Range3 and Range4. I want to add a common ylabel say "throughput". How do I do that? ...
2
votes
1answer
1k views

pgf Error: Arrow end type ``latex''' unknown

The following document: \documentclass[]{article} \usepackage{tikz} \usepackage{tikzscale} \usetikzlibrary{trees} \usetikzlibrary{calc} \begin{document} \tikzset{ block/.style = {draw, fill=white, ...
9
votes
2answers
590 views

Arrow tip center with TikZ (and pgfplots)

The arrow default behaviour is shown on the left picture part. How can I achieve that the “circle” arrow tips (see the picture below) end at their center, as drawn in the right image, but without ...
4
votes
1answer
185 views

Fading Nodes Along edge using `\draw`

How can i make nodes along an edge fade, here is the code i used to create the nodes \documentclass{standalone} \usepackage{tikz} \listfiles \usetikzlibrary{shapes,snakes} ...
8
votes
2answers
679 views

Drawing on a 3d cube with tikz

I can draw a cube as: \documentclass[12pt]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \pgfmathsetmacro{\cubex}{2} \pgfmathsetmacro{\cubey}{1} ...
6
votes
4answers
390 views

Difficulty with Tikz curves

I would like to draw this curve: Using tikz, I did the following \begin{tikzpicture} \draw [<->,thick] (0,5) node (yaxis) [above, text width=3.5cm,align=center] {$B_{J}(x)$} |- (7,0) ...
5
votes
1answer
1k views

Use timeline library with months

I'm trying to adapt this answer to a timeline that has months instead of years. The first part of the MWE below is just the timeline library. \documentclass[tikz]{standalone} % Timeline library ...
5
votes
3answers
7k views

Draw a binary tree using tikz

I'm trying to draw a binary tree using tikz package. If I use only circle, I get a tree. But I want to represent a subtree using a triangle. Now the tree gets uneven. I want to attach the arrows to ...