{nodes} is about nodes in {diagrams}.

learn more… | top users | synonyms (1)

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 ...
54
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 ...
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 ...
10
votes
2answers
2k views

Package PGF Math Error: Unknown operator `o' or `of'

I am getting a weird error while trying to place a node above another node using the below= syntax. \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node[] (node1) at ...
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 ...
21
votes
3answers
4k 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
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 ...
29
votes
1answer
403 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 ...
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} ...
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, ...
10
votes
3answers
1k views

Drawing a proper shadow for overlapping objects

I draw images that are composed of several overlapping nodes. If I add a drop shadow to each node, the shadow of the second node is drawn over the first node, as seen in the picture below (which ...
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?
20
votes
2answers
800 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 ...
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 ...
7
votes
1answer
2k views

Center nodes near coords in a stacked ybar plot

I'm trying to center the node values, at the middle of each bar, in a stacked plot. However I can only put those nodes in the top of each bar. Is it possible to move those down? To the center of each ...
5
votes
2answers
506 views

TikZ: Make node height span several others

How can I make the Z node span the total height of the ABCD column? My current code is: \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc,positioning} \begin{document} ...
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 ...
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 ...
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 ...
10
votes
4answers
927 views

How create circle node in Tikz with T from lines inside? T made split node to 3 sectors

I woud like create 3 sector circle node. See the following figure sectors are bounded by lines
10
votes
2answers
2k views

How to nest a graph within a node in TikZ and draw edges between the graphs?

I'm trying to draw a graph and have a separate graph within one of the outer nodes. I seen this question, but I don't understand how the matrix nodes will help me. I would also like to draw edges ...
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};
8
votes
2answers
250 views

TikZ: using the pos = x in a node

Why doesn't the pos = x option work when the node is used in the plot command? \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture} \draw plot[domain = 0:2, samples = 100] ({\x}, ...
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?
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}% ...
12
votes
4answers
641 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 ...
7
votes
2answers
4k views

How to draw inside a TikZ node, using node style?

I would like to define a node style, so that the node will look like the LaTeX symbol \oplus, i.e. a circle with lines from north to south, and east to west. (I also have more complicated examples in ...
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 ...
9
votes
2answers
572 views

Is it possible to use a macro to name a TikZ node?

Is it possible to use a macro to name and reference TikZ nodes. For example: \begin{tikzpicture} \node (0) at (0,0) {X}; \node (\mymacro{2}{3}) at (1,2) {Y}; \draw (\mymacro{2}{3}) -- ...
6
votes
1answer
3k views

Using [midway] to label a curved path at its centre

I am trying to label two curved paths connecting two nodes with labels placed at their centres using the node[midway] option. This is something that should be very simple but I have not been able to ...
11
votes
2answers
4k views

Cylinder shading with PGF/TikZ

I'm trying to create a cylinder with 3D shading effects. The cylinders in the picture are standing vertically, and have a body and an end. I'd like the body to be shaded so that it varies uniformly ...
9
votes
1answer
167 views

Checking whether or not a node has been previously defined

I use the following code to draw a line to connect two nodes in my graphic: \draw ( p-\prow-\col) -- (p-\row-\col); At the edge of the figure, however, not every node will have a predecessor from ...
5
votes
1answer
135 views

Strech the text to the borders of a node by using \hfill

The text inside the nodes is not streched to the right side of the node by using \hfill. Could it be the reason that it doesn't work with font=\tiny? But I need the text that small and I would like ...
2
votes
1answer
704 views

using foreach to draw a chain with a branch

This is an extension to How to draw the border of a node using late options I'm drawing a chain of nodes with different colors using foreach from tikz. Now I want to add a branch, also using foreach. ...
32
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 ...
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 ...
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 ...
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!
16
votes
1answer
423 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
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 ...
9
votes
1answer
320 views

Connecting nodes with brace in TikZ

How would be possible to put a brace instead of a "line" connecting nodes and add some text above it with TikZ?
9
votes
3answers
4k views

TikZ: Using Loop to Draw Grid of Nodes

I am trying to draw an Ising model (in my case, a grid of nodes with an undirected edge between adjacent nodes on the same row or column) using TikZ. I have the grid of nodes working nicely using a ...
21
votes
3answers
937 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 ...
15
votes
2answers
596 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} ...
10
votes
2answers
588 views

Hyperlinked nodes in TikZ mindmap

I am trying to make a small mindmap such that some of the child nodes are hyperlinked. I tried to follow the advice given here, about the new node style hyperlink node, but the following MWE compiles ...
7
votes
1answer
396 views

Align pinned nodes in PGFplots

I'm working with plots generated from matlab2tikz and I have several plot lines close to each other. Labeling them is proving difficult, but I believe a good looking solution could be to list the ...
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 ...
13
votes
2answers
719 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 ...
11
votes
2answers
1k views

How two connect any arbitrary nodes of tree in tikz

I need to be able to connect any arbitrary nodes in a tree to each other. I am using the tree package in tikz to create my tree. I cannot figure out though how to connect to nodes by let say a draw ...
6
votes
3answers
318 views

How to allow labels' anchors in TikZ to be affected by rotations without rotating the text itself?

I usually write macros when I need to draw many times a kind of figure. In the final document, I call the macro and then I always apply two transformations : a scale transformation to fit in the space ...