Get the Books

Enjoying these notebooks and want to support the work? Check out the practical books on Data Science, Visualisation, and Evolutionary Algorithms.

Get the books

Total Global Email & Spam with Plotapi Terminus

Support this work

You can support this work by getting the e-books. This notebook will always be available for free in its online format.

Preamble

In [1]:
from plotapi import Terminus
import json

Terminus.set_license("your username", "your license key")

Introduction

In this notebook we're going to use Plotapi Terminus to visualise the average daily email & spam volume for August 2021.

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 emails travel from their classification (legitimate or spam) to their recipients represented by a single inbox.

There is no doubt that this data would be better communicated with a bar or pie chart. This is a fun exercise.

Dataset

We're going to use the Email & Spam data published by Talos Intelligence over at this page. The numbers we're interested in are under the heading TOTAL GLOBAL EMAIL & SPAM VOLUME FOR AUGUST 2021, labelled with Average Daily Legitimate Email Volume and Average Daily Spam Volume.

In [2]:
data = [
    {"source": "Legitimate", "target": "Inboxes", "value": 12.30*(10**9)}, 
    {"source": "Spam", "target": "Inboxes", "value": 65.50*(10**9)},
]

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=10**7 to represent $10$ million emails with a single pixel. This effects the length of the animation, making it shorter than the default of setting.

In [3]:
Terminus(data, colors=['#56c885','#ea647e'],
         title="Watch <plotapi_count> emails sent during an Aug-2021 day",
         vertical=True,  width=400, pipe_alignment="middle", 
         pixels_per_unit=10**7).show()

Support this work

You can support this work by getting the e-books. This notebook will always be available for free in its online format.

Plotapi, beautiful by default.

Let plotapi do the heavy lifting – enabling beautiful interactive visualisations with a single line of code (instead of hundreds).

Get Plotapi