Skip to content

Commit e1cb181

Browse files
Fix plot_wing.py to work for matplotlib v3.8+ (#425)
* Remove the use of the dist attribute for 3-D plots, which has been deprecated in the recent matplotlib versions. * Make the 3-D view behavior consitent in plot_wingbox.py, i.e., the view does not reset if the iteration is changed.
1 parent a8a272a commit e1cb181

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

openaerostruct/utils/plot_wing.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,6 @@ def plot_wing(self):
465465
self.ax.cla()
466466
az = self.ax.azim
467467
el = self.ax.elev
468-
dist = self.ax.dist
469468

470469
for j, name in enumerate(self.names):
471470
mesh0 = self.mesh[self.curr_pos * n_names + j].copy()
@@ -577,7 +576,6 @@ def plot_wing(self):
577576
self.ax.text2D(0.15, 0.05, self.obj_key + ": {}".format(obj_val), transform=self.ax.transAxes, color="k")
578577

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

582580
def save_video(self):
583581
options = dict(title="Movie", artist="Matplotlib")

openaerostruct/utils/plot_wingbox.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,8 @@ def plot_sides(self):
591591
def plot_wing(self):
592592
n_names = len(self.names)
593593
self.ax.cla()
594+
az = self.ax.azim
595+
el = self.ax.elev
594596

595597
for j, name in enumerate(self.names):
596598
# for wingbox viz
@@ -755,7 +757,7 @@ def plot_wing(self):
755757
color="k",
756758
)
757759

758-
self.ax.view_init() # Reproduce view
760+
self.ax.view_init(elev=el, azim=az) # Reproduce view
759761

760762
def save_video(self):
761763
options = dict(title="Movie", artist="Matplotlib")

0 commit comments

Comments
 (0)