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

Add tracking between axis title, window title, and plot name #36393

Merged
merged 5 commits into from
Nov 15, 2023

Conversation

jhaigh0
Copy link
Contributor

@jhaigh0 jhaigh0 commented Nov 10, 2023

Description of work

When the user edits the title of a single plot (any non-tiled plot), the window name and plot name will be updated to match. This also works in reverse, if you change the plot name in the plot selector widget, it will change the window title and plot title.

Summary of work

I've added a callback to the axis title using the matplolib add_callback method so that any time it is changed a function will trigger.
Also added a method to the figuremanager to edit the axis title, so it can be called from the plot selector.

The callback is set up in the show method rather than the constructor, since upon construction there are no axes added to the plot. It also had to be contained within the figuremanager class so that this would work with script generated plots.

Fixes #33224

To test:

  • Load some data
  • Plot a spectrum
  • This should be as before, axis title is dataset name, window and plot name are datasetname-1
  • Double-click the plot title and change it, window title and plot name should update
  • Go to the plot settings and change the title from there, window title and plot name should update
  • Hide the plot using the eye icon
  • Rename the plot in the plot selector (lower left)
  • Unhide the plot and the window and axis title should be renamed
  • Do some testing with other kinds of mantid plots, check that setting a tiled plot axis name has no effect
  • Test with script made plots (some good ones here

Reviewer

Please comment on the points listed below (full description).
Your comments will be used as part of the gatekeeper process, so please comment clearly on what you have checked during your review. If changes are made to the PR during the review process then your final comment will be the most important for gatekeepers. In this comment you should make it clear why any earlier review is still valid, or confirm that all requested changes have been addressed.

Code Review

  • Is the code of an acceptable quality?
  • Does the code conform to the coding standards?
  • Are the unit tests small and test the class in isolation?
  • If there is GUI work does it follow the GUI standards?
  • If there are changes in the release notes then do they describe the changes appropriately?
  • Do the release notes conform to the release notes guide?

Functional Tests

  • Do changes function as described? Add comments below that describe the tests performed?
  • Do the changes handle unexpected situations, e.g. bad input?
  • Has the relevant (user and developer) documentation been added/updated?

Does everything look good? Mark the review as Approve. A member of @mantidproject/gatekeepers will take care of it.

Gatekeeper

If you need to request changes to a PR then please add a comment and set the review status to "Request changes". This will stop the PR from showing up in the list for other gatekeepers.

@jhaigh0 jhaigh0 added ISIS Team: Core Issue and pull requests managed by the Core subteam at ISIS GUI Issues and pull requests specific to the Mantid Workbench GUI. labels Nov 10, 2023
@jhaigh0 jhaigh0 force-pushed the 33224_plot_title_as_window_title branch from 9757e80 to 20df6b5 Compare November 10, 2023 14:15
@jhaigh0 jhaigh0 marked this pull request as ready for review November 10, 2023 14:15
@jclarkeSTFC jclarkeSTFC self-assigned this Nov 13, 2023
Copy link
Contributor

@jclarkeSTFC jclarkeSTFC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, works as expected

@robertapplin robertapplin merged commit 2b3fe8c into main Nov 15, 2023
1 check passed
@robertapplin robertapplin deleted the 33224_plot_title_as_window_title branch November 15, 2023 14:41
@jhaigh0 jhaigh0 mentioned this pull request Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI Issues and pull requests specific to the Mantid Workbench GUI. ISIS Team: Core Issue and pull requests managed by the Core subteam at ISIS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Track plot title in the plot name (and window name)
3 participants