{nodes} is about nodes in {diagrams}.

learn more… | top users | synonyms (1)

55
votes
1answer
6k views

Manual/automatic line breaks and text alignment in TikZ nodes

How can I insert a line break in a TikZ node? Simply putting \\ where I want the break doesn't work (see MWE). Is there a way to make lines break automatically at some specified width? And can I ...
53
votes
1answer
7k views

Difference between “right of=” and “right=of” in PGF/TikZ

In the PGF/TikZ manual, sometimes I see the option right of=somenode instead of right=of somenode. They look very similar, but the effects are different. The distance between nodes positioned with ...
37
votes
5answers
34k views

TikZ set node label position more precisely

This seems like it should be really easy but I can't seem to find it anywhere... I'd like to be able to fine-tune the positioning of a node label. I'm aware of the ...
34
votes
2answers
28k views

How to change the size of nodes?

How is it possible to change the size of a node, for example: \begin{tikzpicture} \draw node[fill,circle]{} (0,0);% \end{tikzpicture} How to make the circle smaller or larger?
33
votes
3answers
5k views

TikZ: Bend text so that it follows a line

I have two arrows going from a node on the left to a node on the right. Both arrows are slightly bent. I want to label the arrows with text that is bent just like the arrows. This is as far as I've ...
33
votes
3answers
12k views

Add more anchors to standard TikZ nodes

I frequently find myself needing more than the standard anchors TikZ nodes provide, i.e. north, north east, east and so forth. I usually use coordinate calculations for this, as in the example below, ...
29
votes
1answer
405 views

How can I know if a node is already defined?

I think I've seen this question before, but I can't find it. The problem is simple; before I assign a name to a node I would like to know if the name is already used. I think when a node is created ...
27
votes
4answers
9k views

Node shapes in TikZ

I want to draw a block diagram for a software app and I need two shapes which I couldn't find on the Internet. The shapes are a parallelogram and a rectangle with double side margins. One is for data ...
26
votes
3answers
20k views

Tikz: Multi-line text in the node description [duplicate]

I use tikz to create pictures in latex. My picture consists of set of nodes. Every node has its own text inside the node, for example, "This node is valuable": \node (mynode) [mystyle,right=of ...
25
votes
3answers
13k views

Tikz - How to Draw Boxes Around Set of Nodes

How to draw the boxes as shown in the attached image? I could only manage to draw the chart but could not highlight the desired node / nodes with a rectangle box. Preferably dotted. I could not draw ...
25
votes
4answers
5k views

How to place a node in the middle of an arc?

I think it is a simple question, but I didn't find the answer yet. The code I'm using is the following: \draw[->](1,0) arc(0:-30:1) node[midway]{$30$}; But in this way the node is placed at the ...
24
votes
1answer
4k views

Creating node shapes

I am currently learning how to use TikZ/PGF to make some figures for a project report, and so I have a question: Is there is a practical way of making a particular object into a node? The object ...
22
votes
4answers
9k views

TikZ: difference between \node and \coordinate?

What is the difference between \node and \coordinate in TikZ? Exchanging them does no visual effect in my (to be honest: still simple) pictures. When to use what?
22
votes
2answers
2k views

Defining a new environment whose contents go in a TikZ node

I would like to define an environment which typesets the contents in a box, and I'd like to use TikZ (I'm aware of alternatives like fancybox). So I would like something like \newenvironment{abox}% ...
21
votes
3answers
3k views

Fancy arrows with TikZ

I would like to draw an arrow like this using TikZ: This is taken from Workflow diagram. I didn't succeed in reproducing the arrow; is somewhat beyond my (extremely limited) TikZ abilities. I don't ...
21
votes
3answers
5k views

How can I set the TikZ label anchor explicitly?

I want to add a label to a node, but "inside" the node. Something like this: The manual seems to indicate it might be possible, although no actual key is named. The ... anchor point for the ...
21
votes
3answers
939 views

TikZ Nodes not exactly centered

In my solution to draw a plot with point, it was pointed out that the nodes containing \textbullet and $\circ$ were not placed exactly centered at the specified point. I found this hard to believe ...
21
votes
3answers
10k views

