Skip to content

Commit 7f3d3c2

Browse files
'Fixparse_color'
1 parent 166015f commit 7f3d3c2

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

gempy/plot/_vista.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
try:
3737
import pyvista as pv
3838
import pyvistaqt as pvqt
39-
from pyvista.plotting import parse_color
4039
PYVISTA_IMPORT = True
4140
except ImportError:
4241
PYVISTA_IMPORT = False
@@ -314,9 +313,9 @@ def call_back_plane_move_changes(self, indices):
314313
plane1.SetCenter(new_center[0], new_center[1], new_center[2])
315314

316315
plane1.GetPlaneProperty().SetColor(
317-
parse_color(self.model._surfaces.df.set_index('id')['color'][new_values_df['id']])) # self.C_LOT[new_values_df['id']])
316+
pv.Color(self.model._surfaces.df.set_index('id')['color'][new_values_df['id']]).float_rgb) # self.C_LOT[new_values_df['id']])
318317
plane1.GetHandleProperty().SetColor(
319-
parse_color(self.model._surfaces.df.set_index('id')['color'][new_values_df['id']]))
318+
pv.Color(self.model._surfaces.df.set_index('id')['color'][new_values_df['id']]).float_rgb)
320319
return True
321320

322321
def plot_orientations(self, orientations=None, clear=True, **kwargs):
@@ -354,7 +353,7 @@ def plot_surfaces(self, surfaces=None, delete_surfaces=True, **kwargs):
354353

355354
surf = pv.PolyData(val['vertices'], np.insert(val['edges'], 0, 3, axis=1).ravel())
356355
self.surf_polydata.at[idx] = surf
357-
self.vista_surf_actor[idx] = self.p.add_mesh(surf, parse_color(val['color']), **kwargs)
356+
self.vista_surf_actor[idx] = self.p.add_mesh(surf, pv.Color(val['color']).float_rgb, **kwargs)
358357

359358
self.set_bounds()
360359
return self.surf_polydata

gempy/plot/vista.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,9 @@
2929
from typing import Union, Dict, List, Iterable, Set, Tuple
3030

3131
import matplotlib.colors as mcolors
32-
from matplotlib import cm
3332
import numpy as np
3433
import pandas as pd
3534
import pyvista as pv
36-
from pyvista.plotting import parse_color
3735
# TODO Check if this is necessary if it is implemented in the API
3836
try:
3937
import pyvistaqt as pvqt
@@ -465,7 +463,7 @@ def plot_surfaces(self, surfaces: Union[str, Iterable[str]] = 'all',
465463
# surf['id'] = val['id']
466464
self.surface_poly[val['surface']] = surf
467465
self.surface_actors[val['surface']] = self.p.add_mesh(
468-
surf, parse_color(val['color']), show_scalar_bar=True,
466+
surf, pv.Color(val['color']).float_rgb, show_scalar_bar=True,
469467
cmap=cmap, **kwargs)
470468
self.set_bounds()
471469

0 commit comments

Comments
 (0)