Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New visualization function to just show a series of panels? #747

Closed
jgostick opened this issue Nov 11, 2022 · 1 comment
Closed

New visualization function to just show a series of panels? #747

jgostick opened this issue Nov 11, 2022 · 1 comment

Comments

@jgostick
Copy link
Member

This might be useful:

def show_panels(im, rc=[5, 5], axis=0):
    i, j = rc
    im = np.swapaxes(im, axis, 2)
    slices = np.linspace(0, im.shape[2], i*j, endpoint=False).astype(int)
    fig, ax = plt.subplots(i, j)
    s = 0
    for row in range(i):
        for col in range(j):
            ax[row][col].imshow(im[..., slices[s]])
            ax[row][col].set_title(f"Slice {slices[s]}")
            s += 1
    return fig, ax

fig, ax = show_panels(im, axis=0)
fig.set_size_inches(15, 15)
fig
@jgostick
Copy link
Member Author

addedin PR #800

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant