ridgeplot.dotted_heatmap
for most of the part, this is copied from: https://stackoverflow.com/questions/59381273/heatmap-with-circles-indicating-size-of-population
dotted_heatmap(data, ax, cmap='cividis', circle_size=None)
Plotting dotted heatmap
Example
>>> import matplotlib.pyplot as plt
>>> from ridgeplot.dotted_heatmap import dotted_heatmap
>>> fig = plt.figure()
>>> ax = fig.add_subplot(111)
>>> data = pd.DataFrame(
... np.random.randn(n, n),
... index=[f"feature{i}" for i in range(n)],
... columns=[f"sample{i}" for i in range(n)],
... )
>>> dotted_heatmap(data=data,ax=ax, cmap="viridis")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
DataFrame
|
data to plot |
required |
ax |
Axes
|
matplotlib ax object |
required |
cmap |
str
|
cmap value, defaults to "cividis" |
'cividis'
|
circle_size |
Optional[float]
|
raidus of the circles, if None, we will use relaive sizes, defaults to None |
None
|
Source code in src/ridgeplot/dotted_heatmap.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
|