diff --git a/holoviews/plotting/plotly/chart3d.py b/holoviews/plotting/plotly/chart3d.py index 15e7e428b5..712f23f48e 100644 --- a/holoviews/plotting/plotly/chart3d.py +++ b/holoviews/plotting/plotly/chart3d.py @@ -5,6 +5,11 @@ from plotly.tools import FigureFactory as FF from plotly.graph_objs import Scene, XAxis, YAxis, ZAxis +try: + from plotly.figure_factory._trisurf import trisurf as trisurface +except ImportError: + pass + import param from ...core.spaces import DynamicMap @@ -96,7 +101,7 @@ def get_data(self, element, ranges): points2D = np.vstack([x, y]).T tri = Delaunay(points2D) simplices = tri.simplices - return (x, y, z, simplices, self.colorbar, 'black'), {} + return (x, y, z, simplices, self.colorbar, 'black', None), {} def graph_options(self, element, ranges): opts = self.style[self.cyclic_index] @@ -110,5 +115,8 @@ def graph_options(self, element, ranges): return opts def init_graph(self, plot_args, plot_kwargs): - trisurf = FF._trisurf(*plot_args, **plot_kwargs) + if hasattr(FF, '_trisurf'): + trisurf = FF._trisurf(*plot_args[:-1], **plot_kwargs) + else: + trisurf = trisurface(*plot_args, **plot_kwargs) return trisurf[0]