How to produce this type of graph?

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

Source

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!

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

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

image

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

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

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:

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/.

I find that chart a bit misleading :slight_smile:
(here the full chart: World education rankings: which country does best at reading, maths and science? | News | theguardian.com)

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.

If you code the data as a graph maybe GraphMakie.jl might be interesting. I think it has curved edges which might look nice and has all the customizability of Makie behind it.

1 Like