How to set exact radius for a node?

I have a bunch of nodes and would like to size them so that their areas represent some numbers I have (so that if I have two nodes with corresponding values 1 and 2, then the second node's area should ...
21
votes
1answer
2k views

TikZ picture shapes

I am very new to the TikZ package, and I need to draw some flow chars by using the following shapes. However I couldn't figure out how to draw the 4th and and 6th ones below. It would be very nice ...
20
votes
2answers
804 views

How to modify nodes in TikZ to automatically add a line on their top?

In TikZ there is the very flexible node system. As a beginner I am still stumbling over a few details. How can I modify a node or create my own nodes easily? As an example I need a node with a thick ...
19
votes
2answers
1k views

Tikz: purely vertical arrow from nodeA.south to nodeB.north

I have the following tikz code % compilation command: pdflatex --jobname=Diag-f1 Diag.tex \documentclass{book} \usepackage{tikz} \pgfrealjobname{Diag} \begin{document} \beginpgfgraphicnamed{Diag-f1} ...
19
votes
3answers
6k views

TikZ - multi-color double circle node

How do I draw a node with a double circle shape where one circle has a different color than the other circle? A single \node[whatever] {content} would be nice!
19
votes
2answers
1k views

Meaning of bend right or left in TikZ?

The following code actually comes from the PGF manual. It works fine, but I have a difficult time in understanding it (I'm new to TikZ) \documentclass{article} % say \usepackage{tikz} ...
19
votes
2answers
1k views

Accessing the logic values of a TikZ coordinate

In TikZ accessing the coordinate values of a node can be done using the let syntax of the calc library or using the PGF command \pgfpointanchor. However, this values are dimensions/lengths in points ...
19
votes
1answer
6k views

Comprehensive list of TikZ style options?

I'm aware that one can use \tikzstyle{every label}=[...] to apply styles to every label within a tikzpicture; or \tikzset{mystyle/.style={...}} to apply style specs to a specific type of node mystyle ...
18
votes
3answers
3k views

Placing nodes along an ellipse in TikZ

Is anybody aware of a simple way to place nodes at arbitrary positions along an ellipse? Ideally I would want to mimic notation like \draw (0,0) ellipse [ x radius=2, y radius = 1] node[pos=.3] ...
17
votes
3answers
4k views

How can I align two nodes to the left in TikZ?

I have two unaligned nodes |AAAAAAA| |B| and I want to have the node with the B aligned to the left of the node with AAAs and below it |AAAAAAA| |B| How can this be done?
16
votes
5answers
2k views

Creating a node fitting the horizontal width of two other nodes

I have the two PGF nodes foo and bar positioned in a row. \documentclass{article} \usepackage{tikz} \usetikzlibrary{positioning} \begin{document} \begin{tikzpicture}[node ...
16
votes
1answer
3k views

Draw edges and paths in the background of nodes in TikZ

Is it possible to draw edges or paths in the background of nodes independently of whether they are constructed before or after the nodes are defined? In the following example, the \draw instruction ...
16
votes
1answer
425 views

nodes structure like file system

I would like to draw a picture that reflects some file structure. Below code works almost as expected. I need to adjust the connections between nodes so they don't start from the center of the bottom ...
15
votes
2answers
597 views

How to center a typewriter (ttfamily) '+'

I would like to draw a circular TikZ node with + in its center, but font=\ttfamily moves it up. Why? How to solve it? \documentclass[border=3mm]{standalone} \usepackage{tikz} \begin{document} ...
15
votes
4answers
6k views

Nested TikZ nodes

This isn’t the first time this question was asked but the other solutions don’t work in my case. Consider the following image: It was created using this code: \begin{tikzpicture}[ node ...
15
votes
2answers
2k views

How to make tikz multipart node parts have uniform size?

When making boxed nodes in TikZ, a common requirement is that the nodes be of equal size. Because TikZ automatically adjusts the size of nodes to fit the contents of the node, this is usually done by ...
15
votes
2answers
2k views

TikZ rectangle split parts with fixed height

I was wondering if there is a way to set the height of rectangle split parts. I had no luck finding something in the pgfmanual. (Using \phantom seems just like a quickfix.) Here is an example to ...
15
votes
1answer
3k views

Declare nodes in pgfplots as overlays

The Background In pgfplots, it is possible to make plot elements such as axis labels, ticks and legends overlay, which means they will not be considered when determining the bounding box of the plot. ...
14
votes
3answers
366 views

tikz, drawing a rectangle with spikes on borders

I would like to draw a scrabble board. On my long journey to do that, I would like to set nodes which I could use around the board. The grid, that I can do. Now I'am looking at coding for "triple word ...
14
votes
3answers
15k views

How to increase the horizontal distance between nodes?

I've got this Tikz picture and I'd like to increase the horizontal distance between the nodes while keeping the vertical distance unchanged. I know how to do it by placing the nodes manually using ...
14
votes
2answers
3k views

How to center one node exactly between two others with TikZ?

How can I center a TikZ node exactly between two others? Hypothetically, \node (a) {a} \node (c) [right of=c] {c} \node (b) [between={a,c}] {b}
14
votes
1answer
2k views

How to use “fit” to frame the nodes and labels

I'm using the fit TikZ library to fit a rectangle around two nodes which include labels. However, the rectangle is only fit around the actual nodes, not about their labels: \documentclass{article} ...
13
votes
2answers
13k views

Adjusting font size with TikZ picture

Taking from the PGF manual, \begin{tikzpicture} \draw [help lines] (0,0) grid (3,3); \coordinate (a) at (rnd,rnd); \coordinate (b) at (3-rnd,3-rnd); \draw (a) -- (b); \node (c) at (1,2) ...
13
votes
2answers
857 views

Text over rectangular node

I am trying to create a new environment that will contain the following displayed counter (at least something like it): \documentclass[letterpaper]{article} \usepackage{amsmath,amssymb} ...
13
votes
2answers
597 views

Naming the nodes of `nodes near coords` for later use

I would like to use pgfplots command nodes near coords to get a list of named node ((no1), (no2), (no3) etc.) that I can use afterwards to draw some paths that I fail to construct with pgfplots only. ...
13
votes
2answers
724 views

TikZ: shade also the border of a node

I would like to shade a node and the border of the node. The following code works but I don't like it very much that I have to draw something after the node on the background layer. I would prefer a ...
13
votes
1answer
1k views

TikZ style attribute for adding default node text?

Is there a TikZ style attribute for adding default text to a node? For instance, I want to be able to do something like the following: \begin{tikzpicture}[% stuff/.style={% draw, text=Bla ...
12
votes
4answers
649 views

Tikz shape similar to rectangle with selective drawing of borders

I am looking for a tikz shape similar to the rectangle shape, but with the possibility of drawing individual borders selectively. Also when used with rounded corners, the corners missing a border ...
12
votes
5answers
307 views

How to force nodes on different lines to have equal y-positioning

I have, hopefully, a very simple question. I use tikz to make a figure for confirmatory factor analysis (CFA). In the minimal example there a 6 arrows going from the circle to a fixed place. However, ...
12
votes
3answers
3k views

Horizontal row separation line in tikz matrix (like \hline in tabular)

In this question tikz-matrix-as-a-replacement-for-tabular a nice solution was given to let the matrix in tikz behave like tabular. In this solution cell/.style={rectangle} was used to draw lines ...
12
votes
1answer
7k views

Increase the thickness of node border in TikZ

Suppose I have a node in the shape of a circle. How can I make its border thicker? \node[circle, draw=blue!80, inner sep=0pt, minimum size=12pt] (1) at (0,0) {1};
12
votes
2answers
1k views

How to avoid covering nodes with connection lines

When drawing connection lines (edge) between nodes, the lines will be drawn over the nodes (due to the drawing sequence). If having many connections, it may problematically cover the nodes, and ...
12
votes
1answer
3k views

Bending arrows in Tikz

In Tikz, I would like to bend an arrow like the one between $H_2O$ and $O_2$ in this figure: I'm able to have a bended line between $H_2O$ and $O_2$, but it's not touching the photophosphorylation ...