-
Notifications
You must be signed in to change notification settings - Fork 126
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
Make plots resize with windows better #35195
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works very well and it's useful that when the labels etc are cut off you do get an error message - Tight layout not applied. The left and right margins cannot be made large enough to accommodate all axes decorations.
I've asked for a couple of changes to the comments just to make them clearer.
Should this have test(s)?
if add_cbar_axis: | ||
# The right most column of the GridSpec is made a SubGridSpec to facilitate the colour bar | ||
# This is done so that the colour bar can have a close spacing to the right most column | ||
# Keeping the colour bar in the GridSpec rather than alongside it means it behaves much nicer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be reworded slightly? It seems a bit subjective and not clear what behaviour it is actually doing.
Co-authored-by: Sarah Foxley <55837273+sf1919@users.noreply.github.com>
Yes, I reckon I could've put a test in for the creating subplots colour bar change; I'll add that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for putting the tests in. I think they're a good addition and should hopefully catch anything like this in future.
This one is now good to go.
Description of work.
This PR fixes a bug where plot axes labels could be hidden outside the window boundaries after resizing. It also aims to make all plot types resize in a more predictable and nicer way.
An important part of this was giving plots a tight layout; this has resulted in warnings being printed to the console when a window is resized to be very small. Since these warnings are annoying, I tried to filter them out, but couldn't find a solution that worked. However, you have to shrink the plot to an unusable size to make them appear, so I think it is okay overall.
To test:
To test these changes, it will be useful to have another version of Mantid open to see the differences.
164199.nxs
(from the training course data)164198.nxs
and164200.nxs
Finally, test with a some other graphing scenarios that you think might be challenging.
Fixes #35014
Reviewer
Please comment on the following (full description):
Code Review
Functional Tests
Does everything look good? Mark the review as Approve. A member of
@mantidproject/gatekeepers
will take care of it.