Questions tagged [tikz-node]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
21
votes
2answers
19k views

How set TikZ circle radius in \node[circle]?

I know that with TikZ, we can specify the radius of a circle when a \draw command is used, as in: \draw[fill] (1,2) circle (3pt); But how does one indicate the radius when you draw the circle by ...
17
votes
1answer
302 views

In TikZ, is it possible to isolate every character of an expression in a node as its own node?

I often find myself typing equations into a node of a tikz picture. I then often find that I want to isolate certain characters in the equation and define them as a node. For instance, consider the ...
14
votes
4answers
3k views

Placing node right after end of path in Tikz

I'd like to place a label (most of the times a single letter) right after the end of a line. That is, the node should be moved into the direction of the line from its endpoint, just as far that is ...
12
votes
2answers
8k views

How to make all nodes same size in TikZ?

I'm draw a TikZ figure, but I came across two problems. First one is that all the nodes have the different size due to the size of the text inside the nodes. I read in some other question here, that ...
12
votes
1answer
1k views

Tikz - Filling a node with random smooth, closed shapes

I am trying to create the following illustration. Using Tikz, I managed to achieve a partial effect as shown below (please ignore the dimension mismatches). The code I used (MWE) for arriving thus ...
10
votes
2answers
1k views

TikZ inside TikZ-node with given text width does wrong positioning

