Skip to content

ImageWidget with 3+ subplots requires figure_shape #818

@FlynnOConnell

Description

@FlynnOConnell

This does not work:

iw = fpl.ImageWidget(data=[data_raw, data_reg, mean_sub], names=["Raw", "Registered", "Reg, Mean-Sub"])
iw.show()

...
    158     if subplot_names.size != n_subplots:
--> 159         raise ValueError(
    160             f"must provide same number of subplot `names` as specified by shape, extents, or rects: {n_subplots}"

ValueError: must provide same number of subplot `names` as specified by shape, extents, or rects: 4

This is fixed by specifying figure shape:

iw = fpl.ImageWidget(data=[data_raw, data_reg, mean_sub], names=["Raw", "Registered", "Reg, Mean-Sub"], figure_shape=(1, 3))
iw.show()

This is confusing and took me a while to figure out

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