Lifemap.layer_heatmap
Lifemap.layer_heatmap(
radius=5.0,
blur=5.0,
opacity=1.0,
gradient=('#4675ed', '#39a2fc', '#1bcfd4', '#24eca6', '#61fc6c', '#a4fc3b', '#d1e834', '#f3363a'),
)Add an heatmap layer.
This layer is used to display observations distribution.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| radius | float | Heatmap radius, by default 5.0 | 5.0 |
| blur | float | Heatmap blur, by default 5.0 | 5.0 |
| opacity | float | Heatmap opacity as a floating number between 0 and 1, by default 1.0 | 1.0 |
| gradient | tuple | Tuple of CSS colors to define the heatmap gradient. By default gradient inspired from the “turbo” color ramp. | ('#4675ed', '#39a2fc', '#1bcfd4', '#24eca6', '#61fc6c', '#a4fc3b', '#d1e834', '#f3363a') |
Returns
| Name | Type | Description |
|---|---|---|
| Lifemap | A Lifemap visualization object. |
Examples
>>> import polars as pl
>>> from pylifemap import Lifemap
>>> d = pl.DataFrame(
... {
... "taxid": [
... 9685,
... 9615,
... 9994,
... 2467430,
... 2514524,
... 2038938,
... 1021470,
... 1415565,
... 1928562,
... 1397240,
... 230741,
... ],
... }
... )
>>> Lifemap(d).layer_heatmap().show()