Skip to content

visualize.animate_2D crashes: pcolor called on a 1-D array before reshape #93

@chaoming0625

Description

@chaoming0625

In braintools.visualize.animate_2D, values is reshaped to (num_step, height, width) after the first frame is drawn (img = values[0]; ax.pcolor(img, ...)). So pcolor receives a 1-D array and matplotlib >= 3.10 raises ValueError. The function cannot run in any configuration.

Location: braintools/visualize/_plots.py (animate_2D).

Fix: reshape values to (num_step, height, width) before constructing the initial img/pcolor.

Found while adding test coverage (#90).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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