Questions tagged [tikz-pgf]

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.

0
votes
0answers
3 views

How to globally change the color of tikz nodes?

I see here: How to specify a fill color in RGB format in a node in tikzpicture? It is possible to change the color of a node locally. However, I would like to add a background color globally to all ...
0
votes
1answer
23 views

Header design like shape

I designed this header, but it doesnt my ideal drawing thank you \fancypagestyle{mainstyle}{% \fancyhf{} \fancyhead[LO,RE]{\myfancynum} \fancyhead[LE]{% \begin{tikzpicture}[overlay,remember ...
1
vote
1answer
19 views

dynamic rectangle fill inside another rectangle based on input

I want to create something like this, where the percentage of the colored rectangle is an input variable. and color of the rectangle is changing, for <33% is red, <66% is yellow and green for >...
5
votes
3answers
83 views

Problem with drawing 16-sided shape in TikZ [on hold]

Is there any formula or function to draw a 16-sided shape directly? I write a code for 16-sided shape but it doesn't satisfy me. And I want to put the page number inside a 16-sided shape. How can I do ...
311
votes
4answers
40k views

Create xkcd style diagram in TeX

The unique style of the diagrams at xkcd has an informative but nice hand-drawn touch. I guess they are actually drawn by hand but just recently on our partner site for Mathematica someone asked how ...
3
votes
1answer
29 views

Tikzlibrary calligraphy error

The code below uses the TikZ library calligraphy, but throws an error: Package pgfkeys Error: I do not know the key '/pgf/decoration/\pgfkeyscurrentname ' and I am going to ignore it. Perhaps you ...
0
votes
2answers
57 views

TikZ: How to get decorations on each grid-middlepoint?

What is the right setting to get a decoration at every center of every box? \documentclass[margin=5mm, tikz]{standalone} \usepackage{tikz} \usetikzlibrary{decorations.markings} \begin{document} \...
2
votes
3answers
90 views

Drawing a memory layout diagram with Tikz

I'd like to draw a memory layout diagram in Tikz that looks a bit like the following: Note that the original was an SVG file, and conversion to PNG causes the weird [Not supported by viewer] errors, ...
2
votes
2answers
44 views

Create hexagon style

I want to create a style for a hexagon like this : But, I don't know how to do it. This is my code for now: \begin{tikzpicture}[ ] \newdimen\R \R=2.7cm \draw (0:\R) \foreach \x ...
3
votes
0answers
31 views

Why different dimensions of pgfshading and node

Take for example my code from https://tex.stackexchange.com/a/497174/191567 \documentclass{article} \usepackage{tikz} \begin{document} \tikzset{ bloc/.style={ anchor=south ...
2
votes
0answers
35 views

Animating a 3d plane

I'm learning how to produce animations in LaTeX. After some trials with different pictures, I would like to animate the following picture and start from the answer that Marmot provided me in this ...
0
votes
0answers
22 views

Why does my Tikz graph appear at the top of the page above the text?

I'm not sure why my figure/graph appears at the top of the page. This did not happen when I had the whole manuscript in one file. Now, that I have created seperate files, the graph/figure is at the ...
0
votes
2answers
39 views

Problem with \foreach in Tikz

I'm using \foreach in Tikz to make a line with vertical marks at some real numbers. But I want to put \pi and \e (Euler number) in the code, but it doesnt work. Please, can anyone help me? My Code: ...
1
vote
1answer
27 views

How to insert \pgfplotmark in a sentence?

Using picture in a box displays \pgfuseplotmark at the beginning of the page and above the text, that's not where I want the mark to be displayed. Using picture directly in a sentence doesn't display ...
1
vote
1answer
31 views

Creating a map-like grid using tikz

Problem I am planning a trip for vacation and I decided to customize a map of spots I am going to visit using snapshot from Google map. Specially, I would like to make a grid that looks like the ...
1
vote
0answers
660 views

How do I get a straight line in \begin{tikzpicture}[decoration=Koch snowflake]? [closed]

The following code \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{decorations.fractals} \usepackage{pgfplots} \begin{document} \begin{tikzpicture}[scale=3,decoration=Koch snowflake] \...
1
vote
0answers
19 views

Xlabel/Ylabel Position for Tikz [on hold]

The Tikz code below generates the following picture: \begin{tikzpicture}[font=\sffamily] \begin{axis}[xmin=0,xmax=100,ybar,bar width=2.8mm,ylabel={\textcolor{forestgreen}{\textbf{Number of Policies}...
0
votes
1answer
44 views

Custom Histogram in Tikz

I am trying to create the picture below in Tikz. What I am most unsure of is how to make the histogram below. It does not need to have the exact same shape, but a similar shape to the histogram below. ...
1
vote
1answer
22 views

Make it more compact and issue with “Dimension too large”

I have the following code that I don't like and generates an error: \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{decorations.markings} \begin{document} \begin{tikzpicture} \draw[...
2
votes
2answers
65 views

TeX capacity exceeded when externalizing

I have several large TikZ plots I want to externalize. Without externalization, everything works fine. Document: \documentclass{article} \usepackage{tikz} \usetikzlibrary{external} %\tikzexternalize ...
2
votes
1answer
19 views

Arranging dissimilar sized pgfplots in tikz

I'm trying to arrange 5 plots so that the first four (equal-sized) are aligned in a 2x2 matrix, and the last one is bigger and is placed. I tried to use the matrix command by changing the width of the ...
3
votes
0answers
26 views

Align pgfplots horizontally

I want to align the pgfplots seen in the picture below. I already tried with \pgfplotsset{yticklabel style={text width=3em,align=right}}, but as you can see, the plots are still not aligned. The ...
1
vote
1answer
21 views

centre text exactly on an exactly specified point on path

I would like to place text exactly centred over an exactly specified point on a highly complex path as shown in this Figure: I have developed my example by specifying the point at 0.1 from the ...
5
votes
2answers
68 views

Follow-up: Drawing Game Tree with Curved Informational Sets and Several Nodes, using Tikz and Forest

This is a follow-up from Drawing game tree - Tikz or Forest? The sequential game tree I am trying to draw is this one: I am using tikz and forest to draw it, but I am still far from it. In ...
5
votes
1answer
97 views

How to make a tikz picture coexist with the fpu library

A graphics application creates tikz picture files. There is no control on the surrounding document. How to make sure that the picture compiles, regardless whether the fpu library is loaded or not, and ...
0
votes
0answers
38 views

LaTeX: Visualize a roundabout

Would it be possible to visualize a roundabout in LaTeX? There has been a car crash in a roundabout and i would like to visualize it for presenting it very clearly, is this possible? its a two lane ...
-1
votes
1answer
33 views

don't know the equation of the function but want to plot it [duplicate]

I know how to plot a function if i know the equation but in this case i don't know the equation of itself , thus i want to plot it by using some curve or approximation command thanks for the help
2
votes
1answer
16 views

place mark on a specified point along path

I would like to place a mark on a highly complex path: The mark should be at exactly 0.1 from beginning: I try: \documentclass[border=1cm]{standalone} \usepackage{tikz} \usetikzlibrary{decorations....
2
votes
1answer
20 views

Modifying circled node to semi circled node and adding title below a plot

Here's a code for the plot of the floor function. I wanted to make some modifications as: changing the red circle to a red semicircle there is two zeros lying on the axes, I want to delete one of ...
0
votes
1answer
84 views

Simple beamer animation: output visualization

I'd like to learn how to perform some simple animations in Latex. I tried to run this MWE (from Animate Line / Path using Tikz and 'animate' package), but it does not work: I can run the code, ...
2
votes
1answer
33 views

How to shift a tikzpicture by the units displayed at axis?

I use tikzpicture to create several diagrams which should be comparable at y-axis. I used xshift to shift one to the right by some arbitrary amount (10cm trial and error). But my yshift has to be ...
1
vote
0answers
32 views

center text along tikz path after a shift [duplicate]

I elaborated upon Decorate tikz path with cyrillic text to develop an example: \documentclass[margin=1cm]{standalone} \usepackage{tikz} \usetikzlibrary{decorations.text} \begin{document} \begin{...
5
votes
2answers
216 views

Drawing game tree - Tikz or Forest?

I am trying to draw the following tree: Below is the code I have so far, and I don't know how to do it accurately. Also, I am using "forest." Would it be better to use Tikz? \documentclass{article} ...
1
vote
0answers
32 views

Pgfplots errors

I hope somebody can help me. I am trying to insert some bar charts in my thesis, and I looked for a long time for a solution. I found another question in which the answer was the following code: \...
6
votes
3answers
508 views

Matrix decomposition

I am trying to get what's on the image: Mi example looks bigger than the one in the picture, the latter looks more compact and nicer. Also, the matrices in the picture look sharper, meaning, they ...
0
votes
1answer
56 views

Create 2D Numberlines in Latex [on hold]

I want to create one and two dimensional, normalized numberlines as you can see in this picture: I tried it with tikz, but there are so many things that I'm new to. How to make the <- empty, ... ->...
1
vote
1answer
31 views

Problem with tikz foreach with veclen

I tried to draw a poly-line based on a list of coordinates but with the code below the starting points of each segment of the line are shifted to the right and the calculation of the length with ...
1
vote
1answer
44 views

Symbolic coordinates versus literal coordinates

I am trying to draw a yz-axis, and ontop of it, a rotated y'z'-axis for some work in mathematics. The following code \newcommand{\axislength}{2} \draw [->, -latex] (0,0) coordinate (O) node[above ...
1
vote
1answer
33 views

Problem with `\only` and convex path

I am using the code from this answer to generate a convex path around some nodes in a Beamer presentation. Here's a MWE: \documentclass[12pt,aspectratio=169]{beamer} \usepackage{tikz} \...
8
votes
2answers
276 views

Plotting the gradient descent

Can you help me with drawing this SGD picture? Colors and sharp effects are welcomed :) MWE: \documentclass[11pt]{article} \usepackage{amsmath} \usepackage{amssymb} \usepackage{subfigure} \...
3
votes
1answer
46 views

Hiding partially a curve/path/edge

I would like to hide the b-i edge when it passes all between the edges f-l and h-c ( not only at the intersection). I would need a solution that doesn't force me to compute manually the slope at (f) ...
1
vote
1answer
36 views

change proportion of colors in fill-fading a node

i have some tikz code like this one : \tikzset{ bloc/.style={ anchor=south west, draw, minimum height=0.7cm, ...
6
votes
1answer
77 views

Combining two tikz plots together

I'm trying to combine two tikz plots together and having some trouble. I have the first plot which contains the 3d version, and then I have the second image which I want to map onto the first, in the ...
2
votes
1answer
25 views

Define and use paths inside foreach

I've looked at this and that, and I'm unable to compile and use intersections of lines i give name inside the same foreach loop. \documentclass[tikz]{standalone} \usepackage{tikz} \usetikzlibrary{...
1
vote
1answer
33 views

Multiple tikz chain alignement

I would like to display this result : This is my code : \begin{tikzpicture} \begin{scope}[start chain=1 going below, start chain=2 going right, start chain=3 going right] \node[on chain=1] (...
4
votes
1answer
52 views

Problems with tcolorbox and TikZ external

I am writing a book which will contain a lot of TikZ figures and tcolorboxes. To speed things up I want to use the TikZ external library. However, I have run into some problems that I would like to ...
-4
votes
1answer
111 views

Beautiful picture done by tikz

I looked at this beautiful picture for 3 hours, and I would really like to how to this with tikz. If someone have an idea.
5
votes
1answer
55 views

TikZ: How to make edges jump to show they don't intersect?

I saw this and I like how the lines jump over each other to show they're not connected when they cross over: Here's the code for it. I tried to apply the same technique, without much luck: % ...
0
votes
1answer
38 views

Drawing a hooked arrow to label an angle in a TikZ picture

I would like to label an angle at C in trapezoid ABCD} as $180^{\circ} - \theta$. This label is too big to fit nicely inside the trapezoid. I would like it placed to the left and above the vertex. ...
1
vote
1answer
47 views

problem with graph with different scale (x and y)

I have to do the following graphs. my problem is that the x axis y axis have different scales. how can i fix the graphs? This is my code: graph 1: \documentclass[border=5mm]{standalone} \usepackage{...