61 votes
Accepted

How to Make a Sankey Diagram

Here's the start of a SankeyDiagram function: ...
Carl Woll's user avatar
  • 130k
42 votes
Accepted

How to divide the wine into two equal portions?

How about: ...
Simon Woods's user avatar
  • 84.9k
35 votes

How can I use the Python library networkx from Mathematica?

Mathematica 12.0 brings two new features that make this easier to do than it was before: ExternalFunction Wolfram Client for Python Below we implement a function <...
Szabolcs's user avatar
  • 234k
33 votes

How can we produce a graph layout with hierarchical edge bundling in Mathematica?

Update: I wrapped all this up into a small package for those who don't want to go through all the steps but would like to try this out anyway. Warning: There's not a lot of error checking and it may ...
Szabolcs's user avatar
  • 234k
32 votes
Accepted

Reconstruct a graph from an image (curved edges and edge crossings)

Without claiming much generality, I made the following. I'm using a slightly more complex image than your proposed one. ...
Dr. belisarius's user avatar
32 votes
Accepted

Visualize an irrational number

With a pie chart around it: ...
halmir's user avatar
  • 15k
32 votes
Accepted

How can I make a graph network from image of granular packing?

Another starting point, where the objects being more or less fixed size disks is used ad hoc to measure their centroids as components after some mangling, and those which are close enough to each ...
kirma's user avatar
  • 19k
30 votes
Accepted

Zoom in on a 2D graph

You can do this using Show and PlotRange which can be used in combination with graphs. To determine the full ...
Sjoerd C. de Vries's user avatar
30 votes

Zoom in on a 2D graph

This is a prototype, it can not handle Text Inset and some more complicated directives efficiently but I don't have time / ...
Kuba's user avatar
  • 137k
30 votes

Elegant implementation of factorial tree graph

Update 3: ExpressionGraph is now available in version 12.1. Update 2: a more streamlined version for 2D graphs: ...
kglr's user avatar
  • 392k
30 votes
Accepted

How to create Diagrams using Wolfram / Mathematica?

...
kglr's user avatar
  • 392k
29 votes

Visualize an irrational number

With help of: (1) how to generate repeatable Unique streams? (2) Color Blend in BezierCurve (3) Is it possible to draw really thin lines in Mathematica? here is something to start: ...
Kuba's user avatar
  • 137k
27 votes
Accepted

Coneheads instead of Arrowheads

How about: ...
Lukas Lang's user avatar
  • 33.6k
27 votes
Accepted

How to build a neighbor table for the Hexagonal lattice

I will take this opportunity to showcase the abilities of IGraph/M for lattice generation and mesh / graph / matrix conversions. IGraph/M thrives on user feedback, so if you find it useful, please ...
Szabolcs's user avatar
  • 234k
23 votes
Accepted

Cone Trees: map a graph onto geometric shape

To lay out a graph on a cone, you start by laying it out in a circular way. Then you add an appropriate "z coordinate" to each node position, proportionally to its distance form the centre. This is ...
Szabolcs's user avatar
  • 234k
23 votes

Framework behind Graph plots. DynamicNamespace and friends

# post under construction but feel free to add anything # undocumented feature # based on observation so it may be wrong TODO: This post does not cover few things yet, among others: how to ...
Kuba's user avatar
  • 137k
23 votes
Accepted

How to generate all Feynman diagrams with Mathematica?

Here is a piece of code that is inspired by quantum field theory. The physics background can be found in this physics.SE post. First, we define some auxiliary functions: ...
AccidentalFourierTransform's user avatar
23 votes

Elegant implementation of factorial tree graph

IGraph/M already has this built-in as IGSymmetricTree. You can specify the number of branches at each level. ...
Szabolcs's user avatar
  • 234k
23 votes
Accepted

Elegant implementation of factorial tree graph

here is my elegant implementation ...
ZaMoC's user avatar
  • 6,657
23 votes
Accepted

Creating graph out of particles images

Here is one approach. See the section at the bottom about a few comments on how I chose the most important image processing parameters. We start with your binarized image: ...
Lukas Lang's user avatar
  • 33.6k
23 votes
Accepted

Making a graph or network interactively over an image

There are many ways to do this, modifying, improving my method or doing a completely different thing. My goal here is to show a very basic idea that should give you a start. ...
Vitaliy Kaurov's user avatar
22 votes
Accepted

How to generate a Graph from a picture of a graph?

...
Dr. belisarius's user avatar
22 votes
Accepted

GeoGraphics : path within a country

Here is a solution I can think of. Idea is to take the FullPolygon of a given country and then triangulate the region. Once that is done take the underlying ...
PlatoManiac's user avatar
  • 14.7k
21 votes

Converting a Sierpinski tetrahedron to a Graph

A natural and simple way to approach this problem, assuming that your SiPyramid function has been defined, is as follows: ...
Mark McClure's user avatar
  • 32.4k
21 votes
Accepted

How to work with phylogenetic trees?

Download the Phylogenetics` package here: Phylogenetics on GitHub (direct link to latest release: source zip), available on PackageData.net here. Documentation: notebook / pdf / dark themed pdf (for ...
István Zachar's user avatar
21 votes

Cluster graph of bordered countries?

France and Germany ...
Greg Hurst's user avatar
  • 35.9k
21 votes
Accepted

How to visualize a Cayley graph in this style?

The simple way: g = CayleyGraph[ PermutationGroup[{Cycles[{{1, 2, 3}}], Cycles[{{1, 5}, {2, 4}}]}]] ...
Szabolcs's user avatar
  • 234k
21 votes

Visualizing Cayley's Formula in Mathematica

You can use Prüfer sequences to generate all labelled trees. IGraph/M has the required functionality. ...
Szabolcs's user avatar
  • 234k
21 votes
Accepted

Is it possible to extract vertices and lines from this image?

g = IndexGraph[ MorphologicalGraph[ Thinning[ColorNegate[Binarize[pic]], Method -> "MedialAxis"]]] Then you can merge vertices that are close ...
halmir's user avatar
  • 15k
20 votes

House of Santa Claus

This is of course the Chinese postman problem, which is solved by the function FindPostmanTour[]. First, represent the edges of the directed graph: ...
J. M.'s eventual burnout's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible