Tagged Questions

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)

1
vote
0answers
3 views

How can I draw a twisted 3D arrow?

Does anyone know how I can draw an 3D arrow that in itself is twisted by 90 degrees? I need such arrow to show how polarized light is twisted in a liquid crystal. I would like to include that arrow ...
2
votes
1answer
18 views

With TikZ is it possible to pass the node content through a preprocessor?

I've written a macro that scans its content for illegal characters and then changes them to something more appropriate. In the following example, the macro scans for _ and replaces them with ...
2
votes
1answer
29 views

Labels and Pins with Tikzlibrary Graphs

I want to draw a simple block diagram with boxes, additions, multiplications, splits with pgf 3.0.0. I am quite content with the result so far, but I can not pin or label the nodes in the graph. ...
3
votes
1answer
21 views

Showing Tikz tree nodes after each other (using bracketing format of \Tree)

I want to display a tikz tree node by node. First A, then A and B and in the end all nodes. Note that I need to do it with the presented format: \Tree [. \node{A};] since trees are automatically ...
1
vote
0answers
23 views

How can I make the node order for references in TikZ not matter?

Question I am wondering if it is possible to make the order of nodes irrelevant, such that references work regardless of when they are mentioned...like some kind of pre-parsing of the code that ...
6
votes
5answers
138 views

How to set actual width for a rounded corners image using TikZ?

This question is closely related to LaTeX Photo With Rounded Corners. Suppose I want to put a rounded corners image in a marginnote, so the image fits the \linewidth of the margin. If I use the ...
3
votes
1answer
68 views

how do I create a complete graph in tikz?

I have the following code that I created: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture}[->] \node[label=west:$s$,circle,fill,inner sep=1.5pt] (n0) at (-1,1) ...
2
votes
1answer
47 views

Changing the positions of text and figures in tikzpicture

Suppose that I have something like: \documentclass{article} \usepackage{tikz} \begin{document} \noindent \begin{tikzpicture} \draw[fill=black!40, draw = black!40, line width=2pt] (-2, -2.5) ...
2
votes
0answers
22 views

Problem with tikz external library and chemfig - fatal error in external image

