diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c50965e4..cfe70b476 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ Attention: The newest changes should be on top --> - ENH: Discretized and No-Pickle Encoding Options [#827](https://github.com/RocketPy-Team/RocketPy/pull/827) - ENH: Add the Coriolis Force to the Flight class [#799](https://github.com/RocketPy-Team/RocketPy/pull/799) - ENH: Improve parachute geometric parametrization [#835](https://github.com/RocketPy-Team/RocketPy/pull/835) +- ENH: Changing ellipses plot axis label [#855](https://github.com/RocketPy-Team/RocketPy/pull/855) ### Changed diff --git a/rocketpy/plots/monte_carlo_plots.py b/rocketpy/plots/monte_carlo_plots.py index 114858252..d602b3a46 100644 --- a/rocketpy/plots/monte_carlo_plots.py +++ b/rocketpy/plots/monte_carlo_plots.py @@ -1,4 +1,5 @@ import matplotlib.pyplot as plt +from matplotlib.transforms import offset_copy import numpy as np from ..tools import generate_monte_carlo_ellipses, import_optional_dependency @@ -114,9 +115,20 @@ def ellipses( ) plt.legend() + ax.set_title("1$\\sigma$, 2$\\sigma$ and 3$\\sigma$ Monte Carlo Ellipses") - ax.set_ylabel("North (m)") - ax.set_xlabel("East (m)") + north_south_offset = offset_copy( + ax.transAxes, fig=plt.gcf(), x=-72, y=0, units="points" + ) + east_west_offset = offset_copy( + ax.transAxes, fig=plt.gcf(), x=0, y=-30, units="points" + ) + ax.text(0, 0, "West", va="bottom", ha="center", transform=east_west_offset) + ax.text(1, 0, "East", va="bottom", ha="center", transform=east_west_offset) + ax.text(0, 0, "South", va="bottom", ha="left", transform=north_south_offset) + ax.text(0, 1, "North", va="top", ha="left", transform=north_south_offset) + ax.set_ylabel("Y (m)") + ax.set_xlabel("X (m)") # Add background image to plot # TODO: In the future, integrate with other libraries to plot the map (e.g. cartopy, ee, etc.)