From f97a037ab1d09cbc3d963f59b22c4910b724bc83 Mon Sep 17 00:00:00 2001 From: John Zheng Date: Sun, 10 Nov 2024 02:43:02 -0800 Subject: [PATCH] Update euler.py for deprecated get_cmap function in Matplotlib taichi/examples/simulation/euler.py:436: MatplotlibDeprecationWarning: The get_cmap function was deprecated in Matplotlib 3.7 and will be removed in 3.11. Use ``matplotlib.colormaps[name]`` or ``matplotlib.colormaps.get_cmap()`` or ``pyplot.get_cmap()`` instead. cmap = cm.get_cmap(cmap_name) --- python/taichi/examples/simulation/euler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/taichi/examples/simulation/euler.py b/python/taichi/examples/simulation/euler.py index 647293bfd9490..698af56e5628c 100644 --- a/python/taichi/examples/simulation/euler.py +++ b/python/taichi/examples/simulation/euler.py @@ -1,4 +1,4 @@ -from matplotlib import cm +from matplotlib import colormaps import taichi as ti @@ -433,7 +433,7 @@ def paint(): def main(): gui = ti.GUI("Euler Equations", (res, res)) - cmap = cm.get_cmap(cmap_name) + cmap = colormaps[cmap_name] set_ic() set_bc()