Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

clock-plot

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clock-plot

This package provides a simple way to visualize patterns in timeseries data mapping 24 hours onto a polar plot

  • 0.2.1
  • PyPI
  • Socket score

Maintainers
2

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:

FeatureTypeDescriptionExample Values
yearintCalendar year2022
monthstrCalendar month"January"
year_monthintCalendar year and month in the format YYYYMM202201
dayintDay of calendar year25
datestrExpressed in the format YYYY-MM-DD"2022-01-25"
weekintISO week of the calendar year5
dayofweekstrShort version of day of week"Tue"
weekendstrEither "weekday" or "weekend", where "weekend" is Saturday and Sunday"weekend" (Sat/Sun)
"weekday" (Mon-Fri)
hourintHour of the day in 24 clock14
minuteintMinute of the hour42
degreesintAngle around 24 hour clock-face measured in degrees341
seasonstrSeason 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.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc