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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scale bar does not respond to canvas size changes #6758

Open
melonora opened this issue Mar 19, 2024 · 1 comment 路 May be fixed by #6892
Open

Scale bar does not respond to canvas size changes #6758

melonora opened this issue Mar 19, 2024 · 1 comment 路 May be fixed by #6892
Labels
bug Something isn't working

Comments

@melonora
Copy link
Contributor

馃悰 Bug Report

When taking a screenshot with the soon to be added fit_to_data functionality #6730 it was noticed that when the canvas size changes, the size of the scale bar does not change. This causes the scale bar to be potentially very small compared to the data.

馃挕 Steps to Reproduce

import napari
from skimage.data import cells3d

import matplotlib.pyplot as plt

viewer = napari.Viewer()
data = cells3d()

viewer.add_image(data, channel_axis=1, contrast_limits=[[938,24180], [2382, 49151]])
viewer.scale_bar.visible = True
img=viewer.screenshot(canvas_only=True, fit_to_data=True, scale=10)
plt.imshow(img)
plt.show()

The result is an image like this:
image

馃挕 Expected Behavior

A screenshot image is generated with a scale bar that is visible.

馃寧 Environment

na

馃挕 Additional Context

No response

@melonora melonora added the bug Something isn't working label Mar 19, 2024
@imagesc-bot
Copy link

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/napari-code-cafe/92972/4

@melonora melonora linked a pull request May 6, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants