mdolab / OpenAeroStruct

OpenAeroStruct is a lightweight tool that performs aerostructural optimization using OpenMDAO.
Apache License 2.0
175 stars 112 forks source link

The method for adjusting zoom in plot_wingbox.py does not work with latest matplotlib #423

Closed shamsheersc19 closed 2 months ago

shamsheersc19 commented 3 months ago

Description

In plot_wingbox.py, ax.dist is used to adjust the zoom for the wing visualization. This attribute and method have been in deprecated in matplotlib. For example, it doesn't work for v3.8. The correct way to do this for recent version is as described in https://py4u.org/questions/75146691/

Steps to reproduce issue

  1. Get a recent matplotlib version e.g., 3.8.3
  2. Run the run_aerostruct_uCRM_multipoint.py example
  3. Call the plot_wingbox.py script as showing the wingbox walkthrough.

Current behavior

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2288.0_x64__qbz5n2kfra8p0\Lib\tkinter\__init__.py", line 1967, in __call__
    return self.func(*args)
           ^^^^^^^^^^^^^^^^
  File "C:\Users\shams\OpenMDAO\OpenAeroStruct\openaerostruct\utils\plot_wingbox.py", line 798, in update_graphs
    self.plot_wing()
  File "C:\Users\shams\OpenMDAO\OpenAeroStruct\openaerostruct\utils\plot_wingbox.py", line 593, in plot_wing
    dist = self.ax.dist
           ^^^^^^^^^^^^
AttributeError: 'Axes3D' object has no attribute 'dist'

Expected behavior

The results should be visualized as shown in the wingbox walkthough.