From 04ae37033391f9370ea8528d0c09b5e6d5e57a4f Mon Sep 17 00:00:00 2001 From: jgd10 Date: Wed, 26 Jan 2022 16:48:25 +0000 Subject: [PATCH] Default cmap 'jet' -> 'viridis' In the absence of any input on the topic in 6 months I have changed the default to viridis in the commit. It is trivial to change to something else if wanted, but that can be discussed in this (or a future) PR if anyone feels strongly about it. --- ansys/mapdl/reader/cyclic_reader.py | 2 +- ansys/mapdl/reader/examples/examples.py | 2 +- ansys/mapdl/reader/misc.py | 2 +- ansys/mapdl/reader/rst.py | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ansys/mapdl/reader/cyclic_reader.py b/ansys/mapdl/reader/cyclic_reader.py index fbbcb440..1753ec4d 100644 --- a/ansys/mapdl/reader/cyclic_reader.py +++ b/ansys/mapdl/reader/cyclic_reader.py @@ -1812,7 +1812,7 @@ def _plot_cyclic_point_scalars(self, scalars, rnum, full_screen = kwargs.pop('full_screen', False) screenshot = kwargs.pop('screenshot', None) text_color = kwargs.pop('text_color', None) - kwargs.setdefault('cmap', 'jet') + kwargs.setdefault('cmap', 'viridis') if scalars is not None: kwargs.setdefault('rng', [np.nanmin(scalars), np.nanmax(scalars)]) diff --git a/ansys/mapdl/reader/examples/examples.py b/ansys/mapdl/reader/examples/examples.py index e5b17599..e1e14b1d 100644 --- a/ansys/mapdl/reader/examples/examples.py +++ b/ansys/mapdl/reader/examples/examples.py @@ -182,7 +182,7 @@ def solve_km(): # add two meshes to the plotting class pl.add_mesh(grid.copy(), color='w', style='wireframe') pl.add_mesh(grid, scalars=n, stitle='Normalized\nDisplacement', - flip_scalars=True, cmap='jet') + flip_scalars=True, cmap='viridis') # Update the coordinates by adding the mode shape to the grid pl.update_coordinates(grid.points + disp / 80, render=False) pl.add_text('Cantliver Beam 4th\nMode Shape at\n{:.4f}'.format(f[3]), diff --git a/ansys/mapdl/reader/misc.py b/ansys/mapdl/reader/misc.py index 175a67c0..290947b2 100644 --- a/ansys/mapdl/reader/misc.py +++ b/ansys/mapdl/reader/misc.py @@ -169,7 +169,7 @@ def _configure_pyvista(): """Configure PyVista's ``rcParams`` for pyansys""" import pyvista as pv # pv.global_theme.interactive = True - pv.global_theme.cmap = "jet" + pv.global_theme.cmap = "viridis" pv.global_theme.font.family = "courier" pv.global_theme.title = "PyMAPDL-Reader" diff --git a/ansys/mapdl/reader/rst.py b/ansys/mapdl/reader/rst.py index f94d58e8..995020b1 100644 --- a/ansys/mapdl/reader/rst.py +++ b/ansys/mapdl/reader/rst.py @@ -2741,7 +2741,7 @@ def _plot_point_scalars(self, scalars, rnum=None, grid=None, rng = kwargs.pop('rng', None) return_cpos = kwargs.pop('return_cpos', False) - cmap = kwargs.pop('cmap', 'jet') + cmap = kwargs.pop('cmap', 'viridis') window_size = kwargs.get('window_size') full_screen = kwargs.get('full_screen') notebook = kwargs.get('notebook') @@ -2961,7 +2961,7 @@ def _animate_point_scalars(self, scalars, grid=None, scalars[i] = scalars[i][ind] rng = kwargs.pop('rng', [np.min(scalars), np.max(scalars)]) - cmap = kwargs.pop('cmap', 'jet') + cmap = kwargs.pop('cmap', 'viridis') window_size = kwargs.pop('window_size', [1024, 768]) full_screen = kwargs.pop('full_screen', False) notebook = kwargs.pop('notebook', False)