Skip to content

Conversation

@Azaya89
Copy link
Collaborator

@Azaya89 Azaya89 commented Nov 11, 2025

closes #674
closes #1449

This PR fixes a bug where hv.dim() expressions were not properly handled when passed to the color (or c) and size (or s) parameters, causing errors when plotting.

  • Normalized 's' to 'size' and 'c' to 'color' for consistent handling
  • Introduced color_dim and color_is_dim variables to validate dim expressions as separate from string column names before handling
  • Added tests

Examples

import hvplot.pandas
import numpy as np
import pandas as pd
import holoviews as hv

x = np.linspace(0.0, 10.0, 25)
y = np.sin(x)
df = pd.DataFrame({'x': x, 'y': y})
style_opts = ('size', 's', 'color', 'c')

plots = [
    df.hvplot.scatter(
        'x',
        'y',
        title=f"{opt}=hv.dim('y')",
        height=300,
        width=400,
        **{opt: hv.dim('y') * 20},
    ) for opt in style_opts]

hv.Layout(plots).opts(shared_axes=False).cols(2)
image

@Azaya89 Azaya89 requested a review from Copilot November 11, 2025 16:48
Copilot finished reviewing on behalf of Azaya89 November 11, 2025 16:50

This comment was marked as resolved.

@Azaya89 Azaya89 requested a review from maximlt November 11, 2025 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Style option "s" does not behave the same as "size" with hv.dim Cannot use hv.dim() to declare the c color parameter of a scatter plot

2 participants