# How to produce this type of graph?

**URL:** <https://discourse.julialang.org/t/how-to-produce-this-type-of-graph/68955>\
**Category:** Visualization\
**Tags:** question, plotting\
**Created:** [September 29, 2021, 6:04pm UTC](https://discourse.julialang.org/t/how-to-produce-this-type-of-graph/68955 "2021-09-29T18:04:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jo-fleck](https://avatars.discourse-cdn.com/v4/letter/j/59ef9b/32.png) [@jo-fleck](https://discourse.julialang.org/u/jo-fleck)\
**Post date:** [September 29, 2021, 6:04pm UTC](https://discourse.julialang.org/t/how-to-produce-this-type-of-graph/68955/1 "2021-09-29T18:04:42Z")

</div>

I would like to compare three measures which characterize each of the US states.

They are measured on three different scales so I am thinking to illustrate the relative ranking of states.

I have seen this graph and it seems to me it could be a suitable template.

![world-education-rankings-guardian-visualization](https://global.discourse-cdn.com/julialang/original/3X/9/8/98bf7811146cdec252b727162716a355955f7d25.png)

[Source](https://chandoo.org/wp/world-education-rankings-visualization/)

What’s the best plotting environment to produce a figure like this? (My start would be Plots.jl with many overlays… but I suspect this will become very cumbersome.)

Thanks for hints and advice!

---

<div class="post-metadata">

**Author:** ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Post date:** [September 29, 2021, 6:16pm UTC](https://discourse.julialang.org/t/how-to-produce-this-type-of-graph/68955/2 "2021-09-29T18:16:47Z")

</div>

I can’t think of any way to do this in Julia. But sometimes these are called “alluvia diagrams”, which may help googling.

---

<div class="post-metadata">

**Author:** ![jzr](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jzr](https://discourse.julialang.org/u/jzr)\
**Post date:** [September 29, 2021, 6:18pm UTC](https://discourse.julialang.org/t/how-to-produce-this-type-of-graph/68955/3 "2021-09-29T18:18:30Z")

</div>

This is basically a line plot, so you can probably use the line plot functions. The main difference is the angled bits like

![image](https://global.discourse-cdn.com/julialang/original/3X/a/0/a0043f30a4af06627ed999b95f96e4ab804ecf9b.png)

---

<div class="post-metadata">

**Author:** ![jo-fleck](https://avatars.discourse-cdn.com/v4/letter/j/59ef9b/32.png) [@jo-fleck](https://discourse.julialang.org/u/jo-fleck)\
**Post date:** [September 30, 2021, 2:13am UTC](https://discourse.julialang.org/t/how-to-produce-this-type-of-graph/68955/4 "2021-09-30T02:13:54Z")

</div>

Thanks! I guess I’ll give it a try without the angled lines as a start.

---

<div class="post-metadata">

**Author:** ![empet](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/empet/32/221303_2.png) [@empet](https://discourse.julialang.org/u/empet)\
**Post date:** [September 30, 2021, 7:51am UTC](https://discourse.julialang.org/t/how-to-produce-this-type-of-graph/68955/5 "2021-09-30T07:51:22Z")

</div>

Such a chart type can be drawn as a graph. The dots are nodes and conections are graph edges. You can use `LightGraphs.jl`:

```julia
G= SimpleDiDraph(N) # N is the total number of nodes

```

Then set up the vector of edges, E, as a `Vector{Tuple{Int64, Int64}}`  
and add each edge to the graph G:

```julia
for e in E
    add_edge!(G, e[1], e[2])
end

```

In the case of the posted plot there are three groups of nodes, each group with the same x-coordinate for node position and y of the form `y = a:step:b`.  
Then define the entire graph node position as a `Vector{GeometryBasics.Point2{Float64}}`  
and plot the graph using one the packages listed here: [https://juliagraphs.org/LightGraphs.jl/latest/plotting/](https://juliagraphs.org/LightGraphs.jl/latest/plotting/).

---

<div class="post-metadata">

**Author:** ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Post date:** [September 30, 2021, 8:37am UTC](https://discourse.julialang.org/t/how-to-produce-this-type-of-graph/68955/6 "2021-09-30T08:37:03Z")

</div>

I find that chart a bit misleading 🙂  
(here the full chart: [World education rankings: which country does best at reading, maths and science? | News | theguardian.com](https://www.theguardian.com/news/datablog/2010/dec/07/world-education-rankings-maths-science-reading))

The problem is that there isn’t a global average ranking considering all the subjects, but still the countries are ranked on the column with the name. But that is a _specific_ ranking, only for the entry “Reading”. They should have instead made an average ranking, indicated the coutries based on that averaged ranking, and then added the individual categories. Like this the “Reading” voice has a disproportional visual importance.

---

<div class="post-metadata">

**Author:** ![Jakob](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@Jakob](https://discourse.julialang.org/u/Jakob)\
**Post date:** [September 30, 2021, 10:08am UTC](https://discourse.julialang.org/t/how-to-produce-this-type-of-graph/68955/7 "2021-09-30T10:08:22Z")

</div>

If you code the data as a graph maybe [GraphMakie.jl](https://github.com/JuliaPlots/GraphMakie.jl) might be interesting. I think it has curved edges which might look nice and has all the customizability of Makie behind it.
