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
15 views

Line up nested tikz enviroments or how to get rid of them

In my diagram I have a few components I reuse a lot, thus making "macros" in tikz for them. The current code I have is using nested tikzpicture environments and is not exactly working as expected. Do ...
2
votes
2answers
32 views

How to Center Titles in Forest Trees?

Here goes my third question. I am actually drawing Game Theory trees using the package Forest, and I have a small issue with the title of some Trees that I cannot manage. Essentially, I order LaTex to ...
0
votes
0answers
18 views

How to Add Geometric Figures to a Tree using Forest and Tikz?

First of all, I want to thank the community the help I obtained in my first question, some days ago. Having said that, I want to ask you for some help again, if I may. Essentially, I am currently ...
0
votes
0answers
24 views

Typesetting tick marks on an axis so that minus sign is typeset but the space it occupies is ignored

The error in the following code seems to be at the following options specified in the axis of the pgfplot. ticklabel style={font=\tiny,fill=none}, extra x ticks={-3.14159, -1.5708, 1.5708, 3.14159}, ...
2
votes
2answers
80 views

How to complete this figure using Tikz?

I saw the following picture in Puerto Rico Mathematical Olympiad. The figure is a carpet unfolding. I couldn't do the part of the cylinder, not introduce symbols on black squares ...
1
vote
0answers
65 views

How to do these drawings?

I was reading a paper online when I saw some beautiful pictures. I wonder if it is done with tikz or if it is even LaTeX. What do you think? How can I do things of this sort?
2
votes
1answer
33 views

Vertical and horizontal line in intersection?

There is probleme in this source: \documentclass{article} \usepackage{tikz} \usetikzlibrary{intersections} \begin{document} \begin{tikzpicture} \draw[thick,->] (-1,0) -- (5,0) node(xaxis)[below] ...
3
votes
0answers
50 views

Complex 3D drawings with tikz

I've already produced the following picture by means of TikZ. To do it, I modified the Sudoku example found here as follows: \documentclass{standalone} \usepackage{xcolor} \usepackage{tikz} ...
1
vote
1answer
29 views

How to know variable values in tikz for debugging

I am pretty fresh to tikz and I am trying to create a not-so-simple picture. I am also using the calc package with the let command, but the final figure is not the desired one. Therefore, I need to ...
2
votes
1answer
53 views

Convex hull, again?

I'd like that: \begin{tikzpicture} \draw[gray!50, dashed, fill=gray!10] plot[smooth cycle, tension=.7] coordinates {(3.0379,10.2421) (2.0978,9.802) (1.6332,8.5161) (2.0978,7.3113) (3.3837,6.9169) ...
2
votes
0answers
23 views

Combine isodate header and simple week-based timeline in a gantt chart

I'm trying to create a time chart and found the pgfgantt package to be the most suitable choice. Basically I need a timeline about 23 full weeks, something like: \begin{ganttchart}{1}{23} ...
2
votes
1answer
43 views

Custom PSTricks directory tree to TikZ

I have a PSTricks implementation of a custom directory tree which I find quite appealing. I basically want to convert the whole thing to TikZ. I managed to get the very basic idea running in TikZ: I ...
2
votes
1answer
35 views

Positioning tikzpicture and determining range for axis

In another question I got great help creating this picture: Actually it looks how it should but there are two further things I would like to clarify: Firstly, I get this warning: Axis range for ...
3
votes
1answer
61 views

Fancy Section headers

I wanted to add the lines from the edge of the left margin to the colored box in my section headers so this it looks like: Here is the code I have thus far: \documentclass[11pt]{book} ...
0
votes
1answer
76 views

Linebreak does not work in section headings modified with tikz

I have a problem with long sub/section headings: \\ is not wirking. As I'm new to Latex, I adopted this beautiful template http://www.fluortools.com/misc/LaTeXtemplate and modified it for my needs. ...
1
vote
1answer
33 views

Putting nodes in the middle of the figure

I have a figure consisting out of several lines: \begin{tikzpicture} \shade[top color=black,bottom color=white] (-2,2) rectangle (2,1.75) node [above] {$n_2$}; \shade[top color=white, bottom ...
3
votes
1answer
39 views

Lines not ending on nodes with tikz

I have three nodes: \draw (4,2) node(p1)[label={[label distance=0.9cm]0:$$}]{}; \draw (5,3) node(p2)[label={[label distance=0.9cm]0:$$}]{}; \draw (6,4) node(p3)[label={[label ...
2
votes
0answers
45 views

PGFplots, memory and GNUplot

My question is quite simple. I generate a lot of plots for my thesis in PGFplots, which I generate in separate PDF files using the standalone package (could not get shell escape to work properly). The ...
5
votes
2answers
70 views

tufte-book: tikz references in caption

Using the article documentclass, the following code works as expected. \documentclass{article} \usepackage{lipsum} \usepackage{caption} \usepackage{pgfplots} \pgfplotsset{compat=1.13} ...
3
votes
1answer
59 views

Is there any way to draw the same shapes at different positions efficiently, for example \foreach?

I know there is a similar question, but I do not think it gave the best solution. Here is my code: \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm] \clip(-0.5,-1) ...
4
votes
2answers
66 views

Fix brackets in blkarray

in the code given below, I wanted the brackets from the \blkarray matrix to match those of the original matrix given in Equ (1). The issue is, when I use the \blkarray, the brackets are too short ...
1
vote
2answers
68 views

draw half line between two nodes tikz

I have the following graph: \documentclass[border=1mm]{standalone} \usepackage{siunitx} \usepackage{tikz} \begin{document} \begin{tikzpicture} ] \node (n1) at (0,0) ...
4
votes
1answer
59 views

Error when using tikz \node, \subnode

In the code below, building off solutions found here, I am trying to use the \node and \subnode options to draw the arrow, but I cannot get the file to compile. Can you help me to fix the code to get ...
0
votes
1answer
57 views

Highlight matrix cell and have arrows pointing from cell with text [duplicate]

This code is building from the solutions posted here. I am trying the approach suggested from the duplicate solutions. I am having two issues: I am not sure how to get the arrow to point to the ...
2
votes
1answer
80 views

How to build cylinder in tikz like shown in this example

I would like to make a similar graphic like shown below, but with different text: Since I just did 2D graphics, can you give me a starting tip how to do this in TikZ? That's my uncomplete MWE so ...
1
vote
1answer
36 views

Adjust the position of node label in graph

Question is the position of node (16, 20) is mixing with line. How to get rid from this? That is i want to plot this node in right side so there is no chance of collision with line. This is what i ...
0
votes
0answers
31 views

convert pdf output into motion gif

The following codes gives an animation of cos x, which is modified from the one by Henri Menke. Could you please help to convert this pdf output into GIF using imagemagick. I could not install the ...
4
votes
1answer
62 views

colored box around a column in matrix [duplicate]

How can I go about drawing a colored box around a column in a matrix with an arrow and text like this: Here is the code that I have thus far: \documentclass[11pt]{book} ...
5
votes
1answer
95 views

How to make a 2D surface grid in Tikz?

I want to do something like this: And this is what I have done so far: \documentclass[a4paper, 11pt, oneside]{article} \usepackage{tikz} \usepackage{pstricks} \usetikzlibrary{scopes} ...
5
votes
1answer
64 views

Layered Graph from Tikz Manual

I suppose I have quite some experience with vanilla latex (which I have used to write several documents), but I am making my first baby steps with tikz. In particular, I am trying to reproduce the ...
3
votes
1answer
73 views

How to fill a region between two curves in Tikz?

So basically I am trying to reproduce a modified version of this figure: This is what I have done so far, and I would like to fill the region between u1 and u2 with the same gradient color: ...
4
votes
1answer
70 views

Framing EMPTY cells in a table

This question is based on a previous question: Framing cells vertically in a table I'd like to frame cells just like that and the answer to the previous question works beautifully – except when the ...
16
votes
2answers
650 views

Draw an animated gif of trigonometry function

How is an animated diagram like this drawn? Here is what I could get if I try my best for the code: \documentclass{standalone} \usepackage{tikz,pgfplots} \begin{document} ...
1
vote
1answer
35 views

Grouping two blocks in a container horizontally within a diagram

How can I group C and D together horizontally instead of vertically as shown in the diagram below while still maintaining the center alignment of the container? \documentclass{article} ...
3
votes
2answers
70 views

Referencing locations within a text box

I have a node I've drawn in tikz, like this: \node[below, text width=5cm] (SomeName) at (0,0) { \begin{itemize} \item line 1 \item line 2 \item line 3 \item line 4 ...
2
votes
2answers
55 views

TikZ graphs: Specify edge target anchor

I have the following code: \documentclass[tikz]{standalone} \usetikzlibrary{graphs} \begin{document} \tikz \graph[grow right sep=20,nodes={draw,rectangle}] { a -> {b, long node name} }; ...
7
votes
4answers
168 views
+50

Filling a node with white space to put labels in the foreground

I have grid lines drawn on the Cartesian plane. I mark distances 2, 4, 6, and 8 along the x-axis and 2 along the y-axis. To avoid the grid lines being drawn over these labels, I use fill=white and ...
0
votes
2answers
71 views

Combining Tikz concepts/librarys to draw a complex picture with relative alignment/distances

I think all of the problems has been asked by me or others in the past. But my over all problem is that I am not able to combine all this solutions to the real picture I want to draw. Normally it is ...
3
votes
1answer
83 views

Three errors when using tikz package

I am using MacTex 2015 and Texpad as LaTeX editor. When I try to import the tzik package \usepackage{tikz} the following 3 errors appear Weird thing though is that everything looks fine in my ...
5
votes
2answers
124 views

Position of text and arrows in TikZ matrix

I want to put a text inside a TikZ matrix, but it always begins from the bottom !. So, my qusetion is how I can force it to begin from the top? My MWE: \documentclass{article} ...
5
votes
1answer
60 views

Hatching a rectangle with TikZ leaves margin

Hej everybody! :) I'm currently taking my first steps with TikZ, and when trying to plot some simple rectangle shapes I noticed a rather weird effect that occurs when I try to fill the rectangles ...
0
votes
0answers
37 views

Error: pgfplots colorbrewer [duplicate]

I am trying to use the new colorbrewer library and get the following error: Error: I do not know the key '/pgfplots/colormap/YlOrBr' and I am going to ignore it. \documentclass{standalone} ...
5
votes
1answer
87 views

How to draw this figure in a better way (mapping between domains)?

I am trying to draw something similar to this: This is what I have done so far: \documentclass{article} \usepackage{tikz} \usepackage[active,tightpage]{preview} \PreviewEnvironment{tikzpicture} ...
0
votes
1answer
76 views

How to graph a unit circle using TikZ?

I know some basic graphing like functions on a Cartesian plane or drawing polygons, but how do you graph something like the one above? I also want to put this graph within the unit circle.
2
votes
1answer
38 views

Trouble with label in TIKZ-cd

I cannot seem to figure out why the following won't work when I add a label. I will show the working example first, I want a simple commutative diagram with a label on each arrow. The working example ...
1
vote
1answer
32 views

How can I choose a column of dat file to plot in pgfplot?

I have dat file (output from Matlab) and it has four columns. How can I choose my desire column to plot in pgfplots. \documentclass{article} \usepackage[active,tightpage]{preview} ...
2
votes
1answer
55 views

draw graphs in tikz

\documentclass{book} \usepackage{graphs} \usetikzlibrary{graphs} \begin{doument} \begin{tikzpicture}[new set=import nodes] \begin{scope}[nodes={set=import nodes}] % make all nodes part of this set ...
0
votes
2answers
60 views

Use tikz to plot sine wave with text and lines

I wanted to get a tikz plot to look like: I am getting two cycles in my code. The original code was masterfully written by moospit found here. Here is the code to start with: ...
1
vote
1answer
29 views

TikZ/PGF error when using forest

I am trying to make a linguistics tree using the forest package, as in the second example in this thread. I was able to generate the tree for the most part, but I cannot draw the triangle for some ...
3
votes
0answers
78 views

Plotting the sum of a function in TikZ

I am trying to plot a function that is the sum of another function based on the parameter. A famous example of this is the "sum of squares", however the functions I really want to do this do not have ...