OpenMDAO / dymos

Open Source Optimization of Dynamic Multidisciplinary Systems
Apache License 2.0
204 stars 65 forks source link

The matplotlib.cm.get_cmap() function has been removed as of mpl 3.9.0 #1068

Closed swryan closed 4 months ago

swryan commented 4 months ago

Task Description

Uses of the get_cmap() function need to be updated for changes in matplotlib version 3.9.0

https://matplotlib.org/stable/api/prev_api_changes/api_changes_3.9.0.html#removals

  File "/usr/share/miniconda/envs/test/lib/python3.12/site-packages/dymos/visualization/timeseries_plots.py", line 435, in timeseries_plots
    fnames = _mpl_timeseries_plots(time_units, var_units, phase_names, phases_node_path,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/miniconda/envs/test/lib/python3.12/site-packages/dymos/visualization/timeseries_plots.py", line 62, in _mpl_timeseries_plots
    cm = matplotlib.cm.get_cmap('tab20')
         ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'matplotlib.cm' has no attribute 'get_cmap'