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

Graphs are (1) graphs of functions or (2) sets of nodes and edges.

2
votes
1answer
42 views

Drawing step functions

How would I represent a one dimensional potential step such as the one shown in the attached figure? I've managed to get as far as defining my x and y axis but I'm not sure how to draw the function ...
0
votes
1answer
65 views

How to draw animated isomorphic graphs?

I saw a nice question & answer over here, about creating an animation to demonstrate graph isomorphism. I'd like to do the same for these two examples: These two are isomorphic: These two aren't ...
0
votes
0answers
40 views

How to put a graph in front of another graph in Tikz

\begin{tikzpicture} \begin{axis}[ymax=17,ymin=-1] \addplot [color=red, domain=-4:4, samples=50]{x^2}; \node[label={180:{(1,5)}},circle,fill,inner sep=1.5pt] at (axis cs:1,5) {}; \...
5
votes
1answer
71 views

Tikz, issue with applying style to nodes

I am a beginner in LaTeX, especially in TikZ package. I want to draw Peterson graph with some styles. My code \documentclass{article} \usepackage{tikz} \usepackage{caption} \usepackage{graphicx} \...
0
votes
0answers
40 views

What to use in latex to create graphs, charts, tables?

I made my research and I found out that you can do this customly by giving commands in Latex. Since I'm new to this environment, is there any good online tools that could be used, and allow this ...
-1
votes
1answer
106 views

How to draw this graph in LaTeX [duplicate]

I would like help drawing a specific graph in LaTeX
1
vote
1answer
41 views

How to have different types of edges based on values in foreach loop?

I am trying to draw a Knodel graph using TikZ. The graph I am trying to reproduce has different style edges for each "dimension". I would like to have different edges for the different values of Delta ...
0
votes
1answer
32 views

Defining TikZ function to produce Knodel graphs

I am trying to define a function that will produce a Knodel graph (examples pictured below). I'm not completely sure how the code works for TikZ to do a for loop using a range, and how to compute ...
2
votes
1answer
37 views

Combine multiple coordinate systems in one tikz/pgfplot

I need two or three distinct coordinate systems in "one tikz environment". The systems are very similar (some linear functions, some labels, the same axis scale). A horizontal shift or minipage are ...
1
vote
1answer
25 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 \...
5
votes
4answers
323 views

TikZ graph edges not drawn nicely

I am still new to using Tikz... I am trying to draw a wheel-like graph using TikZ. I have the basic graph done, but it is not turning out how I expected it to. The edges in my graph aren't centered/...
1
vote
1answer
32 views

Illustrate segments along a function in tikz

What is a good way to illustrate certain intervals along a curve? I start a MC-curve. Between SR and LR there should be one additional line-segment. Finally a third line starts at LR on MC. All in ...
0
votes
1answer
42 views

How to make certain nodes have no circle around it using tkz-graph?

I'm trying to draw a simple hierarchical structure using tkz-graph: \begin{tikzpicture} \Vertex[Math, L=\pi, x=0, y=4.5]{pi} \Vertex[Math, L=\pi^{\frac{1}{32}}, x=-4.5, y=0]{pi_32_1} \Vertex[Math, L=\...
3
votes
1answer
31 views

Joining bullets and nodes xy pics

I'm reasonably new to using xy-pics, and I'm trying to figure out how to connect bullets together. The lines I draw are only 'half connected'. This is my code: \documentclass{article} \usepackage[all]...
1
vote
2answers
127 views

Tikz - cannot figure out why my lines won't connect

