Engaging plots, made easy.

Easily turn your data into engaging visualizations. Powerful API for coders. Powerful app for everyone.

main.py
notebook.ipynb
main.rs
from plotapi import Chord

Chord(matrix, names).show()

Visualizations Showcase

Degree Classification by Graduate Gender with Terminus

In this notebook we're going to use PlotAPI Terminus to visualise how degree classes vary by graduates' gender. We"ll use Python, but PlotAPI can be used from any programming language.


Preamble

from plotapi import Terminus
import json

Introduction

In this notebook we're going to use PlotAPI Terminus to visualise how degree classes vary by graduates' gender. We"ll use Python, but PlotAPI can be used from any programming language.

In the Terminus diagram (a type of flow diagram), we can watch the journey of something or someone from some starting category to some ending category. In this case, we'll be watching each unit travel from a graduate's gender to their awarded degree classification.

Dataset

We're going to use data that has been published by the Higher Education Statistics Agency (HESA) in the UK. The data table is titled "UK domiciled first degree qualifiers by classification of first degree, religious belief, sex, age group, disability marker, ethnicity marker, mode of study and academic year" and it can be found at this link.

We will use data from all countries, all modes of study, and from the academic year 2019/20. "Other" was not included due to a small sample size..

The degree class is the result achieved by a student UK, similar to a Grade Point Average (GPA). You can find a mapping between UK degree classifications and GPA here

data = [
    {"source": "Female", "target": "First class", "value": 68190},
    {"source": "Female", "target": "Second class (upper)", "value": 90935},
    {"source": "Female", "target": "Second class (lower)", "value": 25700},
    {"source": "Female", "target": "Third class", "value": 4940},
    {"source": "Female", "target": "Unclassified", "value": 10660},
    
    {"source": "Male", "target": "First class", "value": 47175},
    {"source": "Male", "target": "Second class (upper)", "value": 63870},
    {"source": "Male", "target": "Second class (lower)", "value": 21455},
    {"source": "Male", "target": "Third class", "value": 4350},
    {"source": "Male", "target": "Unclassified", "value": 6860}
]

Visualisation

Let's use PlotAPI Terminus for this visualisation, you can see more examples in the Gallery.

We're going to adjust some layout and template parameters. We're setting pixels_per_unit=40 to represent 40 graduates with a single pixel. This effects the length of the animation, making it shorter than the default of setting.

plot = Terminus(
    data,
    bundled=True,
    pipe_alignment="middle",
    pixel_size=4,
    pixels_per_unit=40,
    title="Watch <plotapi_count> graduate's collect their degree",
)

Display inline

plot

Upload to cloud

With our plot created, let's upload it to PlotAPI cloud and get a shareable link.

plot.upload(
    name="Degree Classification By Graduate Gender",
    description="""We're going to use PlotAPI Terminus to visualise how degree classes vary by graduates' gender. We're going to use data that has been published by the Higher Education Statistics Agency (HESA) in the UK. The data table is titled "UK domiciled first degree qualifiers by classification of first degree, religious belief, sex, age group, disability marker, ethnicity marker, mode of study and academic year".""",
    public=True,
)
Your visualization has been uploaded successfully! You can view and share it at https://plotapi.com/explore/view/a023eb0f-e11d-4c02-bc67-c226e13c7f25.
Previous
Showcase