diff --git a/GPy/plotting/gpy_plot/plot_util.py b/GPy/plotting/gpy_plot/plot_util.py index a60de819..22d6627c 100644 --- a/GPy/plotting/gpy_plot/plot_util.py +++ b/GPy/plotting/gpy_plot/plot_util.py @@ -35,7 +35,7 @@ import itertools def in_ipynb(): try: cfg = get_ipython().config - return 'TerminalIPythonApp' not in cfg + return 'IPKernelApp' in cfg except NameError: return False diff --git a/GPy/plotting/plotly_dep/plot_definitions.py b/GPy/plotting/plotly_dep/plot_definitions.py index 55f03652..613cdf4c 100644 --- a/GPy/plotting/plotly_dep/plot_definitions.py +++ b/GPy/plotting/plotly_dep/plot_definitions.py @@ -58,13 +58,13 @@ class PlotlyPlots(AbstractPlottingLibrary): self._defaults = defaults.__dict__ self.current_states = dict() - def figure(self, rows=1, cols=1, specs=None, is_3d=False): + def figure(self, rows=1, cols=1, specs=None, is_3d=False, **kwargs): if specs is None: specs = [[{'is_3d': is_3d}]*cols]*rows - figure = tools.make_subplots(rows, cols, specs=specs) + figure = tools.make_subplots(rows, cols, specs=specs, **kwargs) return figure - def new_canvas(self, canvas=None, row=1, col=1, projection='2d', + def new_canvas(self, figure=None, row=1, col=1, projection='2d', xlabel=None, ylabel=None, zlabel=None, title=None, xlim=None, ylim=None, zlim=None, **kwargs): @@ -73,11 +73,9 @@ class PlotlyPlots(AbstractPlottingLibrary): # filename = None #else: # filename = kwargs.pop('filename') - if canvas is None: + if figure is None: figure = self.figure(is_3d=projection=='3d') figure.layout.font = Font(family="Raleway, sans-serif") - else: - return canvas, kwargs if projection == '3d': figure.layout.legend.x=.5 figure.layout.legend.bgcolor='#DCDCDC' @@ -277,9 +275,9 @@ class PlotlyPlots(AbstractPlottingLibrary): if color.startswith('#'): fcolor = 'rgba({c[0]}, {c[1]}, {c[2]}, {alpha})'.format(c=Tango.hex2rgb(color), alpha=kwargs.get('opacity', 1.0)) else: fcolor = color - u = Scatter(x=X, y=upper, fillcolor=fcolor, showlegend=label is not None, name=label, fill='tonextx', legendgroup='fill_between_{}'.format(label), **kwargs) + u = Scatter(x=X, y=upper, fillcolor=fcolor, showlegend=label is not None, name=label, fill='tonextx', legendgroup='{}_fill_({},{})'.format(label, ax[1], ax[2]), **kwargs) #fcolor = '{}, {alpha})'.format(','.join(fcolor.split(',')[:-1]), alpha=0.0) - l = Scatter(x=X, y=lower, fillcolor=fcolor, showlegend=False, name=label, legendgroup='fill_between_{}'.format(label), **kwargs) + l = Scatter(x=X, y=lower, fillcolor=fcolor, showlegend=False, name=label, legendgroup='{}_fill_({},{})'.format(label, ax[1], ax[2]), **kwargs) return l, u def fill_gradient(self, canvas, X, percentiles, color=Tango.colorsHex['mediumBlue'], label=None, **kwargs): diff --git a/README.md b/README.md index 15c405c4..095cd2e6 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ The Gaussian processes framework in Python. * [GPy homepage](http://sheffieldml.github.io/GPy/) * [Tutorial notebooks](http://nbviewer.ipython.org/github/SheffieldML/notebook/blob/master/GPy/index.ipynb) * [User mailing list](https://lists.shef.ac.uk/sympa/subscribe/gpy-users) -* [Online documentation](http://pythonhosted.org/GPy/) +* [Developer documentation](http://pythonhosted.org/GPy/) * [Unit tests (Travis-CI)](https://travis-ci.org/SheffieldML/GPy) * [![licence](https://img.shields.io/badge/licence-BSD-blue.svg)](http://opensource.org/licenses/BSD-3-Clause)