Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
1answer
38 views

Spacing between tikz subfigures and subcaptions

I'm having trouble reducing the size between the subcaptions and their figures when adding the figures through tikz. I tried a negative \vspace as well as setting (or changing?) the \captionsetup{skip=...
3
votes
1answer
31 views

pgfplots: How to add time axis as second x-axis?

I preprocessed a series of data into a time column and a further column with time distance to zero, the latter as decimal value. Minimum Working Example (MWE): \documentclass[border=5mm]{standalone} ...
1
vote
0answers
26 views

Sum of sub-bars on top of stacked bars in tikz

I want to be able to display the sum of the values on top of the bars. Below is my code and under that, an illustrated image that displays the values I want to show. Can this be done? \documentclass{...
5
votes
1answer
75 views

From table to tikz

How do I go about creating the following table in tikz? \documentclass[11pt]{article} \usepackage{multirow} \usepackage{geometry} \usepackage{tabularx} \usepackage{booktabs} \usepackage{ragged2e} \...
1
vote
1answer
40 views

pgfplots: How to control and align legend items precisely above each other?

The user marmot has posted a really nice approach of adding legend items into one single box below a multigraph diagram by placing them inside a \node. Based on this initial situation I have tried to ...
1
vote
1answer
20 views

Specify times and dates in Pgfplots

I have x-data as dates associated with float values; plotting them with pgfplots is as easy as \documentclass{standalone} \usepackage{pgfplots} \usepgfplotslibrary{dateplot} \pgfplotsset{compat=...
2
votes
1answer
58 views

Could someone make this figure, but with homoskedasticity?

The amazing, elegant graph below is from this post. Could someone help me make this same graph, but with homoskedasticity (instead of heteroskedasticity)? Perhaps Jake? Thank you, Jake, for the ...
1
vote
1answer
22 views

pgf-pie - Show absolute values instead of percentage

I want to make a pie chart with pgf-pie that shows not the percentage inside the pie but the absolute values. For example 15 males and 3 females in my example below. Is this possible with pgf-pie? \...
0
votes
0answers
29 views

Matlab2tikz // Error divsion by 0.0

I created a minimal working example in Matlab: [x,y] = meshgrid(-2:0.1:2,-2:0.1:2); fx = x.*y; fy = x.*y; figure quiver(x,y,fx,fy) matlab2tikz('plot.tex'); This works great and creates the plot....
5
votes
1answer
43 views

Need help with animated gradient

I am trying to get a nice gradient, but mine's a litte choppy. Maybe you can help me out with that. For a bette idea: (from top to bottom: luminosity, expansion speed, radius) animation.tex \...
1
vote
1answer
45 views

CicuiTikZ Special Sources not recognised

In the package CicuiTikZ there are some special sources listed in the documentation, in section 4.2.9. For some reason I can't get them to work. Here is my code: \documentclass{report} \usepackage{...
2
votes
1answer
47 views

Trying to write the equation in one single line in block

I am trying to put an equation in a block in one single line. But I could not able to do that. HOw to do this. This is what I tried. \documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes,...
6
votes
1answer
57 views

Draw a set of arrows using a palette of colors

I am involved in a project that includes the creation of arrows. Making a monocolored figure is a visual problem due to the scarcity of colors, so I came to design a solution that is as automatic as ...
0
votes
1answer
47 views

whittaker function [closed]

How can I plot whittaker function; i mean what is the code? I tried the below: \documentclass{article} \usepackage{mpmath} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{...
2
votes
1answer
23 views

Changing line width in tikz makes arrow heads ignore size specification?

I am having trouble in changing arrowhead parameters in Tikz. The length and width parameters from arrows.meta work as expected until I also specify a line width, then all my arrowhead specifications ...
1
vote
0answers
24 views

Arguments stops being evaluated inside tikz node

In the following example, the code \textwidth-1mm is "evaluated" in the first page, but on the second page (where I add a node around it), the text is not evaluated anymore and I can see a bit -1mm in ...
1
vote
1answer
17 views

Tree node alignment wrong

I am having a mental block and I hope someone can help. I am trying to draw the following tree and have two problems: The subtree that is rooted at the left-most "doc" should be rooted at node &...
5
votes
2answers
190 views

TikZ plot too verbose

I was wondering if there was a more succinct way to express the following plot (I'm using the plain format): \input tikz \tikzpicture \draw[help lines, ystep=.5] (-.2,-10) grid (12.5,15); \draw[-&...
1
vote
1answer
29 views

Create command that uses a \foreach to be used in a barycentric cs

I'm trying create a command that will be used in a barycentric cs:. I will use the barycentric cs a lot of time to get a node the middle of others, so I'm trying to make it less painfull for myself. ...
1
vote
1answer
62 views

how to draw the following schematic diagram using Tikz?

\documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes,arrows} \begin{document} \tikzstyle{block} = [draw, fill=white, rectangle, minimum height=3em, minimum width=6em] \tikzstyle{sum} =...
1
vote
1answer
87 views

Why does a vertical arrow get rendered incorrectly?

I am drawing a table with arrows in it. All the arrows are fine except for vertical ones pointing down. Here is a MWE: \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix} \begin{...
3
votes
1answer
56 views

Why this tikzpicture does not appear centered?

While creating a state machine diagram with tikz I noticed that it appears to be off center. This result seems counter intuitive to me because of the way the diagram was created, using a foreach ...
1
vote
2answers
59 views

Rays within a circle

I am trying to create the same figure as the one posted in here (see reply) but centered around a different point than (0,0). Any suggestion?
1
vote
2answers
38 views

Circle using tikz and pgfplots package

I have been trying to obtain this Since i am still an amateur at using the tikz package, i started somewhere. This is my bit of code, but all i am obtaining is this \usepackage{pgfplots} \...
2
votes
1answer
27 views

I can't use a saved dimension in an anchor into a loop

I have the following problem: Into a \pgfdeclareshape I have the following code for a saved dimension: \saveddimen{\long@sal}{ \pgf@x=\pgfkeysvalueof{/tikz/longitud salidas}\unidad@medicion \...
1
vote
3answers
63 views

Better use of rounded corners of links from multiple nodes to multiple nodes with tikz on \draw[->]

My question follows one of my previous questions. Here's my current code: \documentclass[tikz,border=5mm]{standalone} \usetikzlibrary{matrix,positioning} \newcommand{\multilinkstoonenode}[3]{ \...
1
vote
1answer
33 views

Environment for text labeling and explanation

I am looking for a tex environment which allows me to label text like this: Since the word 'label' is already occupied I don't know how to google for a solution. Does anyone have an idea? Maybe there ...
0
votes
3answers
59 views

Ploting the roots of a polynomial

I want to plot the roots of any given polynomial on the complex plane. Example: Let $P(x)=x^4-x^3-1$ be given. I want to plot on the $Oxy$ complex plane all four roots of this polynomial. I suppose ...
3
votes
1answer
26 views

Using axis units (axis cs) for line width

Say my plot shows geometric objects in a metric x,y plane, so one axis unit equals 1m. Drawing in metric units is easy using axis cs for the coordinates like in this example: \begin{tikzpicture} ...
12
votes
1answer
216 views

Strange behavior in TikZ \draw command

I was trying to replicate the figure in Box half filled color using TikZ. I draw a rectangle from (0,0) to (4,3). I locate two points (0,1) as A and (4,2) as B. When I connect the points A and B, I ...
2
votes
1answer
28 views

A defined macro works with \draw but not with \fill

I used the \centerarc command provided in this answer to fill a region enclosed by arcs. I have made a slight modification. I have removed the \draw inside the definition and the first parameter. MWE:...
3
votes
2answers
86 views

Adding axes to figures

I need to add axes to a bunch of figures in my document, I'm trying with tikz but maybe there's an easier and more elegant way to do it (looking at you, overpic)? The result I'm trying to achieve is ...
7
votes
2answers
416 views

Box half filled color

I am trying kinda to make this figure in tikz but I do not know how it works. I tried with \tcbox[sharp corners, boxsep=5mm, boxrule=.5mm] But I can not fill both sides with color.
0
votes
0answers
36 views

How to embed a multiple subplots inside another subfigure using grouplots

Could somebody please give me a hint of how can I do this using grouplots and tikz. I have done it using subfigure and \includegraphics, however, I am facing problems to arrange the borders of the ...
2
votes
1answer
53 views

How to determine nodes to reduce their length using `tikzpicture` environment

This is and addendum of a previous question: How to insert elective subjects section within a diagram. What I want I would like to reduce the length of those nodes that only have a single column of ...
2
votes
1answer
61 views

How to scale tikzpicture table?

I need to scale this table to smaller size, all together with color boxes. I was not able to do it with scale command. Any help? Thanks. \documentclass{IEEEtran} \usepackage[dvipsnames]{xcolor} \...
1
vote
1answer
48 views

Euclidean Distance

I have the need to draw this project on Tikz, I have some doubts and I can not begin.
1
vote
0answers
42 views

A mean to simulate a no-op in tikz?

I use data to fill in forms (lua string.format instruction) to build tikz commands such as "%s \\draw[->,%s,draw=%s,%s](%.3f,%.3f)%s(%.3f,%.3f)node[midway,anchor=base,%s]{%s};" But sometimes, I ...
0
votes
1answer
18 views

line break inside tikz node pin [duplicate]

How do I get the line break inside a pin node to work in TikZ? \node[pin={\angle+0.5*\percent*3.6:hi\\there}] at (120:3) {}; I tried align=center but didn't work as a typical node.
3
votes
1answer
53 views

Set aspect ratio on 2D pgfplots plot

I would like to set the aspect ratio of a pgfplots plots without explicitly specifying width and height (i.e., leaving them default). For 3D plots, there is plot box ratio; for 2D plots, I tried ...
5
votes
1answer
182 views

Better use of rounded corners with tikz on \draw[->]

I have this code: % !TeX encoding = UTF-8 \documentclass[utf8]{article} \usepackage{tikz} \usetikzlibrary{matrix} \usetikzlibrary{positioning} \newcommand{\multilinks}[3]{\foreach \noeud in {#1} {\...
-3
votes
1answer
99 views

Could anybody help me coding the graphic below? Any tips? [duplicate]

That is all I've got so far from marmot: \documentclass[tikz,border=3.14mm]{standalone} \usetikzlibrary{patterns} \definecolor{lazy}{RGB}{189,208,112} \begin{document} \begin{tikzpicture}[declare ...
3
votes
2answers
53 views

"Illegal unit of measure (pt inserted)” Problem with foreach

I'm trying to make a series of circles with gradients. On the second page, which is created, there is only /2pt/1pt/2pt and on the last /20pt. I guess there's something wrong with my foreach loop, but ...
1
vote
1answer
41 views

Tikz/pgfplots Reduce distance between Tick labels line break

I'm pretty desperate with a problem I have right now. I'm trying to create a lollipop plot that has different categories on the y-axis and occurrences on the x-axis. According to the below code. Note ...
0
votes
0answers
43 views

Embedded picture with separate coordinate system (Tikz)

Am using Tikz, and have a slightly complicated drawing. Now I want to replace a rectangle in a certain place with a more sophisticated shape. This shape I have in SVG format, and I want to replace the ...
1
vote
2answers
32 views

Tikz figure alignment with page margins

I am making some section divisions in a style sheet using tikz. However, even though I start drawing the line at (0,0) it has an offset from the actual page content border. I also set \parindent and ...
4
votes
2answers
45 views

Tikz: place node leftmost of two nodes of different widths

I have the following tikz picture: \documentclass{minimal} \usepackage{tikz} \usetikzlibrary{positioning} \begin{document} \begin{tikzpicture} \coordinate (origin) at (0,0) ; \...
6
votes
2answers
139 views

Comment Box for Substitution Method of Integrals

I want to make a comment box like the image below that adjusts in size as I write up different examples. My MWE is not much \documentclass{article} \usepackage{amsmath, mathtools,tikz} \begin{...
1
vote
2answers
33 views

Lines and axis labels in pgfplots

I have two questions about the code below: How can I put the dashed lines in the right place (that is, from (0, 2) to (3, 2) to (3, 0))? At the moment they are in the wrong place. How can I move the ...
13
votes
1answer
140 views

TikZ-decoration: control decoration amplitude along curve

Working with path decorations based on this solution provided by marmot I am searching for a possibility to change the decorations amplitude along the graph. Having this plot applying the mentioned ...