py4dstem / py4dstem/py4DSTEM

`show` ignores `figsize` when plotting multiple images

Open
#598 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
279
Forks
177
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
When passing a list of images to py4DSTEM.show, the figsize argument is ignored.

To Reproduce

import py4DSTEM
import numpy as np

arr = np.random.rand(128,128)

py4DSTEM.show(arr, figsize=(2,2)) # <-- works
# py4DSTEM.show(arr, figsize=(2, np.nan)) # <-- raises error (as expected)

py4DSTEM.show([arr,arr], figsize=(2,2)) # <-- figsize is not changed
py4DSTEM.show([arr,arr], figsize=(2,np.nan)) # <-- does not raise an error

Expected behavior
figsize should control the size of the figure.

Additional context
For grid plots, the undocumented keyword argument axsize controls the size of each axis in the figure. At a minimum this should be documented, and ideally there should also be a way to get the overall size of the figure.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the py4DSTEM.show entry point and reproduce the single-image and multiple-image examples from the issue, comparing how figsize and axsize are handled. Done means figsize controls the overall figure for image lists, invalid values such as (2, np.nan) are rejected consistently, and the supported grid-sizing behavior is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.