From f921f4a04255c681a1fa1cf8a38088cfb044e70a Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Fri, 16 Sep 2016 13:48:01 +0200 Subject: [PATCH 1/7] Added labelled plot option for bokeh plots --- holoviews/plotting/bokeh/element.py | 10 ++++++---- holoviews/plotting/bokeh/plot.py | 4 ++-- holoviews/plotting/bokeh/tabular.py | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/holoviews/plotting/bokeh/element.py b/holoviews/plotting/bokeh/element.py index 2a4ce0b231..4a0148d4da 100644 --- a/holoviews/plotting/bokeh/element.py +++ b/holoviews/plotting/bokeh/element.py @@ -82,6 +82,9 @@ class ElementPlot(BokehPlot, GenericElementPlot): invert_yaxis = param.Boolean(default=False, doc=""" Whether to invert the plot y-axis.""") + labelled = param.List(default=['x', 'y'], doc=""" + Whether to plot the 'x' and 'y' labels.""") + lod = param.Dict(default={'factor': 10, 'interval': 300, 'threshold': 2000, 'timeout': 500}, doc=""" Bokeh plots offer "Level of Detail" (LOD) capability to @@ -161,8 +164,7 @@ class ElementPlot(BokehPlot, GenericElementPlot): # instance attribute. _update_handles = ['source', 'glyph'] - def __init__(self, element, plot=None, show_labels=['x', 'y'], **params): - self.show_labels = show_labels + def __init__(self, element, plot=None, **params): self.current_ranges = None super(ElementPlot, self).__init__(element, **params) self.handles = {} if plot is None else self.handles['plot'] @@ -285,8 +287,8 @@ def _init_plot(self, key, element, plots, ranges=None): xlabel, ylabel, _ = labels x_axis_type, y_axis_type = axis_types properties = dict(plot_ranges) - properties['x_axis_label'] = xlabel if 'x' in self.show_labels else ' ' - properties['y_axis_label'] = ylabel if 'y' in self.show_labels else ' ' + properties['x_axis_label'] = xlabel if 'x' in self.labelled else ' ' + properties['y_axis_label'] = ylabel if 'y' in self.labelled else ' ' if self.show_title: title = self._format_title(key, separator=' ') diff --git a/holoviews/plotting/bokeh/plot.py b/holoviews/plotting/bokeh/plot.py index 4624a59544..cfc509fb86 100644 --- a/holoviews/plotting/bokeh/plot.py +++ b/holoviews/plotting/bokeh/plot.py @@ -389,11 +389,11 @@ def _create_subplots(self, layout, positions, layout_dimensions, ranges, num=0): yaxis = 'right-bare' if 'bare' in plot_type.yaxis else 'right' side_opts = dict(height=main_plot.height, yaxis=yaxis, width=plot_type.width, invert_axes=True, - show_labels=['y'], xticks=1, xaxis=main_plot.xaxis) + labelled=['y'], xticks=1, xaxis=main_plot.xaxis) else: xaxis = 'top-bare' if 'bare' in plot_type.xaxis else 'top' side_opts = dict(width=main_plot.width, xaxis=xaxis, - height=plot_type.height, show_labels=['x'], + height=plot_type.height, labelled=['x'], yticks=1, yaxis=main_plot.yaxis) # Override the plotopts as required diff --git a/holoviews/plotting/bokeh/tabular.py b/holoviews/plotting/bokeh/tabular.py index 9f69009680..22dea732c5 100644 --- a/holoviews/plotting/bokeh/tabular.py +++ b/holoviews/plotting/bokeh/tabular.py @@ -19,7 +19,7 @@ class TablePlot(BokehPlot, GenericElementPlot): _update_handles = ['source', 'glyph'] - def __init__(self, element, plot=None, show_labels=['x', 'y'], **params): + def __init__(self, element, plot=None, **params): super(TablePlot, self).__init__(element, **params) self.handles = {} if plot is None else self.handles['plot'] element_ids = self.hmap.traverse(lambda x: id(x), [Dataset, ItemTable]) From cfd63eddea9599a53fc832d43fc91a54eee573d1 Mon Sep 17 00:00:00 2001 From: Jean-Luc Stevens Date: Fri, 16 Sep 2016 20:37:57 +0100 Subject: [PATCH 2/7] Add mybinder.org launch badge --- README.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 01810444ce..90b343c07b 100644 --- a/README.rst +++ b/README.rst @@ -1,4 +1,4 @@ -|BuildStatus|_ |holoviewsDocs|_ |PyPI|_ |License|_ |Coveralls|_ |Downloads|_ |Gitter|_ +|BuildStatus|_ |holoviewsDocs|_ |PyPI|_ |License|_ |Coveralls|_ |Downloads|_ |Gitter|_ |MyBinder|_ holoviews ========= @@ -104,3 +104,6 @@ Features .. |Gitter| image:: https://badges.gitter.im/Join%20Chat.svg .. _Gitter: https://gitter.im/ioam/holoviews?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge + +.. |MyBinder| image:: http://mybinder.org/badge.svg +.. _MyBinder: http://mybinder.org/repo/ioam/holoviews From 0de76b61b451346470c55962319595f2a08eb7ed Mon Sep 17 00:00:00 2001 From: jlstevens Date: Fri, 16 Sep 2016 21:31:17 +0100 Subject: [PATCH 3/7] Skipping archive.add in display_hooks for FileArchives --- holoviews/ipython/display_hooks.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/holoviews/ipython/display_hooks.py b/holoviews/ipython/display_hooks.py index ea4ea49c01..11bfe1ccfa 100644 --- a/holoviews/ipython/display_hooks.py +++ b/holoviews/ipython/display_hooks.py @@ -13,6 +13,7 @@ HoloMap, AdjointLayout, NdLayout, GridSpace, Layout, CompositeOverlay, DynamicMap) from ..core.traversal import unique_dimkeys +from ..core.io import FileArchive from .magics import OutputMagic, OptsMagic # To assist with debugging of display hooks @@ -112,7 +113,8 @@ def wrapped(element): # Only want to add to the archive for one display hook... disabled_suffixes = ['png_display', 'svg_display'] if not any(fn.__name__.endswith(suffix) for suffix in disabled_suffixes): - holoviews.archive.add(element, html=html) + if type(holoviews.archive) is not FileArchive: + holoviews.archive.add(element, html=html) filename = OutputMagic.options['filename'] if filename: Store.renderers[Store.current_backend].save(element, filename) From ffe1ae086fbc8dbc4d1cd9ef3987fedc8c912d84 Mon Sep 17 00:00:00 2001 From: stonebig Date: Sun, 18 Sep 2016 15:47:51 +0200 Subject: [PATCH 4/7] matplotlib2.0.0b4 compatibility fix (1/2) https://github.com/ioam/holoviews/issues/866 --- holoviews/plotting/mpl/element.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/holoviews/plotting/mpl/element.py b/holoviews/plotting/mpl/element.py index 1ef1dbc7c4..2c82f0c30c 100644 --- a/holoviews/plotting/mpl/element.py +++ b/holoviews/plotting/mpl/element.py @@ -15,6 +15,7 @@ from ..util import dynamic_update from .plot import MPLPlot from .util import wrap_formatter +from distutils.version import LooseVersion class ElementPlot(GenericElementPlot, MPLPlot): @@ -149,8 +150,11 @@ def _finalize_axis(self, key, title=None, dimensions=None, ranges=None, xticks=N subplots = list(self.subplots.values()) if self.subplots else [] if self.zorder == 0 and key is not None: if self.bgcolor: - axis.set_axis_bgcolor(self.bgcolor) - + if LooseVersion(mpl.__version__) <= '1.5.9': + axis.set_axis_bgcolor(self.bgcolor) + else: + axis.set_facecolor(self.bgcolor) + # Apply title title = None if self.zorder > 0 else self._format_title(key) if self.show_title and title is not None: From 9906bc114ea2f5694bc9d73b321a7d8f06cb1e56 Mon Sep 17 00:00:00 2001 From: stonebig Date: Sun, 18 Sep 2016 15:53:10 +0200 Subject: [PATCH 5/7] matplotlib2.0.0b4 compatibility fix (1/2) #866 --- holoviews/plotting/mpl/chart3d.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/holoviews/plotting/mpl/chart3d.py b/holoviews/plotting/mpl/chart3d.py index dd7a1b3e19..86c7b5d035 100644 --- a/holoviews/plotting/mpl/chart3d.py +++ b/holoviews/plotting/mpl/chart3d.py @@ -80,7 +80,10 @@ def _finalize_axis(self, key, **kwargs): if self.disable_axes: axis.set_axis_off() - axis.set_axis_bgcolor(self.bgcolor) + if LooseVersion(mpl.__version__) <= '1.5.9': + axis.set_axis_bgcolor(self.bgcolor) + else: + axis.set_facecolor(self.bgcolor) return super(Plot3D, self)._finalize_axis(key, **kwargs) From 1dfc716be20dddacf3d44e2a6a6c1d78f20ae53c Mon Sep 17 00:00:00 2001 From: stonebig Date: Sun, 18 Sep 2016 16:08:05 +0200 Subject: [PATCH 6/7] missing mpl to test mpl.__version__ --- holoviews/plotting/mpl/element.py | 1 + 1 file changed, 1 insertion(+) diff --git a/holoviews/plotting/mpl/element.py b/holoviews/plotting/mpl/element.py index 2c82f0c30c..5a6ff78630 100644 --- a/holoviews/plotting/mpl/element.py +++ b/holoviews/plotting/mpl/element.py @@ -2,6 +2,7 @@ import param import numpy as np +import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib import ticker from matplotlib import colors From 43456377f6f5eb9272619bba6b5a4ef31314bb92 Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Mon, 19 Sep 2016 13:45:43 +0200 Subject: [PATCH 7/7] Pinned pyqt=4.11 on travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7e95983285..8c6ddd4900 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ install: - conda update -q conda # Useful for debugging any issues with conda - conda info -a - - conda create -q -c scitools -n test-environment python=$TRAVIS_PYTHON_VERSION scipy numpy freetype nose matplotlib bokeh pandas jupyter ipython=4.2.0 param iris xarray + - conda create -q -c scitools -n test-environment python=$TRAVIS_PYTHON_VERSION scipy numpy freetype nose matplotlib bokeh pandas jupyter ipython=4.2.0 param iris xarray pyqt=4.11 - source activate test-environment - if [[ "$TRAVIS_PYTHON_VERSION" == "3.4" ]]; then conda install python=3.4.3;