hvplot icon indicating copy to clipboard operation
hvplot copied to clipboard

Specifying color adds _color entry hover-over

Open ivirshup opened this issue 6 years ago • 2 comments

Description of expected behavior and the observed behavior

Specifying colors via .hvplot.scatter adds a _color field to hover over, and this seems unintentional.

Complete, minimal, self-contained example code that reproduces the issue

import vega_datasets
import hvplot.pandas

iris = vega_datasets.data.iris()

iris.hvplot.scatter(
    x="sepalWidth",
    y="sepalLength",
    hover_cols=["species"],
    color=iris["species"].map(
        {"setosa": "red", "virginica": "blue", "versicolor": "green"}
    ),
)

Screenshots or screencasts of the bug in action

image

Version info

hvplot 0.5.2 pandas 0.25.3 bokeh 1.4.0 python 3.7

ivirshup avatar Dec 16 '19 08:12 ivirshup

Definitely unintentional, note that you can use HoloViews dim mapping to achieve the same thing:

import holoviews as hv
color=hv.dim("species").categorize(
        {"setosa": "red", "virginica": "blue", "versicolor": "green"}
    )

philippjfr avatar Apr 30 '20 00:04 philippjfr

I can reproduce.

maximlt avatar Oct 18 '22 23:10 maximlt

I can reproduce this, and possibly tackle it but I have to ask: what is the intention here? Is it to remove the _color field entirely from the hover options or to make sure it doesn't appear as a private namespace but rather as color?

Azaya89 avatar Nov 06 '25 10:11 Azaya89