From 139ed6c058e81364d22cc4f5cacf62e4b8c8a90f Mon Sep 17 00:00:00 2001 From: Andrew Huang Date: Sat, 1 Sep 2018 12:47:07 -0700 Subject: [PATCH] Support input of strings to theme (#2972) --- examples/user_guide/Plotting_with_Bokeh.ipynb | 18 ++++++++++++++++++ holoviews/plotting/bokeh/renderer.py | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/examples/user_guide/Plotting_with_Bokeh.ipynb b/examples/user_guide/Plotting_with_Bokeh.ipynb index 0398c4743c..25e1df04d6 100644 --- a/examples/user_guide/Plotting_with_Bokeh.ipynb +++ b/examples/user_guide/Plotting_with_Bokeh.ipynb @@ -640,6 +640,24 @@ "hv.Curve((xs, np.sin(xs)), label='foo')" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You may also supply a name from Bokeh's built-in-themes:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "hv.renderer('bokeh').theme = 'light_minimal'\n", + "xs = np.linspace(0, np.pi*4, 100)\n", + "hv.Curve((xs, np.sin(xs)), label='foo')" + ] + }, { "cell_type": "markdown", "metadata": {}, diff --git a/holoviews/plotting/bokeh/renderer.py b/holoviews/plotting/bokeh/renderer.py index 775d68399f..a3ed0580f4 100644 --- a/holoviews/plotting/bokeh/renderer.py +++ b/holoviews/plotting/bokeh/renderer.py @@ -66,7 +66,7 @@ class BokehRenderer(Renderer): - theme = param.ClassSelector(default=None, class_=Theme, allow_None=True, doc=""" + theme = param.ClassSelector(default=None, class_=(Theme, str), allow_None=True, doc=""" The applicable Bokeh Theme object (if any).""") backend = param.String(default='bokeh', doc="The backend name.")