Skip to content

Instantly share code, notes, and snippets.

View VincenzoManto's full-sized avatar
☢️
Swearing

Vincenzo Manto VincenzoManto

☢️
Swearing
View GitHub Profile
@VincenzoManto
VincenzoManto / manto_cellbar.py
Created October 31, 2025 10:27
A Python practical implementation of Manto's CellBar Chart
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
def generate_manto_chart(df: pd.DataFrame, x_col: str, y_col: str, grid_size: int, sample_size: int = 2000, density_alpha: float = 0.6):
"""
Density is visualized via rectangles whose height within each cell (bin_x, bin_y)
is proportional to the count of points in that cell, aligned to the top of the cell