When the properties of a curve are changed using the plot settings, it is redrawn. The puts the new curve to the back of the line order. We want to maintain the line order for the legend etc. so we suffle it back into the right place. The problem is, when a curve gets redrawn, if it is from a workspace which has error data it gets redrawn as an ErrorBarContainer object. In this case, when calculating the index of the curve in the line order, the replotting function was using ax.containers (which holds the error bar containers). The order of ax.containers is not being maintained like we do the line order so this was leading to some strange results.
I've fixed the problem by getting the curve index as normal from the lines list by using the line stored within the error bar container.
Fixes #37465
Report to: Sanghamitra
To test:
Follow instructions from the issue
Do other tests, changing different properties of the lines, making sure the order stays the same.
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.
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.
Description of work
When the properties of a curve are changed using the plot settings, it is redrawn. The puts the new curve to the back of the line order. We want to maintain the line order for the legend etc. so we suffle it back into the right place. The problem is, when a curve gets redrawn, if it is from a workspace which has error data it gets redrawn as an ErrorBarContainer object. In this case, when calculating the index of the curve in the line order, the replotting function was using
ax.containers
(which holds the error bar containers). The order ofax.containers
is not being maintained like we do the line order so this was leading to some strange results. I've fixed the problem by getting the curve index as normal from the lines list by using the line stored within the error bar container.Fixes #37465
Report to: Sanghamitra
To test:
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.