-
Notifications
You must be signed in to change notification settings - Fork 206
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 plot display range #2958
base: RELEASE_next_patch
Are you sure you want to change the base?
Add plot display range #2958
Conversation
Codecov Report
@@ Coverage Diff @@
## RELEASE_next_patch #2958 +/- ##
======================================================
+ Coverage 80.79% 80.80% +0.01%
======================================================
Files 209 209
Lines 32696 32726 +30
Branches 7321 7336 +15
======================================================
+ Hits 26416 26444 +28
- Misses 4516 4517 +1
- Partials 1764 1765 +1
Continue to review full report at Codecov.
|
19a68ad
to
5790878
Compare
I am not sure if it is a good idea to adjust the x-limit to 0.1 keV automatically—this hides a feature of the data from the user, what can cause other issues. Wouldn't it be better to simply document this particularity of EDX datasets and suggest to crop the data using |
Also, this looks more like an "enhancement" than a bug-fix to me. Do you agree @ericpre? |
@@ -926,9 +927,15 @@ def plot(self, | |||
set_elements, add_elements, estimate_integration_windows, | |||
get_lines_intensity, estimate_background_windows | |||
""" | |||
if display_range is None: | |||
axis = self.axes_manager[-1].axis | |||
if len(axis) > 1 and axis[0] < 0.1: |
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 assumes that the units are keV.
By the way, is this documented?
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.
Yes, you are right!
I was torn on this for a while and was thinking the same, however, I end up convincing myself that there is a use case to have this:
Overall, because it is generic and the logic is simple (
Yes, it is mostly an enhancement, on the edge being a bug! ;) |
The issue I see is that the offending channel is also an issue for decomposition and curve fitting. By taking it out of the view, we hide the issue, making it harder for the users to understand what's wrong in their analysis. |
Description of the change
Improve setting x limits when plotting EDS signal, which can happen in cases, as the one described in #2899. Since this is not the first time that this question is asked and this is simple issue, it would be good to make it more convenient.
Progress of the PR
upcoming_changes
folder (seeupcoming_changes/README.rst
),readthedocs
doc build of this PR (link in github checks)Minimal example of the bug fix or the new feature
From the example given in #2899
Before this PR:
With this PR: