Lifemap.layer_text

Lifemap.layer_text(
    text,
    font_size=12,
    font_family='Segoe UI, Helvetica, sans-serif',
    color='#FFFFFF',
    stroke='#000000',
    opacity=1.0,
)

Add a text labels layer.

It can be used to display text labels alongside species identified by their taxids.

Parameters

Name Type Description Default
text str Name of a column of the data containing text to be displayed. required
font_size int Text font size, by default 12. 12
font_family str CSS-like font family definition, by default “Segoe UI, Helvetica, sans-serif”. 'Segoe UI, Helvetica, sans-serif'
color str CSS text color specification, by default “#FFFFFF”. '#FFFFFF'
stroke str CSS stroke color specification, by default “#000000”. '#000000'
opacity float Text opacity as a floating number between 0 and 1, by default 1.0. 1.0

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,
...         ],
...         "value": list("ABCDEFGHIJK"),
...     }
... )
>>> Lifemap(d).layer_text(text="value", font_size=14).show()