Skip to content

Commit

Permalink
Correct size of drone plots.
Browse files Browse the repository at this point in the history
  • Loading branch information
moorepants committed Jul 6, 2024
1 parent 9c318c2 commit 5350d54
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions examples-gallery/plot_drone.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,10 @@
initial_guess[2*num_nodes:3*num_nodes] = xyz_guess
initial_guess[-4*num_nodes:] = 10.0 # constant thrust

prob.plot_trajectories(initial_guess)
fig, axes = plt.subplots(18, 1, sharex=True,
figsize=(6.4, 0.8*18),
layout='compressed')
prob.plot_trajectories(initial_guess, axes=axes)

# %%
# Find an optimal solution.
Expand All @@ -221,11 +224,16 @@

# %%
# Plot the optimal state and input trajectories.
prob.plot_trajectories(solution)
fig, axes = plt.subplots(18, 1, sharex=True,
figsize=(6.4, 0.8*18),
layout='compressed')
prob.plot_trajectories(solution, axes=axes)

# %%
# Plot the constraint violations.
prob.plot_constraint_violations(solution)
fig, axes = plt.subplots(2, figsize=(12.8, 9.6),
layout='constrained')
prob.plot_constraint_violations(solution, axes=axes)

# %%
# Plot the objective function as a function of optimizer iteration.
Expand Down

0 comments on commit 5350d54

Please sign in to comment.