Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions rocketpy/plots/monte_carlo_plots.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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.)
Expand Down