Skip to content

Color collision when layering multiple 1D line+error plotters #982

Description

@SimonHeybrock

Problem

1D line colors for lines with error bars/bands are assigned per-plotter: each plotter's compute() walks its sources and picks explicit cycle colors starting at index 0. When a plot cell overlays several independent plotters via the layer mechanism (PlotCell._compose_plot does hv.Overlay(plots).collate()), every layer restarts the cycle, so the first line of each layer is blue, the second orange, etc. — layers collide instead of getting distinct colors.

This affects both LinePlotter and Overlay1DPlotter (both bake explicit colors onto their elements). Explicit colors are required to color error-bar endcaps (TeeHead glyphs default to black) and to match the error element to its line, so we cannot fall back on HoloViews' cross-overlay auto-cycling, which is what keeps layers distinct.

Error-free lines are not affected: they set no explicit color and auto-cycle across layers (see #975).

Reproduce

Stack two single-source 1D line+errorbars layers in one cell: both lines render in the same color (#30a2da) instead of distinct colors.

Notes

Probably rare in practice (multi-layer line+error cells are likely uncommon), so a pragmatic fix might be fine — e.g. a per-layer "color base index" configuration option that offsets the cycle so each layer starts where the previous one left off.

Context: PR #975.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions