This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |