Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kushalkolar
Copy link
Member

@kushalkolar kushalkolar commented Nov 12, 2025

When one controller manages multiple cameras in a Figure, i.e. when multiple subplot all share a controller, the current implementation of auto_center() and auto_scale() sets the cameras of those other subplots based on the bounding box of the scene in the current subplot. This is a problem when the scales are very different between subplots!

This PR now sets the cameras of the other subplots based on the other subplot's own scene bbox.

closes #783 , closes #821

Example with the same code from #783

Notice how the y-scales are very different.

sync.x-2025-11-12_03.18.14.mp4

@clewis7 can we get this merged ASAP please 😄

This shouldn't break any existing functionality, the screenshot tests will tell.

@kushalkolar kushalkolar requested a review from clewis7 as a code owner November 12, 2025 08:20
@kushalkolar
Copy link
Member Author

@almarklein getting large diffs with colors across the entire canvas, did something change recently?

Regenerate is producing nans for some images so I'm guessing the image saving lib change something recently: https://github.com/fastplotlib/fastplotlib/actions/runs/19291516914/job/55163104901?pr=938#step:8:1528

diff-image_simple-rgb diff-image_rgb-rgb diff-image_volume_non_orthogonal_slicing-rgb diff-line_cmap-rgb diff-line_collection_cmap_values_qualitative-rgb diff-scatter_validate-rgb

@almarklein
Copy link
Collaborator

Could you try pinning pygfx==0.15.2 in pyproject.toml?

@almarklein
Copy link
Collaborator

But still, it also happens for main. And only for Python 3.13??

@kushalkolar
Copy link
Member Author

kushalkolar commented Nov 14, 2025

@clewis7 can merge #939 and then merge main into this and hopefully tests pass.

I want to make some examples for this and we can brainstorm how to make this more easily accessible in the API but let's do that later, I made #941 for that.

@github-actions
Copy link

📚 Docs preview built and uploaded! https://www.fastplotlib.org/ver/better-plot-scaling

@kushalkolar
Copy link
Member Author

@clewis7 gtg!

@clewis7 clewis7 merged commit c924c66 into main Nov 15, 2025
36 checks passed
@clewis7 clewis7 deleted the better-plot-scaling branch November 15, 2025 14:25
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

Successfully merging this pull request may close these issues.

Share axes between subplots Customizable camera linking does not work

4 participants