This package provides a simple way to visualize patterns in timeseries data mapping 24 hours onto a polar plot
Project description
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
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:
- It is harder to read quantitative values than on a linear axis
- 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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file clock_plot-0.2.1.tar.gz
.
File metadata
- Download URL: clock_plot-0.2.1.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ee95b60b5e4d90c1554e666d72f83be5a85579ae0dc2b0e15096c7319ed89e0 |
|
MD5 | c9c80923d84075e94e1d28e14b012f08 |
|
BLAKE2b-256 | 14658c435af7b92d9a4a58d52c8c405c0d37ee0ea4eef8cb83b6c675c7b2b3c0 |
File details
Details for the file clock_plot-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: clock_plot-0.2.1-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ac4021dc3fa5ce9b92245260ca639d80b9f7cb1e3bb91edbe7fc6acf2c77b1f |
|
MD5 | 964778ce012597ff8812019ca48d1326 |
|
BLAKE2b-256 | 982b53e4577fa33949f9752abe3bb9d1a7dd57694e96c1fd36585d0bbce8ec07 |