-
Notifications
You must be signed in to change notification settings - Fork 761
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 the option to set y-axis of raw value plot to the limits of the color map plot #484
Open
stefangachter
wants to merge
2
commits into
MichaelGrupp:master
Choose a base branch
from
stefangachter:set_error_limits_in_plots
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -595,6 +595,7 @@ def error_array(ax: plt.Axes, err_array: ListOrArray, | |
threshold: float = None, cumulative: bool = False, | ||
color: str = 'grey', name: str = "error", title: str = "", | ||
xlabel: str = "index", ylabel: typing.Optional[str] = None, | ||
xlim: typing.Tuple[float, float] = None, ylim: typing.Tuple[float, float] = None, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The correct type is: |
||
subplot_arg: int = 111, linestyle: str = "-", | ||
marker: typing.Optional[str] = None): | ||
""" | ||
|
@@ -609,6 +610,8 @@ def error_array(ax: plt.Axes, err_array: ListOrArray, | |
:param title: optional plot title | ||
:param xlabel: optional x-axis label | ||
:param ylabel: optional y-axis label | ||
:param xlim: optional tuple of x-axis limits | ||
:param ylim: optional tuple of y-axis limits | ||
:param subplot_arg: optional matplotlib subplot ID if used as subplot | ||
:param linestyle: matplotlib linestyle | ||
:param marker: optional matplotlib marker style for points | ||
|
@@ -627,6 +630,12 @@ def error_array(ax: plt.Axes, err_array: ListOrArray, | |
else: | ||
ax.plot(err_array, linestyle=linestyle, marker=marker, color=color, | ||
label=name) | ||
|
||
if xlim is not None: | ||
ax.set_xlim(xlim) | ||
if ylim is not None: | ||
ax.set_ylim(ylim) | ||
|
||
if statistics is not None: | ||
for stat_name, value in statistics.items(): | ||
color = next(ax._get_lines.prop_cycler)['color'] | ||
|
@@ -640,6 +649,7 @@ def error_array(ax: plt.Axes, err_array: ListOrArray, | |
if threshold is not None: | ||
ax.axhline(y=threshold, color='red', linestyle='dashed', linewidth=2.0, | ||
label="threshold") | ||
|
||
plt.ylabel(ylabel if ylabel else name) | ||
plt.xlabel(xlabel) | ||
plt.title(title) | ||
|
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.
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.
one space too much