I cannot figure out why my code doesn't compile into the attached image, not sure if I am missing something in how Tikz works or there's another issue: Code \begin{tikzpicture} \node[shape=...
1
vote
1answer
79 views

How to plot a function

Hello I am new to this stackexchange, and I have a question in regards to how one plots a function. I have done research, and I have seen this question: The Question I have even tried programming ...
2
votes
1answer
56 views

How to draw this directed graph with tikz

I am new using Tikz, and I am trying to know how to draw graphs, my try is: \documentclass[11pt]{article} \usepackage{tikz} \begin{document} \begin{tikzpicture}[y=.4cm, x=.4cm,font=\normalsize] \...
2
votes
1answer
60 views

Making tree structure using tikz

I want to make a tree structure by tikz. I am not a professional latex user and I am just trying to combine examples to make it work but first I would like that the edges have direction and then T 3 ...
4
votes
1answer
88 views

graphviz overlap edges and arrows [closed]

So I was using graphviz and wrote the following piece: digraph MyGraph { rankdir=TB; size="8,5"; node [shape = circle]; 1 2 3 4 5 6 7 8 9 r 1->4 1->4 1->5 1->5 ...
2
votes
1answer
34 views

Moving arrow to the bottom of the graph using graphviz

I was trying to use graphviz to crete the following graph: digraph G { rankdir=TB; size="8,5" node [shape = circle]; 0 1 2 3 4 5 node [shape = circle]; 1 -> 2 []; 2 -> 3 ...
2
votes
1answer
21 views

Connecting 2 Nodes on the Same Level

I'm a bit lost on connecting 2 nodes together that are not children. Any help would be appreciated. \usepackage{tikz} \usetikzlibrary{trees} \begin{graph}{2.5in} \centering \begin{...
2
votes
1answer
75 views

Duplicate and overlapping edge labels in tikz graph

on the following graph (using the new Tikz syntax), I have 2 edges with different labels pointing towards the same node. But one of the edge have both labels overlapping ! Here is a minimal example (...
2
votes
3answers
94 views

Tick Marks in Geometry

Here is an excerpt from my code: \begin{tikzpicture}[scale=5.5] \coordinate[label=left:$A$] (A) at (0,0); \coordinate[label=right:$B$] (B) at (1,0); \coordinate[label=:$C$] (C) at (0.5,...
1
vote
3answers
161 views

Creating graph for an absorbing markov chain

I have the problem to create the following graph It should have the following style The code is given by \documentclass{article} \usepackage[margin=1in]{geometry} \usepackage{amsmath,amssymb} \...
1
vote
2answers
81 views

problem with creating a graph using tikz

I have a little problem. I have create with latex a graph. Here is my code \[ \begin{tikzpicture}[->,>=stealth,shorten >=1pt,auto,node distance=2.5cm, semithick] \...
4
votes
3answers
905 views

plotting a linear programming problem

I am a beginner in latex , but I am learning as I go, I want to plot the following linear programing problem: (plot : to make a graphic) f(x,y) = 2x - 3y -> max x + y <= 12 x,y >=0 here ...
5
votes
1answer
68 views

Comparison line chart

I want to produce a comparison graph chart like this: I have found information about bar graphs, but not about line comparison graphs as I am trying to do. Any help?. Thanks.
5
votes
3answers
155 views

How to create a vertex at the intersection of two edges with tkz-graph?

I want to draw But I don't know how to create v_6 which is the intersection of \Edge(v_3)(v_5) & \Edge(v_1)(v_4) and v_7 is the intersection of \Edge(v_3)(v_5) & \Edge(v_2)(v_4). Here the ...
1
vote
1answer
48 views

How can I add a fixed point to a line of best fit? [duplicate]

I am using y = {create col/linear regression={y=data}} with addplot to generate a line of best fit from data I'm pulling in from a file. How can I force the line to include the origin as a point it ...
1
vote
1answer
162 views

Creating a graph for a markov chain

I have the following problem. I want to create the following graph So far I know how to create a graph with latex. But I don't know how to insert the series points. Here is my solution. It looks ...
2
votes
1answer
44 views

Gnuplot+LaTeX: two figures side and y-label far away

I read most of answer to similar questions, but they did not help me. I have two problems: these are two graphics that I am trying to place side by side. But: firstly, they turn out to be shifted ...
1
vote
1answer
51 views

Notation for flag algebras in graph theory

I am reading some papers regarding flag algebras, in particular this one. It can be seen that there are nice graphical representations of simple graphs such as triangles and squares, e.g. on the ...
1
vote
1answer
59 views

Adjusting TikZ Figure

I use following script (see also here) below, to draw this figure: \documentclass{article} \usepackage{pgfplots} \usepackage{pgfplotstable} \usepackage{tikz} \usetikzlibrary{positioning} \begin{...
1
vote
2answers
119 views

How do I plot an ellipse with \addplot with using an equation

i am trying to plot an ellipse in my coordinate system. TikZ provides an implemented easy method for plotting ellipses, but I don't like it — I want to draw my ellipses with actual analytic equations. ...
3
votes
2answers
32 views

Axis environment problem: how to determine a domain in which x and y axes are to be drawn?

Let's suppose that I want to put a neat graph of the sinus function in my document. Its source code is: \documentclass{standalone} \usepackage{pgfplots} \usepackage{tikz} \usetikzlibrary{calc} \...
4
votes
1answer
67 views

Customized node of graph in tikz

I found the following picture of snowflakes: \begin{tikzpicture}[decoration=Koch snowflake] \draw decorate{decorate{decorate{decorate{(0,0) -- (3,0)}}}}; \draw decorate{decorate{decorate{...
2
votes
1answer
85 views

Strange white outline around vertices in graphs made by TikZ [closed]

In Metapost I was able to make a graph where there's no gap between the edges and vertices: But in Tikz there is a gap between the two: Making a black "border" around the vertex did not help. No ...
5
votes
2answers
186 views

Recreating Peterson graph with tkz graph?

I was trying to recreate Here is my MWE \documentclass{standalone} \usepackage{tkz-graph} \usepackage{tkz-berge} \definecolor{iceberg}{rgb}{0.44, 0.65, 0.82} \tikzstyle{VertexStyle} = [shape = ...
5
votes
3answers
110 views

Colorize sides regular polygon

To illustrate what edge-coloring is, I'd like to colorize a regular polygon. I want to generate the shape using TikZ, then colorize the sides (edges) of the polygon separately, for instance by doing ...
2
votes
2answers
56 views

visually distinguish right and left children

I'm using the qtree package to render small inline trees in my document. The tree nodes in my case are limited to 0 or 2 child nodes. I'd like to visually distinguish the right and left branches ...
1
vote
1answer
27 views

How to typeset path from vertex to vertex in math mode?

I'd like to typeset a path from a vertex to another vertex similar to this: The examples I've found either use TikZ or does not look right. Is there a way to typeset a path identically to how it's ...
5
votes
1answer
57 views

TikZ - Edges not positioned properly when using \foreach loop

I want to draw a graph like this: Which I can do well enough with the following code: \node[circle,draw] (v) at (0,0) {$v$}; \foreach \i in {1,...,6}{ \node[circle,draw] (u_\i) at (180 - 360/6 * ...
2
votes
4answers
210 views

How can I make a curved graph in Tikz and vertical lines from the x-axis to that graph?

I am basically trying to make this figure in Tikz only better, but I can't figure out how to make the vertical lines from the x-axis to the graphs M(x). The function is M(x)=−1/2·q·x^2+1/2·q·L·x, ...
2
votes
1answer
38 views

How to fix a slanted axis in Tikz

I have attempted to create a limacon with the equation r= 0.5 + cos(theta). \begin{document} \begin{figure}[h!] \centering \begin{tikzpicture} [xscale=3, yscale=3, domain=0:2*pi] \...
2
votes
1answer
46 views

Tikz graph with citations

I am trying to create a graph whose nodes are some author-year citation from the bibliography. This question is very similar to this post but, unfortunately, the answers provided suggest using the ...
3
votes
2answers
112 views

I'm trying to graph a rational function in tikz [duplicate]

I'm attempting to graph the function y=[(x-2)(x+2)]/[(x-3)(x+3)]. However, I get bizarre output, which consists of straight lines. Any idea what's wrong? Thanks! \documentclass{article} \...
2
votes
1answer
89 views

How do I graph $f(x)=x\cdot \sin \frac{1}{x}$?

I am trying to use the following thread, but whatever changes that I make lead to either an error or just a regular line being formed instead of the graph: How to plot the function f(x) = sin(1/x) ...
1
vote
0answers
28 views

TikZ graphdrawing library in ConTeXt throws error [duplicate]

Consider the following example: \usemodule[tikz] \usetikzlibrary[graphs,graphdrawing] \starttext \starttikzpicture \graph { A -> B }; \stoptikzpicture \stoptext While it works in ...
6
votes
1answer
184 views

Drawing Hypergraph using TikZ

I want to draw a Hypergraph using TikZ that looks like this What I have so far: \usepackage{tikz} \usetikzlibrary{calc, positioning, fit, shapes.misc} \begin{document} \begin{tikzpicture} [ he/....
1
vote
1answer
95 views

How can I rotate this rectangle 90 degrees?

How are members of the page. I'm trying to make this homotopy diagram. I'm trying to rotate the rectangle that appears in the image 90 degrees. How could I do this in the code. Thank you. This is the ...