Skip to content

Appending labelled points to a scatter puts them into the wrong class #1971

Open

Description

@piyush182004

Description

Appending labelled points to a scatter plot puts them into the wrong class.

The client sends one trace per label present in the batch, named after the
label. The server ignores those names for an unnamed update and pairs the
entries with the plot's traces by position. So a batch holding only "dog"
is added to the first trace, "cat", and a label the plot hasn't seen yet is
added to an existing trace instead of getting its own.

Current Behavior

Starting from cat at x=1 and dog at x=2, 3:

append one dog (x=9)              -> cat=[1, 9]  dog=[2, 3]      wrong class
append a new class bird (x=7)     -> cat=[1, 7]  dog=[2, 3]      no bird trace
append bird (x=7) and dog (x=9)   -> cat=[1, 7]  dog=[2, 3, 9]   bird lost into cat

The same happens with integer labels that don't start at 1 (labels 3 and 7,
appending a 7 lands in "3").

Expected Behavior

Each appended point joins the trace of its own label, and a new label gets a
new trace.

Steps to Reproduce

import numpy as np
import visdom

viz = visdom.Visdom()
viz.scatter(X=np.array([[1., 1], [2, 2], [3, 3]]),
            Y=np.array(["cat", "dog", "dog"]), win="s")
viz.scatter(X=np.array([[9., 9]]), Y=np.array(["dog"]), win="s",
            update="append")
# the point at x=9 is in the "cat" trace

Environment

  • visdom dev (reproduced at bda66a6)
  • Python 3.12

The pairing is the zip(idxs, new_data) loop in UpdateHandler.update
(py/visdom/server/handlers/web_handlers.py).

FIX #1972

Activity

  1. parth-bansal081 commented on Oct 14, 2026

    @parth-bansal081

    Hi @piyush182004 , Is this issue open to contribute to?

  2. piyush182004 commented on Oct 14, 2026

    @piyush182004
    MemberAuthor

    Hi @parth-bansal081 , thanks for the interest! This one is already fixed in #1972, which is linked above and under review, you can choose a different issue with no linked pr for contribution or suggest a new issue and work on it,check the CONTRIBUTING.md for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions