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
1answer
55 views

Beamer, TikZ and step by step colored figure ending in PGF Math Error (divide by 0)

I'm new to TikZ, and I'm trying to "animate" successive reading of values on the curve representing a mathematical function. The point is to achieve step by step visual enhancement to focus the care ...
1
vote
1answer
33 views

Listings and verbatim-like environments in a tikz node using newcommand

I have seen answers to this question floating around but none of them appeared to solve the problem. I want to be able to throw a code block into an already defined tikzpicture. So I attempted to ...
1
vote
1answer
32 views

Getting errors in the “graph” code using tikz

I've copied a code snippet from http://www.texample.net/tikz/examples/tkz-berge/ in order to see if I get it to run smoothly. I can not. Below is the snippet I've used: \documentclass[]{article} ...
1
vote
2answers
70 views

How do I trisect an angle using tkz-euclide?

Using the \tkzDefLine[bisector](A,B,C) command in tkz-euclide, you can bisect an angle. How can I cut an angle in three or more equal parts?
3
votes
1answer
66 views

Add plot to node in Tikz matrix

Using the code at the end, I was able to create this image. I would like to add a plot (I'm plotting kernel densities) to each of the nodes on the edge, and move their labels below the plot, ...
5
votes
1answer
54 views

Assistance fixing this drawing of interlocking tori using sketch/tikz

I am trying to draw an interlocking tori like this one: For this I have been looking for the web for similar images and then have tried to modify the code. So far I got to this: def torus { ...
3
votes
1answer
47 views

How to get xstring methods variables work with pgfmacros and vice versa in all situations?

I am trying to draw simple graph with my command: \documentclass{article} \usepackage{tikz} \usepackage{xstring} \usepackage{float} \begin{document} \newcommand{\lT}[4]{ \draw[line cap=round, line ...
3
votes
1answer
99 views

Absolute positions of text over a tikz image

I'm trying to create a composite figure in Latex, by layering two images (pngs) on top of each other with a text label added. Sadly, this seem surprisingly difficult to achieve in LaTeX. I tried the ...
3
votes
2answers
71 views

horizontally align group of nodes with respect to coordinate

I have one node (or rather, a coordinate) and a couple of nodes which are aligned in one "row" (via right=of, left=of). They are aligned below each other (via below right=of), \documentclass{article} ...
0
votes
0answers
35 views

Generating sequence of SVG images with Tikz/Beamer

I use Tikz and Beamer a lot when creating slides and I was wondering if there was a simple way of using the same framework to generate a sequence of SVG images (or any other format that could be used ...
3
votes
1answer
84 views

How to draw open-close interval in LaTeX

I am using the following commands to have half-open interval in a real line: \begin{tikzpicture}[scale=7] \draw[->, thick] (-0.1,0) -- (1.7,0); \foreach \x/\xtext in ...
2
votes
1answer
43 views

Tkz-berge graphs, equal arrows with unequal subfigures?

In the following MWE (alas, it is not small): \documentclass{article} \usepackage{tkz-berge} \textwidth16cm \begin{document} \begin{tikzpicture} \tikzset{VertexStyle/.style = { shape = circle, ...
3
votes
1answer
65 views

Undefined control sequence error when using tikz-uml package in LaTeX

I am trying to build a simple UML diagram in LaTeX using a tikz-uml package. I am failing when using \umlinherit command. My code and an error message are below, thank you for any ideas! ...
3
votes
1answer
66 views

How to fill a line one-sided using TikZ?

Usually, when drawing a line in TikZ, 'material' is added to both sides of the line to make it visible. Consider the image below (not sketched using TikZ). If I want to draw a black and rather fat ...
0
votes
1answer
52 views

Plot sin(x)/x using TikZ

Something is going wrong here... \documentclass[10pt]{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{figure}[!h] \centering \resizebox{.5\linewidth}{!}{ ...
1
vote
1answer
45 views

How to translate a figure on a path (rollercoaster)

Is it possible to make something like this: The best thing I could do was this: With this code: \documentclass[symmetric,justified,a4paper]{tufte-book} \usepackage[utf8]{inputenc} ...
1
vote
2answers
85 views

How to multiply string?

\usepackage{tikz} \usepackage{xstring} \begin{document} \newcommand{\nG}[3]{ \node[opacity = 0, text opacity = 1, minimum size = 10mm] at (#1, #2){#3}; } \newcommand{\writeSep}[4]{ \foreach \x in ...
2
votes
1answer
49 views

Why does `shape aspect` not work for rectangular TikZ nodes?

The documentation of TikZ seems to indicate that shape aspect is available for all node shapes. However, the command is only available if shapes.geometric is loaded and for some shapes (e.g. diamond). ...
1
vote
1answer
41 views

Tikz-adjust node size according to text length

I want to create a rectangle with Tikz as a background for a text. It will be a headline for my custom titlepage. I created the rectangle node and a node for the text separately. I want to change the ...
0
votes
2answers
59 views

TikZ Text connected with a rectangle

I want to use TikZ to describe/display the user interface of tool. Therefore, I need a text block that is conected to a rectangle with a line (see example below) but I don't know how to connect the ...
5
votes
1answer
379 views

Tikz : compare x^3 and 2^x * x from x = 0 to 10

I'm far from being an expert in TikZ because I just start using it. I would like to be able to plot this comparison of equations: This plot came from the Wolfram Alpha, which is a very good ...
0
votes
1answer
45 views

Overlap texts or pictures at specific positions above an array

I have a frame which contains a piece of code: \documentclass{beamer} \usetheme{Boadilla} \usepackage[frenchb]{babel} \begin{document} \begin{frame}{title} \begin{array}{l} int v \\ v ...
1
vote
1answer
60 views

Tikz picture dissapears when zooming pdf above certain percentage

I want some shaded lines, so, as I didn't find any specific command for this, I'm trying to do it with a very thin rectangle. I compile with pdflatex and zooming the pdf makes the lines, and, ...
2
votes
0answers
37 views

xelatex doesn't work properly with tikz when pgfpage with \pgfpagesuselayout is used!

I'm trying to make a fading background using tikz. It works great with pdflatex, but when I use xelatex it doesn't work properly. As I noticed the problem is because of \pgfpagesuselayout command. I ...
2
votes
1answer
31 views

clickable area shifted when typesetting by xelatex for Clickable Plots

I have the following codes for clickable plots: \documentclass{article} \usepackage{pgfplots} \usetikzlibrary{pgfplots.clickable} \pgfplotsset{compat=newest} \pgfplotsset{yticklabel style={text ...
2
votes
0answers
44 views

Alignment of TikZ Pics in TabularX

What is the easiest way to get that last square aligned the same was as the first two? Do I need to create a \newcolumntype that somehow centers the content both vertically and horizontally? If so, ...
3
votes
1answer
60 views

Slightly move x- or y-axis tick label in pgfplots

In the MWE below, I'd like to move the x-axis labels slightly away from each other horizontally and the y-axis labels slightly away from each other vertically, to avoid overlapping. How can I do this? ...
1
vote
1answer
64 views

Disable Algorithm Key

I guess it is a rather simple question: Is it possible to disable or unselect an algorithm in the graph-drawing library? The reason for this is that I am defining a command that uses the \graph ...
0
votes
1answer
34 views

TikZ matrix angle brackets mis-interpreted [duplicate]

I'm newbie to TikZ. When I use < and > in matrix, they are interpreted to some other symbols. The following code \documentclass[tikz,convert=pdf2svg,multi=false]{standalone} ...
1
vote
0answers
61 views

Odd behavior of tikz in beamer style

I want to create my own beamer style for my presentations, and I follow this link to do so. I change the title page template as following \defbeamertemplate*{title page}{texsx}[1][] { ...
2
votes
1answer
77 views

Tikz animated figure coordinates from a vector

Is there any possibility to take coordinates in an animated Tikz from a vector? For example in the code below which I found at ...
2
votes
1answer
31 views

Pgfmath misbehaving when reading negative values from table in Pgfplots

I am astonished that when I attempt to square a number read from a table with pgfplots, the result has the same sign. Consider this: \documentclass{standalone} \usepackage{pgfplots} ...
1
vote
1answer
66 views

Font size in PGFPlots Minipage

I am using this guide to put concorde tsp solver's vector graphics in LaTeX. I want to show 2 images and a description text right next to them, all side-by-side. I am usign the minipage to do so, but ...
3
votes
0answers
43 views

How to avoid double & dotted/dashed lines unexpectedly joins the segments?

As you can notice, the dots of the dotted double line are joined by two very thin lines. Also the dashed-double line joins them automatically. Is there a way out to remove those unions? (I left knots ...
2
votes
1answer
50 views

Option argument for Beamer section slide

I am creating my own Beamer theme with a custom section slide. Ideally I would like the command \frame{\sectionpage} to have an additional, optional argument, that specifies the color of the ...
2
votes
2answers
51 views

Center tikz vertically inside tabular cell

The black tikz boxes/nodes are not vertically aligned inside the cells. Does anyone know how to do it? Thanks in advance, and please ignore irrelevant code, I know it's not very clean or ...
4
votes
1answer
72 views

TikZ: Drawing edges between subgraphs

I have this: \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{graphs, graphs.standard} \begin{document} \tikz \graph [simple, nodes={draw, circle, minimum size = .5cm}, clockwise] { ...
2
votes
0answers
37 views

PGFPlots: Sometimes minor ticks don't show

See code below: xtick={-0.8,0,...,3.2} does not show minor x ticks, but, for example, xtick={0,0.5,...,3.5} does. I'm confused, what's going on? \documentclass[border=0pt]{standalone} ...
2
votes
2answers
59 views

Blue box next to header (tikz)

I would like to draw a blue box next to the header but the blue box should be in the margin and not be part of the header it self. In the real document the margins are set with geometry. ...
3
votes
1answer
215 views

How to draw a function like sin(x)~cos(x) in tikz/pgfplots?

In R it's easy to do something like x <- seq(0, 2*pi, 0.01) plot(sin(x), cos(3*x), type='line') to get the plot How can I make such a plot using tikz/pgfplots?
4
votes
1answer
62 views

Drawing a graph with labeled edges in foreach loop

How to add different label for each edge in example on the picture. How can I do this in foreach loop? \begin{tikzpicture} [scale=.8,auto=left,every node/.style={circle,fill=blue!20}] \node (n6) ...
11
votes
2answers
174 views

Why are objects not horizontally aligned when using rotation?

This is my code. \documentclass{article} \usepackage{tikz} \begin{document} \def\magnet at (#1,#2,#3){\draw [rotate=#3] (#1,#2) ellipse (0.8 and 0.4) node at (#1-0.4,#2) {N} ...
3
votes
2answers
113 views

Is there a guide on creating graphs in Latex for signal processing?

I wish to create a graph commonly used in signal processing, for example: I am not sure if I should go about exploiting Tikz or use some other software to generate this plot. Does anyone know if ...
2
votes
1answer
43 views

`Missing = inserted for \ifnum` when using addplot

I'm trying to plot a normalized sinc function with PGFPlots/TikZ. As this is somewhat tricky because of the limiting value at 0, I used a suggestion provided by percusse. Here's a minimal example ...
1
vote
1answer
32 views

How can I use \foreach to place nodes in a pgfplots axis?

I am trying to foreach over some coordinates to place nodes at whilst inside an axis environment. I followed the advice here, but I am getting nowhere; the following fails with error ! Argument of ...
4
votes
2answers
51 views

vertically align TikZ snippet in text

When creating a TikZ snippet inside a figure caption, the snippet is never really aligned with the surrounding text. For example, \documentclass{article} \usepackage{tikz} \begin{document} ...
5
votes
1answer
65 views

Is it possible to draw a tree using standard syntax without overlapping, if graphdrawing is loaded?

It seems that merely loading the graphdrawing library can mess up drawing a tree using the standard TikZ syntax. Is there a way to avoid this unwanted effect? For example: ...
1
vote
1answer
37 views

Pgfplots: Labels from data table not working as expected

I use pgfplots for the first time, so the error is probably at my end, but I was under the impression that xlabels from data={\table}{colname} could be used to set strings from a data table as ...
3
votes
3answers
267 views

Tikzpicture: Step function (most minimalistic!)

I found nice example of step functions, e.g. probability-density-function-of-uniform-distribution and drawing-cumulative-distribution-function-for-a-discrete-variable. But they use extensive ...
1
vote
1answer
136 views

How to draw Forward time difference diagram in TikZ?

I am trying to draw a diagram of mesh points for Forward time difference method (\frac{u_{i}^{n+1}-u_{i}^{n}}{\Delta t}) in TikZ but I am unable to draw it. I have only drawn coordinates by using ...