holoviz / hvplot

A high-level plotting API for pandas, dask, xarray, and networkx built on HoloViews
https://hvplot.holoviz.org
BSD 3-Clause "New" or "Revised" License
1.08k stars 105 forks source link

c, xoffset and yoffset for labels not working #901

Open MarcSkovMadsen opened 2 years ago

MarcSkovMadsen commented 2 years ago

I'm currently improving the docstrings of labels. I can see in convert.py that c, xoffset, yoffset should be available as kind parameters.

image

But I cannot see them have any effect.

import hvplot.pandas  # noqa
import pandas as pd

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],
     'Color': ['blue', 'green', 'white', 'black', 'yellow']})

df.hvplot.points(x='Longitude', y='Latitude') * \
df.hvplot.labels(x='Longitude', y='Latitude', text='City', xoffset=100, yoffset=100, c='Color')

image

I would expect the labels not to be drawn on top of the points and to see different colors for the labels.

LinuxIsCool commented 1 year ago

This feature would be very much appreciated.