Skip to content

Commit

Permalink
ENH: Optional argument to show the plot in Function.compare_plots
Browse files Browse the repository at this point in the history
  • Loading branch information
Gui-FernandesBR committed Feb 26, 2024
1 parent 43c941f commit 43be824
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).


### Changed

- ENH: Optional argument to show the plot in Function.compare_plots [#563](https://github.com/RocketPy-Team/RocketPy/pull/563)

### Fixed
- BUG: export_eng 'Motor' method would not work for liquid motors. [#559](https://github.com/RocketPy-Team/RocketPy/pull/559)
Expand Down
6 changes: 5 additions & 1 deletion rocketpy/mathutils/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -1474,6 +1474,7 @@ def compare_plots(
force_data=False,
force_points=False,
return_object=False,
show=True,
):
"""Plots N 1-Dimensional Functions in the same plot, from a lower
limit to an upper limit, by sampling the Functions several times in
Expand Down Expand Up @@ -1513,6 +1514,8 @@ def compare_plots(
Setting force_points to True will plot all points, as a scatter, in
which the Function was evaluated to plot it. Default value is
False.
show : bool, optional
If True, shows the plot. Default value is True.
Returns
-------
Expand Down Expand Up @@ -1586,7 +1589,8 @@ def compare_plots(
plt.xlabel(xlabel)
plt.ylabel(ylabel)

plt.show()
if show:
plt.show()

if return_object:
return fig, ax
Expand Down

0 comments on commit 43be824

Please sign in to comment.