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-graphs]

The `graphs` and `graphdrawing` libraries included in PGF/TikZ 3.0 provide powerful tools for drawing graphs (with edges and nodes, not graphs of functions).

6
votes
3answers
533 views

How to draw/optimize this graph with tikz

I would like to know if is there a way to optimize the code that I use to draw the next graph: I do it using this: \documentclass[11pt]{article} \usepackage{tikz} \begin{document} \begin{figure}[h]...
1
vote
1answer
40 views

Tikz: two labels on one edge (one following the other one)

I would like to add a label which follows another one. For instance, I have: \documentclass[10pt]{beamer} \usepackage{tkz-graph} \GraphInit[vstyle = Shade] \tikzset{ LabelStyle/.style = { ...
4
votes
2answers
217 views

pgfplots: How to draw exponential graph with 60° start angle?

I want to draw a simplified Michaelis-Menten kinetic (monod-function) to compare it with a linear function. Minimum Working Example (MWE): \documentclass{standalone} \usepackage{pgfplots} \...
3
votes
1answer
95 views

Phase plane diagrams in latex [closed]

Is there any method to construct phase plane diagrams directly in latex? I want to sketch plots like these based on eigenvalues of a matrix. For e.g., if both the eigenvalues of a 2-by-2 matrix are ...
2
votes
2answers
60 views

How to optimize this codes of graphs with tikz

I am trying to learn Tikz and I want to know if there is a way to optimize this 2 graphs. Thanks. \documentclass[11pt]{article} \usepackage{tikz} \begin{document} \begin{figure}[ht] \...
1
vote
1answer
28 views

How to eliminate the arrows on this Cayley Graph

I am trying to do the next graph, but without using arrows: \documentclass[11pt]{article} \usepackage{tikz} \usetikzlibrary{lindenmayersystems,arrows.meta} \newcount\quadrant \...
1
vote
1answer
59 views

How to draw this cyclic graph with tikz

I am very new using Tikz, I am trying to draw this graph: \documentclass[11pt]{article} \usepackage{tikz} \begin{document} \begin{tikzpicture}[y=.6cm, x=.6cm,font=\small] \draw [latex-...
4
votes
2answers
80 views

Tkz-graph and foreach

I want to draw the following graph by using the usepackage tkz-graph and the command foreach or by any other method: \documentclass{article} \usepackage{amssymb,amsmath} \usepackage{xcolor} \...
8
votes
2answers
252 views

Why is there a trace line in this tikz graph?

I am trying to generate a shaded area between three curves: two are y=±√x and third one is y=5. \documentclass[10pt,multi=False,border=5pt,tikz,class=scrartcl]{standalone} \usepackage{xcolor} \...
3
votes
1answer
184 views

Simplest way to draw an arbitrary unweighted undirected graph with TikZ?

Sorry if this has been asked before, but I couldn't find something to address my particular issue. Everything I have seen (e.g. this) seems to assume particular pattern to the edges and nodes. I ...
1
vote
1answer
34 views

Changing radius for rounded corners in tikz \graph

I'd like to specify the radius of rounded corners in my \graph. I know I can change the radius of a rounded corner with an explicit \draw command, but I haven't seen a way to do it in a graph. The ...
3
votes
1answer
77 views

Layered graph by tikz lib graphdrawing: rotate & minimize manual adjustments

I was trying to recreate following graphviz graph with tikz (from https://graphs.grevian.org/example) graph { rankdir=LR; a -- { b c d }; b -- { c e }; c -- { e f }; d -- { f g }; e -- h; ...
5
votes
1answer
60 views

How to skip levels in a TikZ graph

In the following simple graph drawn with the TikZ \graph command I would like the red f node to appear on the same level as the other leaf nodes (a, b, c, d). Is there any option to skip a level ...
7
votes
3answers
350 views

Rotating Standard Graphs

Is there are way to rotate standard graphs in tikz? For example, the following produces a cyclic graph with 6 vertices \begin{tikzpicture}[every node/.style={fill,circle,very thick,inner sep=0pt}] ...
5
votes
2answers
233 views

TikZ: Circle node split vertically mixes up representation

I used this previous solution to successfully split a node vertically in my graph. But by using this solution the graph representation will get mixed up. How can I fix this? Thanks in advance! ...
4
votes
2answers
267 views

Tikz graphdrawing trees layout: center second child

I have created following tree/graph: %! TEX program = lualatex \documentclass[]{scrartcl} \usepackage{tikz} \usetikzlibrary{ graphs, graphdrawing, quotes, } \usegdlibrary{trees} \begin{...
0
votes
1answer
147 views

Draw a graph with vertex pairs

I want to draw in LaTex a Petersen Graph using Kneser graph K(2,5) notation. And i'll do the same with the hypercube. Like this exemple: How can i do it please ?
2
votes
1answer
47 views

How can I set bend right=0 for all edges in a tikz graph?

Consider following graph %! TEX program = lualatex \documentclass{article} \usepackage{tikz} \usepackage[graphics, active, tightpage]{preview} \PreviewEnvironment{tikzpicture} \usetikzlibrary{graphs,...
1
vote
2answers
262 views

Graph with parallel multi-edges with designated anchor points

Consider following graph created with the GUI tool LaTeXDraw: I want to create a similar graph with tikz. This is how far I got: %! TEX program = lualatex \documentclass{article} \usepackage{tikz} \...
-3
votes
1answer
119 views

What's the code for this graph?

How can I draw the picture below using tex code? I know that possibly every pic of this type can be made into tex environment, but I'm running out of time and I really appreciate your help. All 7 ...
2
votes
1answer
77 views

How to draw a pentagon shaped graph with edges only on the outside?

I've managed to find the graph below but I would like for the edges to only be between consecutive outside points (ie (1,2), (2,3), ..., (5,1)) \documentclass[border=3mm,tikz]{standalone} \begin{...
2
votes
1answer
202 views

Tikz mindmap: combine “grow cyclic” with “clockwise from”

I'd like to define a mindmap in tikz that basically do the same thing as grow cyclic, except that the direction of the first layer should go to the bottom instead of the right. I tried to use ...
2
votes
2answers
132 views

Macro for TikZ to draw loops in oriented graphs

I am fairly new in TikZ and even more in TikZ macros. I wanted to modify the macros given in another thread, and the goal is to implement node loops but to be able to enter the in and out angles as ...
1
vote
1answer
29 views

Tikz graph labels: Error compiling example from manual

I am trying to add labels to arrows in a Tikz graph. The following example from the manual, p. 260, does not compile on my updated TeXLive 2017 system. Both pdflatex and xelatex give this error: ! ...
4
votes
1answer
86 views

Tikz - drawing edges between subgraphs systematically

I have a similar question to this, but am hoping to find a more systematic answer. This is my code-- \documentclass[tikz,border=5]{standalone} \usetikzlibrary{graphs} \usetikzlibrary{...
2
votes
2answers
74 views

How do I make an arrows, texts and dots in my own TikZ graph

Following the advice of @cfr, I have made the graph the TikZ from 0 guiding me through several pdf and TikZ graphs from other approaches. Here my TikZ LaTex: \begin{tikzpicture}[ ell/.style 2 args=...
4
votes
1answer
304 views

graph with tikz, math environment in nodes

I'm trying to draw a graph which node text should be in a math environment. For instance consider the following : \documentclass{article} \usepackage{tikz} \usetikzlibrary{graphs} \begin{document} \...
1
vote
1answer
134 views

How to use arbitrary text as node name in tikz graph in a simple way?

I would like to use tikz graph to draw graphs of function calling relations. But I have trouble with function names from C programming language, where underscore is allowed in a function name. \...
3
votes
0answers
92 views

Issues with node labels using quotes on referenced nodes in graphs

The following: \documentclass[12pt]{article} \usepackage{tikz} \usetikzlibrary{graphs, graphs.standard, quotes} \begin{document} \begin{tikzpicture} \graph[grid placement, n = 4, chain shift = {(2,0)}...
2
votes
1answer
50 views

How can I limit the length of a plotted function?

I'm trying to plot a simple exponential function on a graph, however, the function itself isn't staying within the domain. Here's the code \begin{tikzpicture} \draw[->] (-3,0) -- (3,0) node[...
2
votes
1answer
114 views

Complex TikZ graphs from multiple sources with subgraphs labeling an edge

I'm attempting to create a diagram equivalent to the following using TikZ: Trajectory in the Muddy Children Problem I have a solid handle on how to create the individual components/subgraphs in TikZ....
1
vote
2answers
332 views

Automatically draw a graph with a cycle in Tikz?

I know how to automatically draw graphs with nodes being only bound to the next node in a "line". But how would I do it if I have a cycle like this: Thanks in advance.
5
votes
1answer
307 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. \...
2
votes
1answer
39 views

How to create equi-distant labeled nodes and edges on a spiral with TikZ?

I used the code below and got figure 1. How do I get figure 2? \documentclass[border=5mm]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw [fill=white] circle [radius=4pt] (0,...
3
votes
0answers
216 views

Rotate tikz “Layered Layout”

I know many of the layouts in Tikz can be rotated, but I fail to do it with the Layered Layout. I have a very large chart that takes a lot of space horisontally, and i believe it would look better ...
1
vote
1answer
36 views

The expression which the key /tikz/graphs/m is supposed to be an abbreviation of, isn't equivalent to it

The section "Graph subgraph I_nm" on pp. 299-300 of the TikZ & PGF manual for version 3.0.1a states (on p. 300) that the key /tikz/graphs/m=<number> is an abbreviation for W={1,...,<...
3
votes
1answer
93 views

Based on what does TikZ decide which graph nodes to connect with an edge?

Consider the following Plain TeX manuscript featuring a TikZ graph. \input tikz \usetikzlibrary{graphs} \tikz \graph { {a,b,c} -> {d,e->f} };% \end This manuscript renders the following graph. ...
2
votes
1answer
194 views

Multiple questions regarding drawing coordinate systems and graphs with Tikz

this is the first time I am trying to use Tikz in LaTeX and I have to admit that the huge amount of stuff you can do with Tikz is overwhelming and I would be thankful for a slow and detailed ...
1
vote
2answers
204 views

pgfextra vs. graph: a paradox!

Consider the following LaTeX manuscript featuring a TikZ picture of two filled circles. The right circle is drawn inside a \pgfextra. The path's fill color is yellow! \documentclass{standalone} \...
0
votes
1answer
152 views

An example from the TikZ manual re the /tikz/graph/parse key

I will list two LaTeX manuscripts. The first one, which is the example given in the manual to demonstrate the usefulness of the /tikz/graph/parse key, compiles successfully, whereas the second one ...
0
votes
1answer
72 views

Rationale for the `<` notation for specifying an outgoing edge option as a source node option

Consider the following LaTeX manuscript featuring a simple TikZ graph (the graph's code is essentially copied from p. 260 of the TikZ & PGF manual for version 3.0.1a). \documentclass{standalone} \...
0
votes
0answers
65 views

How to define a font style for both text and math in a tikz graph?

I would like to use the font style Cambria for both text and math in a tikz graph? I mean; I would like Cambria style in labels, nodes, ticks... Is someone who knows how to fix this? My code is the ...
3
votes
2answers
187 views

tikz-graph last level of tree circled only

How can I have only the last level (leaves) of the tree circled (not everyone)? \documentclass[tikz,border=10pt]{standalone} \usetikzlibrary{graphdrawing} \usetikzlibrary{graphs} \usegdlibrary{...
3
votes
1answer
281 views

tikz graphs library: Edge label syntax

I'm using tikz and its "graph" library, and I'd like to label some of my graph's edges. The tikz manual (pgfmanual.pdf v3.0.1, p. 364) suggests the syntax \documentclass{scrartcl} \usepackage{tikz} \...
0
votes
1answer
337 views

Self-loop with tikz-graphdrawing library

Self-loop can be drawn on a node; there are plenty of examples in documentation e.g. tikz: self loop with two arrows at the end (i.e. ending by ->>). I can achieve it via graphviz easily. I ...
5
votes
1answer
323 views

Drawing connected complete subgraphs which share edges and vertices

How can I draw the following graph using TikZ Here are the sub-graphs but I don't know how to connect them \documentclass{article} \usepackage{tikz} \usetikzlibrary{graphs,graphs.standard} \begin{...
2
votes
0answers
289 views

Tikz : Graphs : Shift the sublayers/levels horizontally and vertically in a tree layout?

This differs slightly from directory listing as at TeXample and Drawing a directory listing a la the tree command in TikZ in that I'd like to annotate the final structure showing links between the ...
3
votes
1answer
530 views

How do you change the font for edge labels in a tikz graph?

In the following example: \begin{tikzpicture}[>=latex] \tikz { \graph [grow right sep=7mm] { a <-["label-1",bend left] b ->["label-2",bend left] c }; } \end{tikzpicture} I ...
0
votes
1answer
236 views

TikZ, cannot find graphdrawing library

I am on Mac Os 10.11.6, my TexLive distribution is the one of 2016. I would like to draw this graph and I need to use graphdrawing library from tikz, but I am not able to do this because I receive ...
1
vote
1answer
135 views

How to plot this diagram?

I have to plot this diagram, as shown in the picture. But couldn't find the way to do so in latex, very easy to do in paint and then include it in latex. But can I write something to get such as the ...