Questions tagged [graphs]
Graphs are (1) graphs of functions or (2) sets of nodes and edges.
221
questions
20
votes
2
answers
31k
views
How to draw Bar & Pie Chart
I'm want to include two graphs mentioned below in a document.
I'm able to draw pie charts using pgf-pie. Is there any package which is capable of generating BAR & PIE Chart both? [Also which is ...
43
votes
2
answers
12k
views
What is the clearest way to graph a piecewise function?
I have a function defined as:
How can I graph that using functions instead of coordinates? I'm currently working with pgfplots but I'm open to something else if it's better.
16
votes
4
answers
8k
views
How to plot a graph from its adjacency matrix and coordinates of vertices?
A similar question is here. If we give all the data of the vertices's coordinates and the graph's adjacency matrix, how to plot it with tikz, pstrick or other tool in tex?
here are the data of ...
11
votes
5
answers
21k
views
Bipartite graphs
I want to draw something similar to this in latex. How can I do it? I want it to be a directed graph and want to be able to label the vertices.
28
votes
2
answers
34k
views
Typesetting a directed, weighted graph with TikZ
I just started doing things with TikZ today and I run into a problem: there is just no example code snippets for typesetting directed, weighted graphs. Can anyone supply one simple example in an ...
11
votes
2
answers
15k
views
2D and 3D vectors in Tikz
I would like to draw some 2D and 3D vectors in Tikz with certain properties. The following primitive graph sums what I desire:
I just need the first quadrant of the Cartesian coordinate system for my ...
60
votes
4
answers
22k
views
How do I develop a complex time line?
I currently have a resume I've made in Illustrator with a time line of my work with academics on the lower part and jobs on the upper section:
The trouble with it being in Illustrator of course, is ...
8
votes
6
answers
3k
views
By which pkg to visualize a hypercube graph?
I am trying to visualise hypercube like the below. I have asked help here but getting nodes on top of each other with the packages there. The N-th hypercube has 2^n nodes and each vertex with the ...
4
votes
1
answer
4k
views
How to draw adjacency array with TikZ?
I will draw a graph representation as adjacency array, also something like that:
How to make it? I didn't found any examples like the picture above.
53
votes
3
answers
98k
views
Drawing graphs in LaTeX
Is it possible to draw graphs like in image below in LaTeX?
It doesn't have to look exactly the same. I need arrows with numbers and circles (or dots or other symbol) with text in it (or next to it).
49
votes
1
answer
122k
views
Draw a graph in Latex with Tikz
I am interested in outputting this graph in latex using tikz:
So far I got this:
and my tikz code is
\begin{tikzpicture}
\node[shape=circle,draw=black] (A) at (0,0) {A};
\node[shape=...
37
votes
3
answers
11k
views
Drawing a hypergraph
What is the proper way to draw a hypergraph? Is there a package to do this, or is there an easy way to draw such diagrams with a common drawing method like tikz?
I'm trying to draw something like
24
votes
1
answer
8k
views
TikZ - Two Colored Circle Split
I need to draw a two-colored circle split, exactly as is specified in the section 39.6 of the manual for rectangle splits, meaning that one half of the circle split has one fill color and the other ...
23
votes
2
answers
6k
views
Generating dozens of graphs
I am revising old lecture notes on microeconomics and they contain a lot of graphs. As I am rewriting it in LaTeX, I would like to recreate the old graphs, but I need to select the right tool for the ...
17
votes
1
answer
5k
views
Package for drawing RDF graphs
Is there some package to draw nice RDF
graphs, such as the one below (taken from there)?
Can such a graph (with the same style) be produced in TikZ?
42
votes
6
answers
31k
views
Use Graphviz within *TeX
I am trying to generate a a graph with dot/graphviz. Is it possible to include it within *TeX and be compiled at *TeX compile time?
I've read about TikZ, but it's not the same syntax, is it possible ...
39
votes
3
answers
61k
views
tikzpicture: How can I draw a loop right-below?
\begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=4cm,
thick,main node/.style={circle,draw,font=\Large\bfseries}]
\node[main node] (1) {1};
\node[main ...
28
votes
2
answers
3k
views
Why does PGF/TikZ 3.0 draw my simple layered graph as non-planar by default?
I have two questions:
If I’m reading §30.4 “Crossing Minimization” of the PGF/TikZ 3.0 manual correctly, the layered graph drawing algorithm should have crossing minimization enabled by default. So ...
27
votes
5
answers
84k
views
Is it possible to put MS Excel graphs into a LaTeX document?
I will be using Microsoft Excel to produce graphs and I was wondering if there was a simple way to put those graphs into a LaTeX document?
26
votes
2
answers
34k
views
Basic bar chart with text as x axis labels
I am trying to create a very basic bar chart using pgfplots. I need four bars representing percentages with text as labels under the x axis. Text labels contain spaces and accented, non-English ...
12
votes
1
answer
5k
views
How to create a gaussian curve with pgfplot?
What I want:
This is what I have so far in terms of code:
\newcommand\gauss[2]{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}
% Gauss function, parameters mu and sigma
\begin{tikzpicture}
\begin{...
11
votes
1
answer
7k
views
How to automatically draw a graph?
Is there a simple package for which I can input an abstract graph and it returns a drawing?
A similar question was asked in 2010, it did not receive any answers relevant to my question.
I want no ...
10
votes
3
answers
8k
views
Petersen graph with new tikz graph library
I'm considering moving from tkz-berge to the new tikz graph library
for drawing my graphs (in the sense of graph theory). I have produced
the Petersen graph, but is there is a more elegant way of
...
9
votes
7
answers
3k
views
Simplest way to create a grid with colored squares and labels
I am trying to create a grid with colored squares, multi-line labels within the squares, and labels on the axes. Is there a simple and easy way to achieve this?
This question is the closest I could ...
9
votes
3
answers
3k
views
Multiple graphs in TikZ with intersections and naming
I'd appreciate some help creating the above diagram. I have had some success but still struggling with the naming of the graphs (not in an agenda), the intersections as well as the marking of the ...
7
votes
3
answers
2k
views
Numbering nodes in a for loop
I've just started using TikZ to make basic graphs, and I'm trying to reproduce the Petersen graph. I've managed to make it without using for loops, but this obviously isn't a great method for bigger ...
7
votes
3
answers
1k
views
How to add connected graphs to a table?
We have already seen how to create connected graphs with nodes:
Easiest way to create simple connected graphs?
Where Ross, Bernard and Michael Palmer offered very good answers.
My question is now ...
6
votes
2
answers
2k
views
Wavy arrows in xy-pic
What method should I use, to draw beautiful wavy arrows.
So far I tried the following.
I use xy-pic package, there I use @{~>} definition for the arrow.
The code I've composed is like this:
\...
6
votes
1
answer
24k
views
Graph into graph with arrows
I'm using tikzpicture and I have some graphs, but I want some graphs with arrows. Is there any simple syntax change for that?
My Graph:
\begin{tikzpicture}[thick]
\begin{scope}
\...
5
votes
0
answers
2k
views
Flip x and y axis of ternary graph
I am trying to reproduce the USDA Soil Triangle. To do so, I would need to flip the x and y axis of the default pgfplots-ternary.
I understand, that I could switch my inputs (don't really want to do ...
5
votes
1
answer
3k
views
How to create interactive 3D graph using latex
About two years ago, I saw an interactive 3D graph online in this forum made by latex maybe using pgfplots. Basically, a user could use mouse to drag (or slide through) the pdf graph to change the ...
4
votes
3
answers
29k
views
Problem with \includegraphics - file not found!
I am trying to include a graph in a tex document.
I do realize that there have already been several questions asked about this topic, but I think by now I have tried all suggested solutions but none ...
2
votes
1
answer
2k
views
pgfplots very small Y values
I need to plot the following function: http://www.wolframalpha.com/input/?i=sqrt%281%2Bx%2F5%29+-+%280.997475+%2B0.1+x-0.00499923+x%5E2%2B0.000499811+x%5E3-0.0000645293+x%5E4%2B9.12394x10%5E-6+x%5E5%...
1
vote
1
answer
2k
views
Drawing bipartite graph
I want to draw graphs with white and black vertices, such as square-octagon graph. Someone knows the easy way to draw in Latex? Thanks a lot!
1
vote
2
answers
289
views
Plot construction for a velocity vs position graph. Interpolation for phase-diagram construction?
I need to plot a few graphs. First is of the function
\begin{equation}
x(t)= -e^{ -(0.1 \ {s}^{-1}) t} \cos \left( ( 0.995 \ {rad} / \mathrm{s})t \right)
\end{equation}
and of $\dot{x}$ (...
42
votes
3
answers
6k
views
How can I produce the history graph of a Git repository in LaTeX?
Is there a relatively simple way to produce the history graph of a git repository in LaTeX? I'm looking for something nicer-looking than the verbatim output of
git log --graph --oneline
25
votes
4
answers
9k
views
How can I display an array (as in the data structure from Computer Science, not the mathematical version) in LaTeX?
I'm finding this extraordinarily difficult to search for, as the mathematical meaning of "array" is much more common in LaTeX documentation. I essentially want a single row of boxes, into which I can ...
18
votes
4
answers
4k
views
Which LaTeX package is needed to draw radar-like diagrams?
Can you please suggest some LaTeX package of drawing charts in the format mentioned below?
It should offer the possibility to put text as "Text A" as well as "Text B" .
Note: Currently I'm using ...
17
votes
2
answers
2k
views
Use "layered layout" with user-specified node ordering (i.e., without crossing minimization)
If and when someone answers this question in a way that demonstrates lua programming for TikZ graph algorithms, I will guarantee a 500-point bounty to that person.
According to the PGF 3.0 manual, ...
14
votes
2
answers
3k
views
TikZ - Four Colored Circle Split
Following @Alain Matthes's reply on this question, wa can get a picture like this:
I am not good enough to adapt the code to split the circle into 4 quarters. Can you help me?
\documentclass[11pt]{...
14
votes
1
answer
2k
views
How to plot integral as summation, as pictured?
I'm new to TikZ and pgfplots but would like to know how to plot the square as well as how to plot the arrows + delta x as well as arrow + delta A:
I'd be most grateful if some of you had some ...
13
votes
3
answers
3k
views
Drawing a tree of grids
I need to draw a game tree that is similar to the image below. Is there any way to do this using the Tikz package so that the grids can simply be added as nodes?
11
votes
3
answers
15k
views
How do I change the aspect ratio of gnuplot output?
How do I change the aspect ratio of the canvas of a gnuplot plot in LaTeX using the gnuplottex package?
The following changes the aspect ratio of the output but not the canvas size, thus leaving a ...
11
votes
1
answer
738
views
(ConTeXt MkIV) Text in PiechartMP
So I need to include some pie charts in my document. As I'm using Metapost for all graphics I tried using the PiechartMP Metapost package. But for some strange reason no text shows up, just a very ...
11
votes
1
answer
5k
views
Creating a timeline
I am working on my thesis and need to create a timeline similar to this:
I tried Chronosys package but am not sure if this is a good choice.
\documentclass{article}
\usepackage{chronosys}
\begin{...
11
votes
1
answer
2k
views
How to plot a graph from its adjacency matrix (coordinates manually specified)? [duplicate]
For example, I want to plot a graph whose adjacency matrix is [0,1,0;1,0,1;0,1,0]. I first plot three points labeled by p1,p2,p3, and link the points p1,p2, p2,p3. For a general case, how to link the ...
10
votes
3
answers
2k
views
How can I produce such a graph of my piecewise function?
I am writing my thesis in behavioural economics and have to draw individual discount functions, I did the following graph with stata, but would love to have it with tikz.
I played around in tikz and ...
8
votes
1
answer
4k
views
How do you make a tkz graph with edges starting and ending at the same vertex?
I am trying to use the tkz-graph package to put together a directed graph. I have never used it before, so I am trying to piece together examples I have found on the internet. Below is the code that I ...
8
votes
1
answer
273
views
Why is this edge not straight when using subgraphs in layered layout?
The MWE below produces a simple graph. When I add the two upper nodes A1 and B1 to a subgraph the horizontal alignment is lost which is understandable, since the nodes in the subgraph are positioned ...
8
votes
1
answer
1k
views
PGFPlots - Fill area between two curves
Three days ago I posted a question on Stack Exchange on how to fill the area between two curves (see question). It is my goal to have the fill area of two curves color differently based on when one is ...