diff --git a/CHANGELOG.md b/CHANGELOG.md index 05b20aac8..fd1f8a097 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -70,6 +70,7 @@ You can install this version by running `pip install rocketpy==1.2.0` ### Fixed +- BUG: Update flight trajectory plot axes limits [#552](https://github.com/RocketPy-Team/RocketPy/pull/552) - BUG: fix `get_controller_observed_variables` in the air brakes examples [#551](https://github.com/RocketPy-Team/RocketPy/pull/551) - MNT: small fixes before v1.2 [#550](https://github.com/RocketPy-Team/RocketPy/pull/550) - BUG: Elliptical Fins Draw [#548](https://github.com/RocketPy-Team/RocketPy/pull/548) diff --git a/rocketpy/plots/flight_plots.py b/rocketpy/plots/flight_plots.py index 05b969633..4ae5141c9 100644 --- a/rocketpy/plots/flight_plots.py +++ b/rocketpy/plots/flight_plots.py @@ -69,25 +69,23 @@ def trajectory_3d(self): min_x = min(self.flight.x[:, 1]) max_y = max(self.flight.y[:, 1]) min_y = min(self.flight.y[:, 1]) - max_xy = max(max_x, max_y) - min_xy = min(min_x, min_y) _ = plt.figure(figsize=(9, 9)) ax1 = plt.subplot(111, projection="3d") ax1.plot( - self.flight.x[:, 1], self.flight.y[:, 1], zs=0, zdir="z", linestyle="--" + self.flight.x[:, 1], self.flight.y[:, 1], zs=min_z, zdir="z", linestyle="--" ) ax1.plot( self.flight.x[:, 1], self.flight.altitude[:, 1], - zs=min_xy, + zs=min_y, zdir="y", linestyle="--", ) ax1.plot( self.flight.y[:, 1], self.flight.altitude[:, 1], - zs=min_xy, + zs=min_x, zdir="x", linestyle="--", ) @@ -114,9 +112,9 @@ def trajectory_3d(self): ax1.set_ylabel("Y - North (m)") ax1.set_zlabel("Z - Altitude Above Ground Level (m)") ax1.set_title("Flight Trajectory") - ax1.set_zlim3d([min_z, max_z]) - ax1.set_ylim3d([min_xy, max_xy]) - ax1.set_xlim3d([min_xy, max_xy]) + ax1.set_xlim(min_x, max_x) + ax1.set_ylim(min_y, max_y) + ax1.set_zlim(min_z, max_z) ax1.view_init(15, 45) ax1.set_box_aspect(None, zoom=0.95) # 95% for label adjustment plt.show()