From 669b2196642fd51f47e23275039c6827c8356044 Mon Sep 17 00:00:00 2001 From: jlstevens Date: Sun, 2 Jul 2017 15:12:53 +0100 Subject: [PATCH 1/5] Set SpikesPlot color index to None by default --- holoviews/plotting/bokeh/chart.py | 2 +- holoviews/plotting/mpl/chart.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/holoviews/plotting/bokeh/chart.py b/holoviews/plotting/bokeh/chart.py index 8425acbfcd..dae280a0d6 100644 --- a/holoviews/plotting/bokeh/chart.py +++ b/holoviews/plotting/bokeh/chart.py @@ -492,7 +492,7 @@ def get_data(self, element, ranges=None, empty=False): class SpikesPlot(PathPlot, ColorbarPlot): - color_index = param.ClassSelector(default=1, allow_None=True, + color_index = param.ClassSelector(default=None, allow_None=True, class_=(basestring, int), doc=""" Index of the dimension from which the color will the drawn""") diff --git a/holoviews/plotting/mpl/chart.py b/holoviews/plotting/mpl/chart.py index ea1998ba18..d24676b818 100644 --- a/holoviews/plotting/mpl/chart.py +++ b/holoviews/plotting/mpl/chart.py @@ -903,7 +903,7 @@ class SpikesPlot(PathPlot, ColorbarPlot): explicit aspect ratio as width/height as well as 'square' and 'equal' options.""") - color_index = param.ClassSelector(default=1, allow_None=True, + color_index = param.ClassSelector(default=None, allow_None=True, class_=(basestring, int), doc=""" Index of the dimension from which the color will the drawn""") From a56a87dd8e11139ab52707b5210a82f3e539e8d3 Mon Sep 17 00:00:00 2001 From: jlstevens Date: Thu, 6 Jul 2017 21:23:38 +0100 Subject: [PATCH 2/5] Set default Spikes colormap to 'fire' --- holoviews/plotting/bokeh/__init__.py | 2 +- holoviews/plotting/mpl/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/holoviews/plotting/bokeh/__init__.py b/holoviews/plotting/bokeh/__init__.py index 73a9c456af..9f5ec020b1 100644 --- a/holoviews/plotting/bokeh/__init__.py +++ b/holoviews/plotting/bokeh/__init__.py @@ -139,7 +139,7 @@ def colormap_generator(palette): options.Spread = Options('style', color=Cycle(), alpha=0.6, line_color='black') options.Bars = Options('style', color=Cycle(), line_color='black', width=0.8) -options.Spikes = Options('style', color='black') +options.Spikes = Options('style', color='black', cmap='fire') options.Area = Options('style', color=Cycle(), line_color='black') options.VectorField = Options('style', color='black') diff --git a/holoviews/plotting/mpl/__init__.py b/holoviews/plotting/mpl/__init__.py index 98c345778e..c81d14cb95 100644 --- a/holoviews/plotting/mpl/__init__.py +++ b/holoviews/plotting/mpl/__init__.py @@ -203,7 +203,7 @@ def grid_selector(grid): options.Scatter3D = Options('style', c=Cycle(), marker='o') options.Scatter3D = Options('plot', fig_size=150) options.Surface = Options('plot', fig_size=150) -options.Spikes = Options('style', color='black') +options.Spikes = Options('style', color='black', cmap='fire') options.Area = Options('style', facecolor=Cycle(), edgecolor='black') options.BoxWhisker = Options('style', boxprops=dict(color='k', linewidth=1.5), whiskerprops=dict(color='k', linewidth=1.5)) From 497c5030e1d5b30a3ccd6a4463f91a79459e6eb6 Mon Sep 17 00:00:00 2001 From: jlstevens Date: Thu, 6 Jul 2017 23:03:33 +0100 Subject: [PATCH 3/5] Updated test_spikes_colormapping unit test --- tests/testplotinstantiation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/testplotinstantiation.py b/tests/testplotinstantiation.py index 401b6d3f71..d6a25d2d3a 100644 --- a/tests/testplotinstantiation.py +++ b/tests/testplotinstantiation.py @@ -812,7 +812,8 @@ def test_quadmesh_colormapping(self): def test_spikes_colormapping(self): spikes = Spikes(np.random.rand(20, 2), vdims=['Intensity']) - self._test_colormapping(spikes, 1) + color_spikes = spikes.opts(plot=dict(color_index=1)) + self._test_colormapping(color_spikes, 1) def test_empty_spikes_plot(self): spikes = Spikes([], vdims=['Intensity']) From 3c32c3e78e0571e84a9ddb575bdefdec1ebd5f1b Mon Sep 17 00:00:00 2001 From: jlstevens Date: Fri, 7 Jul 2017 01:12:17 +0100 Subject: [PATCH 4/5] Minor formatting fix --- holoviews/plotting/mpl/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/holoviews/plotting/mpl/__init__.py b/holoviews/plotting/mpl/__init__.py index c81d14cb95..ee791dcabd 100644 --- a/holoviews/plotting/mpl/__init__.py +++ b/holoviews/plotting/mpl/__init__.py @@ -159,7 +159,8 @@ def grid_selector(grid): Box: PathPlot, Bounds: PathPlot, Ellipse: PathPlot, - Polygons: PolygonPlot}, 'matplotlib', style_aliases=style_aliases) + Polygons: PolygonPlot}, + 'matplotlib', style_aliases=style_aliases) MPLPlot.sideplots.update({Histogram: SideHistogramPlot, From 375956f881e4a988fed333aa983f7d1dbb07bac4 Mon Sep 17 00:00:00 2001 From: jlstevens Date: Fri, 7 Jul 2017 03:20:54 +0100 Subject: [PATCH 5/5] Minor whitespace change --- holoviews/plotting/mpl/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/holoviews/plotting/mpl/__init__.py b/holoviews/plotting/mpl/__init__.py index ee791dcabd..c81d14cb95 100644 --- a/holoviews/plotting/mpl/__init__.py +++ b/holoviews/plotting/mpl/__init__.py @@ -159,8 +159,7 @@ def grid_selector(grid): Box: PathPlot, Bounds: PathPlot, Ellipse: PathPlot, - Polygons: PolygonPlot}, - 'matplotlib', style_aliases=style_aliases) + Polygons: PolygonPlot}, 'matplotlib', style_aliases=style_aliases) MPLPlot.sideplots.update({Histogram: SideHistogramPlot,