-
Notifications
You must be signed in to change notification settings - Fork 128
disable Croshair in 3D plots #39286
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
Merged
Merged
disable Croshair in 3D plots #39286
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
glass-ships
approved these changes
May 7, 2025
Merged
KyleQianliMa
added a commit
that referenced
this pull request
May 7, 2025
### Description of work Copy of PR [39826](#39286) to ORNL-next #### Summary of work <!-- Please provide a short, high level description of the work that was done. --> <!-- Why has this work been done? If there is no linked issue please provide appropriate context for this work. #### Purpose of work This can be removed if a github issue is referenced below --> Fixes #xxxx. <!-- and fix #xxxx or close #xxxx xor resolves #xxxx. One line per issue fixed. --> <!-- alternative *There is no associated issue.* --> <!-- If the original issue was raised by a user they should be named here. Do not leak email addresses **Report to:** [user name] --> #### Further detail of work <!-- Please provide a more detailed description of the work that has been undertaken. --> ### To test: <!-- Instructions for testing. There should be sufficient instructions for someone unfamiliar with the application to test - unless a specific reviewer is requested. If instructions for replicating the fault are contained in the linked issue then it is OK to refer back to these. --> <!-- delete this if you added release notes *This does not require release notes* because **fill in an explanation of why** If you add release notes please save them as a separate file using the Issue or PR number as the file name. Check the file is located in the correct directory for your note(s). --> <!-- Ensure the base of this PR is correct (e.g. release-next or main) Finally, don't forget to add the appropriate labels, milestones, etc.! --> --- ### Reviewer Please comment on the points listed below ([full description](http://developer.mantidproject.org/ReviewingAPullRequest.html)). **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](http://developer.mantidproject.org/Standards/)? - Are the unit tests small and test the class in isolation? - If there is GUI work does it follow the [GUI standards](http://developer.mantidproject.org/Standards/GUIStandards.html)? - 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](https://developer.mantidproject.org/Standards/ReleaseNotesGuide.html)? #### 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.
rboston628
pushed a commit
that referenced
this pull request
May 7, 2025
### Description of work EWM [10076](https://ornlrse.clm.ibmcloud.com/ccm/web/projects/Neutron%20Data%20Project%20(Change%20Management)#action=com.ibm.team.workitem.viewWorkItem&id=10076) This PR disables crosshair functions in 3D plots by hiding the crosshair button from users. #### Summary of work <!-- Please provide a short, high level description of the work that was done. --> <!-- Why has this work been done? If there is no linked issue please provide appropriate context for this work. #### Purpose of work This can be removed if a github issue is referenced below --> Fixes #xxxx. <!-- and fix #xxxx or close #xxxx xor resolves #xxxx. One line per issue fixed. --> <!-- alternative *There is no associated issue.* --> <!-- If the original issue was raised by a user they should be named here. Do not leak email addresses **Report to:** [user name] --> #### Further detail of work <!-- Please provide a more detailed description of the work that has been undertaken. --> ### To test: <!-- Instructions for testing. There should be sufficient instructions for someone unfamiliar with the application to test - unless a specific reviewer is requested. If instructions for replicating the fault are contained in the linked issue then it is OK to refer back to these. --> To test, consider three scenarios labeled as mantid 3D plotting options: surface, wireframe and mesh. In each scenarios, users should not see the crosshair button and changing axes or any other options should not crash mantid. Make sure testers set facility to SNS first. Scenario 1 - Surface plot: Run the following code: ``` from mantid.simpleapi import * import matplotlib.pyplot as plt data = Load('MUSR00015189.nxs') data = mtd['data_1'] # Extract individual workspace from group fig, ax = plt.subplots(subplot_kw={'projection':'mantid3d'}) ax.plot_surface(data) plt.show() ```  Scenario 2 - Wireframe plot: ``` from mantid.simpleapi import * import matplotlib.pyplot as plt data = Load('MAR11060.nxs') fig, ax = plt.subplots(subplot_kw={'projection':'mantid3d'}) ax.plot_wireframe(data, color='#1f77b4') plt.show() ```  Scenario 3 - Mesh plot: ``` from mantid.simpleapi import * import matplotlib.pyplot as plt import numpy as np from mpl_toolkits.mplot3d.art3d import Poly3DCollection from mantid.api import AnalysisDataService as ADS # load sample shape mesh file for a workspace ws = CreateSampleWorkspace() # alternatively: ws = Load('filepath') or ws = ADS.retrieve('ws') ws = LoadSampleShape(ws, "tube.stl") # get shape and mesh vertices sample = ws.sample() shape = sample.getShape() mesh = shape.getMesh() # Create 3D Polygon and set facecolor mesh_polygon = Poly3DCollection(mesh, facecolors = ['g'], edgecolors = ['b'], alpha = 0.5, linewidths=0.1) fig, axes = plt.subplots(subplot_kw={'projection':'mantid3d'}) axes.add_collection3d(mesh_polygon) axes.set_mesh_axes_equal(mesh) axes.set_title('Sample Shape: Tube') axes.set_xlabel('X / m') axes.set_ylabel('Y / m') axes.set_zlabel('Z / m') plt.show() ```  None of the plots should give user the option of enabling crosshair(button hidden). <!-- Ensure the base of this PR is correct (e.g. release-next or main) Finally, don't forget to add the appropriate labels, milestones, etc.! --> --- ### Reviewer Please comment on the points listed below ([full description](http://developer.mantidproject.org/ReviewingAPullRequest.html)). **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](http://developer.mantidproject.org/Standards/)? - Are the unit tests small and test the class in isolation? - If there is GUI work does it follow the [GUI standards](http://developer.mantidproject.org/Standards/GUIStandards.html)? - 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](https://developer.mantidproject.org/Standards/ReleaseNotesGuide.html)? #### 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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of work
EWM 10076
This PR disables crosshair functions in 3D plots by hiding the crosshair button from users.
Summary of work
Fixes #xxxx.
Further detail of work
To test:
To test, consider three scenarios labeled as mantid 3D plotting options: surface, wireframe and mesh. In each scenarios, users should not see the crosshair button and changing axes or any other options should not crash mantid. Make sure testers set facility to SNS first.
Scenario 1 - Surface plot:
Run the following code:
Scenario 2 - Wireframe plot:
Scenario 3 - Mesh plot:
None of the plots should give user the option of enabling crosshair(button hidden).
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
Functional Tests
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.