Skip to content

Instantly share code, notes, and snippets.

View Charlignon's full-sized avatar

Charlignon Charlignon

  • 17:56 (UTC +02:00)
View GitHub Profile
@Charlignon
Charlignon / colour_poll_combinations.py
Last active November 22, 2025 01:19
Generate lots of possible poll results, and convert them into colours.
import numpy as np
import matplotlib.pyplot as plt
import collections as col
# Yeah I spent 8h of my life messing around for only 30 lines of code in the end :)))
# If you want to change the cardinality of the poll (number of option), you'll need to edit the code manually,
# as it couldn't be parametrized efficiently. Eg. for a 3 colours poll:
# - Remove cc dd ee everywhere and their declaration
# - Reduce the 1111 vector l.37