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
1answer
30 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
50 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
1answer
31 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
47 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
50 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
70 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
30 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 ...
4
votes
1answer
55 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} ...
4
votes
0answers
50 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
58 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 ...
2
votes
1answer
69 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
67 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 ...
11
votes
2answers
537 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
31 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
61 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
53 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} }; ...
4
votes
2answers
88 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
51 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
82 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
104 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
58 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
31 views

Error: pgfplots colorbrewer

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
84 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
74 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
37 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
31 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
54 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
57 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
28 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
70 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 ...
5
votes
1answer
61 views

How can I use a tl variable in TikZ options

Im setting up a command with some options via l3keys. One of the options is tikz-options and it should take a list of TikZ options and pass them to a {tikzpicture}. \documentclass{article} ...
3
votes
3answers
55 views

How to add additional border on the left and add additional boxes in the right corner with a label

Trying to draw diagrams from Problem Frames paper. How can I create this borders on the left and add additional boxes in the right corner with a label. Is it also possible to add an additional line ...
1
vote
1answer
47 views

Chart using tcolorbox

Hi I'm making a chart using tcolorbox. I'll show you my code: \begin{center} \begin{tcolorbox}[halign= flush center, halign title= flush center, fonttitle=\sffamily\bfseries\large, title={Lecteur DVD ...
0
votes
0answers
36 views

\usetikzlibrary{graphs} is not working

\usetikzlibrary{graphs} \tikz \graph { a -> {b, c} -> d }; I learn Tikz through { Tikz pgf}. I write above code and compile errors occur. i mention what errors comes. i write this code ...
3
votes
2answers
65 views

Generating catalan path diagrams using ballot sequences in latex

here is a pictures of a catalan path: It is a lattice path in Z^2 starting a some point (a,b) and using the steps (1,1) and (1,-1). It can be decoded (knowing the starting point) as a ballot ...
5
votes
1answer
57 views

Using tikz inside multirow

I'm trying to recreate the following figure in latex: Now, I dont have a lot of a problem with one of them: \documentclass{article} \usepackage{tikz} \usetikzlibrary{arrows,backgrounds} ...
2
votes
2answers
83 views

Add “sections” to a staked area chart [duplicate]

Edit: The original question was answered by @James and his solution covers the particular problem presented here. In This question I have exposed the original problem and I have received answer to ...
1
vote
1answer
37 views

Problem with horizontal alignment in minipage environment

This may be a very stupid question, but it is driving me crazy. I have three tcolorbox linked by arrows. The second line of boxes are in a minipage environment, and I want one flushleft and one in ...
2
votes
1answer
56 views

Drawing arrows using tikz

I am trying to make a small chart and drawing arrows between tcolorbox, using tikz and the 'remember as' tool. My code is this \begin{center} \begin{tcolorbox}[enhanced, overlay, width=1.5in, ...
2
votes
1answer
46 views

Help with Plotting Logscale?

I'm trying to plot the time complexity of some sorting algorithms using a log scale. I'm fetching the data from a text file insertion.dat which contains the following information: x y 0 0 10 0.002 ...
12
votes
1answer
112 views

How to draw fully packed loops on medial lattice?

I want to draw a variant of the following figure, [Figure 22 of Freedman et al, Annals of Physics,310(2):428–492, April 2004.] The lattice and dashed lines are easy. Using two for loops ...
2
votes
3answers
116 views

How to do a chart with stacked bars, lines and “sections”

The problem I need a chart like this (this was made in Libreoffice + some gimp): Its caracteristics are bassically: Some stacked bars (if it is a stacked area, better) with its Y axis at the ...
2
votes
0answers
68 views

How to make 3D ribbon plots in PGF/TikZ

I'd like to make a bunch of 3D ribbon plots in TikZ or PGF, I've taken a look around and I've found no hints on how this might be accomplished, is there a simple way to do this? I'd settle for a 3D ...
1
vote
1answer
64 views

Draw stroke inside/outside of path for arbitrary shapes and nodes

This is a followup question of Is there a way to draw TikZ lines on the “inside” or “outside” of a path? Since the other question is quite old I want to ask, if TikZ in the meantime is able to draw a ...
2
votes
1answer
84 views

edge invisibility in tikz

I would like to know how can we make edge invisble in tikz ( similar to visible). Here is my code. I am able to add edges (1,4) and (4,5) using visible command, at the same time I want to remove the ...
2
votes
0answers
71 views

Turn a six sides into a 3 sides logo

How to change the codes below so that we have a triangular logo shape? \documentclass[tikz]{standalone} \usetikzlibrary{shapes.geometric} \tikzset{my polygon/.style={regular polygon,regular ...
6
votes
1answer
159 views

How to draw the following diagram using tikz-cd?

How to draw this diagram using tikz-cd? Here is my code \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{shapes,arrows,shapes} \begin{document} \tikzstyle{block} = ...
0
votes
1answer
41 views

scale bar figure - showing scale with citations

I am attempting to make figures similar to this: with latex. I would like for the citations to work in order to match the observed data from where it came. Does anyone know of a good package ...
5
votes
0answers
103 views

Drawing a plane inside a sphere in TikZ

I have the following code, which is basically a modified version of the sphere example from TeXample.net. \documentclass[crop,tikz]{standalone} \usepackage{pgfplots} \usetikzlibrary{calc,fadings} ...
1
vote
0answers
33 views

TikZ: Unexpected decoration behaviour on duplicate image [on hold]

When I call the exact same tikz code, which uses decorations, I get an error for the second image only. Thoughts? Thanks. MWE: \documentclass{article} \usepackage{tikz} \begin{document} ...