This code \documentclass{minimal} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node[text width = 3cm]{ a a a a a a a a a a a a a a a a a a a a\\ \tikz{\draw (0,0) node ...
10
votes
3answers
1k views

How to fill a split node with two different colors?

I have that issue when try to fill a split node with two different colors. After using rectangle split part fill={red,blue} as an node argument the drop shadow overlap the node because I don't use the ...
10
votes
1answer
210 views

Drawing partition in LaTeX

I want to draw partition lattice for n=4 like this I was looking for informations how to do it and i found package tikz-cd which i think could be useful but the only thing I managed to do by myself is ...
8
votes
2answers
470 views

A Question Regarding TikZ ellipse

In the Tik Z & PGF Manual for Version 2.10-CVS, page 130/880 there is an example to create a pair of a circle and an ellipse as below: Below is the code I used: \documentclass{standalone} \...
8
votes
1answer
1k views

Move an inline tikz node vertically to align with baseline of surrounding text

I'm trying to incorporate tikz nodes within running text, but have them align nicely with the text surrounding them. My MWE is: % !TEX program = xelatex \documentclass{scrbook} \usepackage{tikz} \...
7
votes
5answers
501 views

TikZ: Alligning two Tikz pictures and align parentheses to nodes

I tried to draw two graphs with Tikz. How can I align them vertically to each other? I want the knots to form the center, such that all six nodes align vertically. Furthermore I want to align the ...
7
votes
5answers
603 views

TikZ: How to position a node relatively to it's edge?

I'm struggling to find a way to position a rectangle A above another one B (e.g., by 2cm) while vertically aligning it's right-end with the center of B. Thanks in advance for your answers. NS
7
votes
3answers
1k views

Change position of node inside rectangle

is there any way to change the position of nodes inside the rectangle drawn for the node itself? For example I got this: \documentclass[12pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[...
7
votes
3answers
738 views

Overlapping nodes in a decision tree

I have the following decision tree taken from this example with little modification. When I added two sub-nodes to the second right node, the inner left and inner right nodes have been overlapped. How ...
7
votes
2answers
299 views

How to perform arithmetic for a node in TikZ?

I have an array of boxes and I would like to number them quickly using TikZ. My idea was to use something like this: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture}[...
7
votes
3answers
365 views

Dyck paths behaving as nodes

I am sort of having two main issues with Dyck paths. I'm trying to get to the image on the left (which I edited it with Paint), and what I currently have is the image on the right. I believe that what ...
7
votes
2answers
1k views

Fill a triangle with nodes on the corners

I'm drawing three nodes and connecting them to a triangle: \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node [ circle, draw ] (A) at ( 1, 0) {A}; ...
7
votes
1answer
1k views

Tikz: Placing node midway right or left relative to path

I'd like to place a node at some position along a path, e.g. \tikz (a)node[pos=0.5,left]{x}{b}; But instead of shifting it 'left', 'right', 'above' or 'below' in absolute coordinates, I would like ...
7
votes
3answers
149 views

Vertical alignment of node contents

In TikZ, I know that the relevant properties to control the shape and text-alignment of a node are: minimum width and minimum height (outer shape) AFAIU baseline is used to align the nodes themselves,...
7
votes
1answer
382 views

tikzmarknode and vphantom take up horizontal space

A tikzmarknode combined with a vphantom character takes up horizontal space. Minimal but nonetheless noticeable. \documentclass{article} \usepackage{tikz} \usetikzlibrary{tikzmark} \begin{document}...
7
votes
1answer
278 views

TikZ node shape depends on inside text

In one of my previous answers, my first proposal \documentclass[tikz]{standalone} \usetikzlibrary{quotes,angles} \begin{document} \begin{tikzpicture} \draw (0,-4)--(0,4) node[above] {$Im$} (-4,0)--(...
7
votes
1answer
2k views

Trapezium size issues Tikz

I have a code that generates a flow chart. It's not entirely complete, it just needs arrows which is besides everything. This issue I have is the process nodes, trapeziums, aren't the same size even ...
6
votes
2answers
1k views

How to position an element relative to an anchor?

My code is: \begin{center} \vspace{-20pt} \begin{tikzpicture}[mybox/.style={rectangle, draw, minimum width=10mm, minimum height=10mm}] \foreach \addr/\val [count=\x] in {$0$,$1$/$28$,$6$/$\...
6
votes
1answer
821 views

How to adjust arrow head size of arrow-node?

I am trying to use single arrow node from shapes.arrows TikZ library. The problem is with the proper adjustment of the arrow tip span - with the argument single arrow head extend. MWE: \documentclass{...
6
votes
2answers
787 views

How to add a white background to an angle label in Tikz?

I'm drawing a diagram for a project, but with the n vector going through the angle label it isn't very clear, I'd like to add a white background to the alpha label so it's easier to see. Thanks, see ...
6
votes
2answers
464 views

How to represent discontinuous data (Interrupted Plots) with pgfplots?

I want to plot a large set of data points generated from a numerical experiment. The plot looks like a step function, that is, for an interval in x-axis, it takes a constant value. The code is (for ...
6
votes
1answer
371 views

Adding nodes through a TikZ style, using double dash lines ``--``

I'm basically asking this question, because the answer there is not working for the case with -- lines. Say you have a line like so: \draw (0,0) -- (3,3) node[sloped, midway,above]{Hey!}; Then is ...
6
votes
1answer
10k views

Text position of a TikZ \node

Here is my code: \documentclass{scrartcl} \usepackage{tikz} \usetikzlibrary{arrows.meta} \begin{document} \begin{tikzpicture} \node (circle) [draw, circle, minimum size = 20mm] at (0, 0) {} ...
6
votes
1answer
205 views

Draw a line that encloses some objects in TikZ

Given an array of circles, I want to draw a line that tightly encloses the circles. Since a picture is worth a thousand words: The code to produce the array of circles is as follows: \documentclass[...
6
votes
2answers
255 views

TIKZ - changing one block into parallel multiple blocks

I have the following code: \documentclass[crop,tikz]{standalone} \usepackage{tikz} \usepackage{textcomp} \usetikzlibrary{shapes,arrows} \usetikzlibrary{positioning} \usetikzlibrary{arrows, ...
6
votes
1answer
238 views

How to add title at custom position in Latex pgfplot?

I tried to add title at custom position of a pgfplot from a CSV (https://drive.google.com/file/d/1xnF8rG9J50ZIxl9K04k6nksvjWoWrfHe/view?usp=sharing) file, but nothing came out. I tried several ways, ...
6
votes
1answer
293 views

Anchor at the baseline of the last line for a tikz node

I'd like to place a node with multi-line text using as anchor the eastmost point at the baseline of the last line, without having to manually break the lines. Specifying the node text width breaks ...
6
votes
1answer
300 views

How can I render filled paths correctly within blend groups in TikZ?

Based on the examples in the TikZ manual around page 341, I expected the following code \begin{scope}[blend group=overlay] \fill [ball color=red] (90:.6) circle (1); \fill [ball color=...
5
votes
3answers
557 views

Matrix of nodes - adjusting the lines

After read some examples of matrix of nodes, i wrote this MWE: \documentclass{article} \usepackage{tikz}\usetikzlibrary{matrix} \usepackage{booktabs} \begin{document} See the Table \ref{fig:cen2}....
5
votes
2answers
1k views

Tikz circle node pie

I would like a tikz circle node to be a pie chart. I have following code: \tikzstyle{bus} = [draw, circle, minimum size=2em,inner sep=0pt] \tikzstyle{busg} = [draw, circle, minimum size=2em,inner sep=...
5
votes
2answers
257 views

How to measure accurately the distance between TikZ nodes centers when using relative placement?

I want to measure accurately the distance between TikZ nodes centers when using relative placement. My answer is around 1.55 cm but this is ballpark. Below is my code: \documentclass{standalone} \...
5
votes
2answers
2k views

TikZ: Anchor current page north west isn't where expected

I want to use TikZ page anchors to draw a sheet with a mix of text and graphics. So I started with a simple rectangle that would cover the entire page: \fill[red] (current page.north west) rectangle (...
5
votes
2answers
184 views

tikzpicture shape label with curves

This may be a very simple question. To the square I have below, how would I add the label shown in yellow? \documentclass[]{article} \usepackage[margin=0.5in]{geometry} \usepackage{pgfplots} \...
5
votes
2answers
345 views

TikZ: redefine/update node label

I need to draw many nodes with labels that I can calculate from their indices. However, a small amount of them do not follow the rule, thus I need to assign their labels manually. Can I do that ...
5
votes
2answers
448 views

hrule into tikz circle node

I am struggling with inner node layout with Tikz. Basically, I want to add a line under the first text line inside a node, splitting it unevenly. Here is a try: \documentclass{standalone} \...
5
votes
1answer
244 views

Adding a circle boundary in a TikZ matrix

I almost figured out how to draw what I want by piecing together two answers here (@Ignasi for TiKZ matrix of objects and @alexraasch for L shaped boxes in tikz matrix). \documentclass{article} \...
5
votes
2answers
550 views

Rotate text in TikZ

How do one rotate text inside a diagram as shown below. Below is my MWE modified from here \documentclass[tikz,12pt]{standalone} \usetikzlibrary{calc,positioning,backgrounds,arrows.meta} \usepackage{...
5
votes
1answer
106 views

Tikz node with multiparts coloring but single part text

I want to create a tikz node with two colors (split along a vertical axis) and a single body of text spanning the two parts. The way I've seen the shapes.multipart library used makes the being ...
5
votes
1answer
184 views

Tikz: Problem with “sloped” in cyclic tree

I am trying to get sloped text on an edge in a tree. \documentclass{article} \usepackage{tikz} \usetikzlibrary{trees} \usetikzlibrary{graphs} \usetikzlibrary{positioning} \renewcommand{\...
5
votes
1answer
391 views

Nesting tikz nodes

I want to put a tikz graph (a Feynman diagram using tikz-feynman) inside other tikz nodes, but it doesn't seem to work. A MWE is below. It has to be compiled with lualatex as I'm using graphs. \...
5
votes
1answer
505 views

How to use variables in node keys in TikZ

I have used variable \x while drawing nodes using TiKZ. The drawing part works well without any problems. I have also added keys to the nodes so that they can be linked later. I am facing a curious ...
5
votes
1answer
259 views

tikz node rotation and positioning

If I specify /tikz/rotate=<degree> in some path other than node, it means rotating the coordinate system by <degree>. Consider following example: rotate option inside a node seems to ...
5
votes
1answer
7k views

How to set distance between nodes in TikZ

I'm trying to draw a web graph for a paper, using TikZ to draw the individual pages as nodes. When I typeset, however, the graph sits in one small corner of the line, and the nodes are too close ...
5
votes
1answer
1k views

How do I set a really exact radius for a node?

Creating an energy level diagram, I used this answer to make the node circles equal radius: How to set exact radius for a node? \documentclass{report} \usepackage{tikz} \begin{document} \begin{...
5
votes
1answer
2k views

Creating a (tensor) network using TikZ [duplicate]

I am trying to draw a very simple network diagram. My code: \begin{tikzpicture} \node[draw, shape=circle] (v0) at (0,0) {$v_0$}; \node[draw, shape=circle] (v1) at (1,0) {$v_1$}; \...

1
2 3 4 5
7