Skip to content

Instantly share code, notes, and snippets.

@MNoichl
MNoichl / add umap xy-indicator as ax.py
Last active April 30, 2024 22:39
Small function to add a coordinate system indicator without visible axes to a umap-plot
def add_inset_axes(base_ax, inset_position, inset_size, line_length_ratio=0.4):
"""
Adds an inset axis with a UMAPX/Y indicator into a Matplotlib figure.
Parameters:
- base_ax: The base axes to which the inset will be added.
- inset_position: The position of the inset in figure space (x, y).
- inset_size: Width and height of the inset in figure space (width, height).
- line_length_ratio: The ratio of the line length to the inset size.
@MNoichl
MNoichl / set_label_sizes.py
Created April 27, 2024 01:06
Proposed way to set label-sizes for datamapplot with pylabeladjust.
import textwrap
from sklearn.preprocessing import MinMaxScaler
df['wrapped_label'] = [textwrap.fill(label, width=20) for label in df['label']]
# Set the font-size range:
scaler = MinMaxScaler(feature_range=(3,28))
#set the rescaling-value
@MNoichl
MNoichl / .block
Created October 22, 2018 11:03
economist net
license: mit
@MNoichl
MNoichl / .block
Created October 22, 2018 11:01
economists' network
license: mit
@MNoichl
MNoichl / .block
Last active September 23, 2018 00:37
philosophy phd_advisor_network
license: gpl-3.0
height: 600
@MNoichl
MNoichl / .block
Created August 4, 2018 18:16
Interactive D3 view of sklearn decision tree
license: mit
@MNoichl
MNoichl / .block
Created August 3, 2018 23:34
Interactive D3 view of sklearn decision tree
license: mit
@MNoichl
MNoichl / .block
Created July 2, 2018 21:42
fresh block
license: mit
@MNoichl
MNoichl / .block
Last active July 2, 2018 21:44
tSNE + Tensorflow
license: mit
@MNoichl
MNoichl / .block
Last active June 19, 2018 00:19
Clusterdistances Phil
license: mit