Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Labels text_color should also cycle through color when overlaid #5887

@ahuang11

Description

@ahuang11

I expect the labels to match the scatter plot; the use case for this is something like https://depictdatastudio.com/directly-labeling-line-graphs/
image

import pandas as pd
import holoviews as hv
hv.extension("bokeh")

df = pd.DataFrame(
    {
        "City": ["Buenos Aires", "Brasilia", "Santiago", "Bogota", "Caracas"],
        "Country": ["Argentina", "Brazil", "Chile", "Colombia", "Venezuela"],
        "Latitude": [-34.58, -15.78, -33.45, 4.60, 10.48],
        "Longitude": [-58.66, -47.91, -70.66, -74.08, -66.86],
    }
)
ds = hv.Dataset(df)
(ds.to.scatter("Longitude", "Latitude") * ds.to.labels(["Longitude", "Latitude"], ["City"])).overlay()
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions