From b9a186ab1ff2bb2c5a5fa23d1cea13d0a8bbdd0c Mon Sep 17 00:00:00 2001 From: ArthurJWH Date: Fri, 3 Oct 2025 18:53:02 -0400 Subject: [PATCH 1/5] ENH: Changed the ellipses labels --- rocketpy/plots/monte_carlo_plots.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rocketpy/plots/monte_carlo_plots.py b/rocketpy/plots/monte_carlo_plots.py index cfb865c5f..75482cbbf 100644 --- a/rocketpy/plots/monte_carlo_plots.py +++ b/rocketpy/plots/monte_carlo_plots.py @@ -115,8 +115,12 @@ 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)") + ax.text(0, -0.1, "West", va="bottom", ha="center", transform=ax.transAxes) + ax.text(1, -0.1, "East", va="bottom", ha="center", transform=ax.transAxes) + ax.text(-0.12, 0, "South", va="bottom", ha="left", transform=ax.transAxes) + ax.text(-0.12, 1, "North", va="top", ha="left", transform=ax.transAxes) + 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.) From 3bbe3405812aa03817f9c31956c549c37d74ff6a Mon Sep 17 00:00:00 2001 From: ArthurJWH Date: Sun, 5 Oct 2025 16:57:17 -0400 Subject: [PATCH 2/5] ENH: Adjusted the relative positioning so it doesn't rescale with border size --- rocketpy/plots/monte_carlo_plots.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/rocketpy/plots/monte_carlo_plots.py b/rocketpy/plots/monte_carlo_plots.py index 75482cbbf..aa89588ff 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,11 +115,18 @@ def ellipses( ) plt.legend() + ax.set_title("1$\\sigma$, 2$\\sigma$ and 3$\\sigma$ Monte Carlo Ellipses") - ax.text(0, -0.1, "West", va="bottom", ha="center", transform=ax.transAxes) - ax.text(1, -0.1, "East", va="bottom", ha="center", transform=ax.transAxes) - ax.text(-0.12, 0, "South", va="bottom", ha="left", transform=ax.transAxes) - ax.text(-0.12, 1, "North", va="top", ha="left", transform=ax.transAxes) + 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)") From dfaed2a75ca09e8c4df2917e5557623b0f6fd098 Mon Sep 17 00:00:00 2001 From: ArthurJWH Date: Fri, 3 Oct 2025 18:53:02 -0400 Subject: [PATCH 3/5] ENH: Changed the ellipses labels --- rocketpy/plots/monte_carlo_plots.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rocketpy/plots/monte_carlo_plots.py b/rocketpy/plots/monte_carlo_plots.py index 114858252..59dc01f52 100644 --- a/rocketpy/plots/monte_carlo_plots.py +++ b/rocketpy/plots/monte_carlo_plots.py @@ -115,8 +115,12 @@ 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)") + ax.text(0, -0.1, "West", va="bottom", ha="center", transform=ax.transAxes) + ax.text(1, -0.1, "East", va="bottom", ha="center", transform=ax.transAxes) + ax.text(-0.12, 0, "South", va="bottom", ha="left", transform=ax.transAxes) + ax.text(-0.12, 1, "North", va="top", ha="left", transform=ax.transAxes) + 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.) From 6713f0b80ce0c973e4bfe1271c69acb4cefe0f78 Mon Sep 17 00:00:00 2001 From: ArthurJWH Date: Sun, 5 Oct 2025 16:57:17 -0400 Subject: [PATCH 4/5] ENH: Adjusted the relative positioning so it doesn't rescale with border size --- rocketpy/plots/monte_carlo_plots.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/rocketpy/plots/monte_carlo_plots.py b/rocketpy/plots/monte_carlo_plots.py index 59dc01f52..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,11 +115,18 @@ def ellipses( ) plt.legend() + ax.set_title("1$\\sigma$, 2$\\sigma$ and 3$\\sigma$ Monte Carlo Ellipses") - ax.text(0, -0.1, "West", va="bottom", ha="center", transform=ax.transAxes) - ax.text(1, -0.1, "East", va="bottom", ha="center", transform=ax.transAxes) - ax.text(-0.12, 0, "South", va="bottom", ha="left", transform=ax.transAxes) - ax.text(-0.12, 1, "North", va="top", ha="left", transform=ax.transAxes) + 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)") From 629316db99604c785a6fce69b6f123db97e60949 Mon Sep 17 00:00:00 2001 From: ArthurJWH Date: Tue, 14 Oct 2025 17:07:26 -0400 Subject: [PATCH 5/5] DOC: Updated the CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) 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