clock_plot provides a simple way to visualize timeseries data, mapping 24 hours onto the 360 degrees of a polar plot

Overview

clock_plot

clock_plot provides a simple way to visualize timeseries data mapping 24 hours onto the 360 degrees of a polar plot. For usage, please see the examples.ipynb Jupyter notebook

seasonal gas usage clock plot

Installation

To install this package run: pip install clock_plot

Available features

Time features are automatically generated for your timeseries. These features include:

Feature Type Description Example Values
year int Calendar year 2022
month str Calendar month "January"
year_month int Calendar year and month in the format YYYYMM 202201
day int Day of calendar year 25
date str Expressed in the format YYYY-MM-DD "2022-01-25"
week int ISO week of the calendar year 5
dayofweek str Short version of day of week "Tue"
weekend str Either "weekday" or "weekend", where "weekend" is Saturday and Sunday "weekend" (Sat/Sun)
"weekday" (Mon-Fri)
hour int Hour of the day in 24 clock 14
minute int Minute of the hour 42
degrees int Angle around 24 hour clock-face measured in degrees 341
season str Season of the year defined based on month, with Winter being Dec-Feb "Winter" (Dec-Feb)
"Spring" (Mar-May)
"Summer" (Jun-Aug)
"Autumn" (Sep-Nov)

These can be used to filter your data and format your plot.

For example you could filter for a particular year, plot seasons with different colors and weekday vs weekend days with different line dashes. Examples of this are given in examples.ipynb

When should you use these plots?

Radar/polar plots (of which clock plots are a special case) are much maligned by visualisation experts, and for good reason. Whilst some of the common limitations are overcome with clock plots, two key ones remain:

  1. It is harder to read quantitative values than on a linear axis
  2. Areas scale quadratically (with the square of the value) rather than linearly, which can lead to overestimation of differences

Clock plots are therefore most suited for cases where understanding absolute values is less important and one or more of the following is true:

  • behaviour around midnight is particularly important
  • there are a 2-3 daily peaks and understanding at a glance when those are occurring is more important than their exact magnitude
  • you want a distinctive, eye-catching graphic to engage people with your work

Note that they are particularly poorly suited to:

  • timeseries with negative values (the radial axis becomes very unintuitive)
  • timeseries with little within day variation (you just get circles!)

If you're not sure which is best for a particular use case, you can quickly toggle between a clock plot and a linear plot by adding mode="line" to your clock_plot call.

You might also like...
Plot, scatter plots and histograms in the terminal using braille dots
Plot, scatter plots and histograms in the terminal using braille dots

Plot, scatter plots and histograms in the terminal using braille dots, with (almost) no dependancies. Plot with color or make complex figures - similar to a very small sibling to matplotlib. Or use the canvas to plot dots and lines yourself.

Streamlit component for Let's-Plot visualization library
Streamlit component for Let's-Plot visualization library

streamlit-letsplot This is a work-in-progress, providing a convenience function to plot charts from the Lets-Plot visualization library. Example usage

a python function to plot a geopandas dataframe
a python function to plot a geopandas dataframe

Pretty GeoDataFrame A minimum python function (~60 lines) to draw pretty geodataframe. Based on matplotlib, shapely, descartes. Installation just use

Small project to recursively calculate and plot each successive order of the Hilbert Curve
Small project to recursively calculate and plot each successive order of the Hilbert Curve

hilbert-curve Small project to recursively calculate and plot each successive order of the Hilbert Curve. After watching 3Blue1Brown's video on Hilber

Info for The Great DataTas plot-a-thon
Info for The Great DataTas plot-a-thon

The Great DataTas plot-a-thon Datatas is organising a Data Visualisation competition: The Great DataTas plot-a-thon We will be using Tidy Tuesday data

It's an application to calculate I from v and r. It can also plot a graph between V vs I.
It's an application to calculate I from v and r. It can also plot a graph between V vs I.

Ohm-s-Law-Visualizer It's an application to calculate I from v and r using Ohm's Law. It can also plot a graph between V vs I. Story I'm doing my Unde

Plot and save the ground truth  and predicted results of human 3.6 M and CMU mocap dataset.
Plot and save the ground truth and predicted results of human 3.6 M and CMU mocap dataset.

Visualization-of-Human3.6M-Dataset Plot and save the ground truth and predicted results of human 3.6 M and CMU mocap dataset. human-motion-prediction

Plot-configurations for scientific publications, purely based on matplotlib

TUEplots Plot-configurations for scientific publications, purely based on matplotlib. Usage Please have a look at the examples in the example/ directo

A tool to plot and execute Rossmos's Formula, that helps to catch serial criminals using mathematics
A tool to plot and execute Rossmos's Formula, that helps to catch serial criminals using mathematics

Rossmo Plotter A tool to plot and execute Rossmos's Formula using python, that helps to catch serial criminals using mathematics Author: Amlan Saha Ku

Comments
Releases(v0.2.1)
Owner
null
A simple python script using Numpy and Matplotlib library to plot a Mohr's Circle when given a two-dimensional state of stress.

Mohr's Circle Calculator This is a really small personal project done for Department of Civil Engineering, Delhi Technological University (formerly, D

Agyeya Mishra 0 Jul 17, 2021
Function Plotter: a simple application with GUI to plot mathematical functions

Function-Plotter Function Plotter is a simple application with GUI to plot mathe

Mohamed Nabawe 4 Jan 3, 2022
Simple function to plot multiple barplots in the same figure.

Simple function to plot multiple barplots in the same figure. Supports padding and custom color.

Matthias Jakobs 2 Feb 21, 2022
Plot toolbox based on Matplotlib, simple and elegant.

Elegant-Plot Plot toolbox based on Matplotlib, simple and elegant. 绘制效果 绘制过程 数据准备 每种图标类型的目录下有data.csv文件,依据样例数据填入自己的数据。

null 3 Jul 15, 2022
Getting started with Python, Dash and Plot.ly for the Data Dashboards team

data_dashboards Getting started with Python, Dash and Plot.ly for the Data Dashboards team Getting started MacOS users: # Install the pyenv version ma

Department for Levelling Up, Housing and Communities 1 Nov 8, 2021
A custom qq-plot for two sample data comparision

QQ-Plot 2 Sample Just a gist to include the custom code to draw a qq-plot in python when dealing with a "two sample problem". This means when u try to

null 1 Dec 20, 2021
Displaying plot of death rates from past years in Poland. Data source from these years is in readme

Average-Death-Rate Displaying plot of death rates from past years in Poland The goal collect the data from a CSV file count the ADR (Average Death Rat

Oliwier Szymański 0 Sep 12, 2021
python partial dependence plot toolbox

PDPbox python partial dependence plot toolbox Motivation This repository is inspired by ICEbox. The goal is to visualize the impact of certain feature

Li Jiangchun 723 Jan 7, 2023
python partial dependence plot toolbox

PDPbox python partial dependence plot toolbox Motivation This repository is inspired by ICEbox. The goal is to visualize the impact of certain feature

Li Jiangchun 531 Feb 16, 2021
basemap - Plot on map projections (with coastlines and political boundaries) using matplotlib.

Basemap Plot on map projections (with coastlines and political boundaries) using matplotlib. ⚠️ Warning: this package is being deprecated in favour of

Matplotlib Developers 706 Dec 28, 2022