Skip to content

Commit

Permalink
Fix plot_wingbox.py to work for matplotlib v3.8+ (#424)
Browse files Browse the repository at this point in the history
  • Loading branch information
shamsheersc19 committed Mar 6, 2024
1 parent def4df0 commit a8a272a
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions openaerostruct/utils/plot_wingbox.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
"""
This is a custom script for visualizing the optimization results when using the wingbox structural model.
This only works when using the wingbox model with MULTIPOINT analysis/optimization.
Modifications will be necessary when moving away from the intended optimization problem formulation,
and this can be used as a starting point.
The usage, for example, if running a case from the `examples` directory would be `python ../utils/plot_wingbox.py aerostruct.db`.
"""


Expand Down Expand Up @@ -588,14 +591,6 @@ def plot_sides(self):
def plot_wing(self):
n_names = len(self.names)
self.ax.cla()
az = self.ax.azim
el = self.ax.elev
dist = self.ax.dist

# for a planform view use:
# az = 270
# el = 0.
# dist = 15.

for j, name in enumerate(self.names):
# for wingbox viz
Expand Down Expand Up @@ -760,8 +755,7 @@ def plot_wing(self):
color="k",
)

self.ax.view_init(elev=el, azim=az) # Reproduce view
self.ax.dist = dist
self.ax.view_init() # Reproduce view

def save_video(self):
options = dict(title="Movie", artist="Matplotlib")
Expand Down

0 comments on commit a8a272a

Please sign in to comment.