I have a document with a lot of diagrams created with PGFPlots and want to externalize those. All other tikz snippets should not get externalized. I achieve this by setting \tikzset{external/only ...
3
votes
1answer
37 views

Reverse Axes of pgfplots Ternary Plot

I am trying to make a ternary plot, however the default axis is opposite of what I need to accomplish. Here is an example: \documentclass{standalone} \usepackage{pgfplots} \pgfplotsset{compat=1.9} ...
5
votes
1answer
51 views

Relating tree nodes in forest to content in a table

I want to draw the following figure: I now converted my trees to forest and the following code is what I have: \documentclass{article} \usepackage{forest} \forestset{ sn edges/.style={for ...
3
votes
1answer
99 views

Why does not `\spaceskip` work inside a TikZ node?

In my document, I need to increase \spaceskip in order to inject more space between words to make them more readable. However, the setting does not seem to apply to text that's inside a TikZ node: ...
3
votes
1answer
91 views

TikZ : let … Could not parse this coordinate?

I don't understand why ? \documentclass[tikz,margin=3pt]{standalone} \usetikzlibrary{decorations.pathreplacing,calc} \usepackage{pgf} \tikzset{% alamain/.style={% decoration={show path ...
1
vote
1answer
39 views

pgfplots tikzpicture node to the right of axis is cut

I have a piecewise-defined function and would like a describing node to the right end of it. Unfortunately the node is cut and not visible using this code: \begin{tikzpicture} \begin{axis}[ ...
1
vote
2answers
86 views

Root locus plots using LaTeX

On my homework, I need to create a root locus plot. Wondering if anyone out there has good suggestions for a package that is able to create root locus plots, or a general plotting package that is ...
4
votes
0answers
93 views

Reasons to prefer tikz or pstricks over any GUI driven graphics tool

If I need a figure for a document I usually use TikZ or PSTricks. Sometimes I would like to promote it to other people who usually use only GUI programs for such kind of stuff. But then I restrain ...
3
votes
0answers
30 views

Text highlighting that works with CMYK xcolor mode?

I looked at Cool Text Highlighting in LaTeX, and as my MWE (below) demonstrates: ... the first part, highlighted with soul's \hl, fails when [cmyk]{xcolor} is used. The accepted answer in the link ...
4
votes
1answer
25 views

How to append style with decorations.pathreplacing?

\documentclass[tikz,margin=3pt]{standalone} \usetikzlibrary{decorations.pathreplacing,calc} \usepackage{pgf} \tikzset{alamain/.style={% decoration={show path construction,% lineto code={ ...
2
votes
1answer
44 views

How to refer to a word inside a running text as a TikZ coordinate?

Say you have some running text, and you want to be able to refer to some part of that text (like a single word) as a TikZ coordinate in order to, for example, draw edges to that word. What's the best ...
2
votes
1answer
33 views

TikZ decorations.pathreplacing and lineto curve ignored

Why the decoration option is ignored ? \documentclass[tikz,margin=3pt]{standalone} \usetikzlibrary{decorations.pathreplacing} \tikzset{alamain/.style={% decoration={% lineto code={ ...
1
vote
1answer
21 views

Forcing left text alignment in a fit Tikz node?

I would like to add Tikz "marker" nodes in running text; then fit another node based on those "marker" nodes' positions; and insert a text into the fitted node, such that it is left aligned, and with ...
4
votes
1answer
45 views

TikZ: How can I use \foreach variable to reference intersections?

Using the \foreach statement, I generate a set of lines that form a grid. I want to use the loop variables to name the individual paths to later draw something at their intersections. ...
5
votes
3answers
369 views

Two tikzpictures side by side

I'm trying to get these two tikzpictures to be shown side by side. This is what I have: Not the most minimal example, but should be sufficient: \documentclass[12pt,a4]{article} \usepackage{tikz} ...
2
votes
1answer
40 views

TikZ xscale \linewidth/width

I have a series of eps picture to be included in a LaTeX document. They need to be stretched to fit the linewidth, without mantaining their ratio. This solution works perfectly: ...
2
votes
0answers
27 views

Centre plot inside a node (Sigmoid Neural Node) [on hold]

Essentially I want to make a graph topology of a neural network. Since I have different type of nodes (rbf, sigmoid, linear) I want them to have in the node a shape of the function, something almost ...
1
vote
1answer
35 views

pgfplots very small Y values

I need to plot the following function: ...
1
vote
1answer
37 views

Adjusting tikz dotted line on page

I am writing a multi-page CV using a modified template from howtotex.com. However, I get a short line of dots at the top left of the second page. How can I get rid of this? I assume that I would have ...
1
vote
0answers
27 views

Error: \usepackage{tikz} [on hold]

I am using Win8.1 with TeXLive installed and TeXWorks as IDE. I want to make figures with Tikz but i always get said, that there is no package tikz when I try \usepackage{tikz}. When I look into my ...
5
votes
1answer
84 views

Label an intersection with Tikz

I have the following piece of code and I would like to add two things: Add a label to the red dot i.e., the intersection of the line segments. Unfortunately, just a ${...}$ does not seem to work. I ...
5
votes
2answers
74 views

arrays of counters for tikz nodenumbers?

Answering How to highlight portions of a matrix is a nice technique that isn't invasive, but requires manually numbering the nodes. I'd generalized it slightly: \documentclass{article} ...
0
votes
1answer
37 views

tikz-Picture in classicthesis-LyX v4.1

I exported a plot from MATLAB using matlab2tikz into a file testfig.tikz. As written here, I included \usepackage{pgfplots} \pgfplotsset{compat=newest} \pgfplotsset{plot coordinates/math ...
5
votes
2answers
74 views

How can I make a path with arrow “open” or “two-sided”?

I've drawn this arrow: But want it to look like this: How can I do that? This is my code for the first arrow: \documentclass[tikz]{standalone} \usetikzlibrary{arrows.meta} \begin{document} ...
0
votes
0answers
54 views

How do I convert a simple raster image to TikZ

How would you go about converting for example this logo into a tikz picture not using the png but drawing it yourself? I dont ask you to Draw the complete logo but I would like to know how to draw ...
4
votes
4answers
108 views

How do I override a previously set value for `/tikz/rotate`?

I was writing my own style for a particular collection of nodes, most of which I wanted rotated in the same manner. So I defined the following style: my node style/.style={rotate=60,draw} Please ...
1
vote
2answers
39 views

Node attachment position

I'm trying to create solutions to a matching type question which will require me to draw lines between boxes. I've been trying to use tikzpicture to do this: \tikzstyle{block} = [rectangle, draw, ...
0
votes
0answers
29 views

In Ubuntu 14.04 — Package pgfkeys Error:

I borrowed the following code from here (answer by @Gonzalo). I switched from Windows 7 to Ubuntu 14.04. Given code was working fine on Windows 7 but now on Ubuntu 14.04, I'm getting the following ...
3
votes
1answer
73 views

Making a random number

I have a problem. I have a graph, and I must paste a random number in every vertex of this graph. Vertices have coordinates. A part of code : \foreach \pos/\name in {{(0,0)/a}, {(1,-1)/b}, ...
6
votes
1answer
129 views

How to draw the physical tree with balls under both the stress of strings and gravity?

I want to draw the physical model of graph that has a ball for each vertex and a piece of string for each edge. In this model, if you lift a ball high enough, the other balls are pulled up along with ...
6
votes
3answers
143 views

Text projection onto plane in 3D pgf plots

I'd like to have text that appears as though it's written "on" one of the walls of a 3D tikz plot. MWE: \documentclass{standalone} \usepackage{tikz,pgfplots} \usetikzlibrary{positioning,3d} ...
4
votes
1answer
61 views

tikz foreeach list is empty?

I' m trying to make an animation with the following code \documentclass[presentation]{beamer} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsmath} \usepackage{graphicx} ...
0
votes
2answers
84 views

Rectangular Approximation Method (Riemann Sums) Diagrams

Does anyone know how to make relatively simple diagrams like the images below? Is there a some sort of "template" I could use perhaps? I'd like to code my Calculus notes but I'm not sure how to make ...
3
votes
1answer
54 views

A simple line plot in LyX

I am a LyX user and I would like to use a line plot in one of my papers. This is simply a line with few identified points. For me the points of interest are 24, 32 and 38. Could you please tell what ...
7
votes
3answers
202 views

cannot combine \foreach and \draw

I just cannot debug this code. After typesetting it keeps on giving the error of: "Undefined Control Sequence" When individually coding rectangles for each set of coordinates the code works though, ...
15
votes
6answers
554 views

Draw incline in 3D with TikZ

I need to draw an incline in 3D (triangle in 3D), I have tried to modify this example but it ends up looking wrong. Can anyone suggest how to get started with this or provide an example that's closer ...
0
votes
0answers
41 views

Pgfplots externalizing figures: (inconsistent) white borders

I'm using the external library \usepgfplotslibrary{external} \tikzexternalize[prefix=tikz_figures/] to externalize my figures from one document and include them in another. The problem is that the ...
4
votes
1answer
109 views

Is TIKZ sending ambiguous PDF instructions that only TEXstudio understands well?

TEXstudio is the only MAC software (although not originally designed for MAC) that has a PDF viewer that renders perfectly well dashed and hatched lines drawn with tikz. What does TEXstudio do that ...
3
votes
2answers
67 views

How can you use square brackets in tikz diagram?

I am trying to draw a sequence in TeX with Tikz where the vertices are $[X,Y]$, however I can't seem to get the code to work. Here is the code I am trying to use. \documentclass[12pt]{amsart} ...
11
votes
1answer
213 views

Demonic correspondence: Best practices when defining devils in TiKZ

tikzsymbols defines a series of symbols which can be used in text (or nested in larger pictures) and which can be customised in various ways e.g. scaling size, choice of colours etc. For example: ...
2
votes
1answer
67 views

How to plot a graph of arbitrary points in TikZ

I have this code: \documentclass[border=2mm]{standalone} \usepackage{tikz} \usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,positioning,fit,petri} \begin{document} ...
6
votes
2answers
158 views

Drawing polygons

I would like to draw the following picture using TikZ: I've done this \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}[scale=2] \foreach \x in {0,60,...,300} ...