From 99731be69db85c1226d81ff7ab537fb66f6cc70f Mon Sep 17 00:00:00 2001
From: Philipp Rudiger
Date: Mon, 10 Apr 2017 17:25:11 +0100
Subject: [PATCH 1/2] Ensure mpl aspect is regular float avoiding warnings
---
holoviews/plotting/mpl/element.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/holoviews/plotting/mpl/element.py b/holoviews/plotting/mpl/element.py
index 7a9d47f0d1..57585ada3e 100644
--- a/holoviews/plotting/mpl/element.py
+++ b/holoviews/plotting/mpl/element.py
@@ -308,7 +308,7 @@ def _set_aspect(self, axes, aspect):
data_ratio = 1./(ysize/xsize)
if aspect != 'square':
data_ratio = data_ratio/aspect
- axes.set_aspect(data_ratio)
+ axes.set_aspect(float(data_ratio))
def _set_axis_limits(self, axis, view, subplots, ranges):
From dc8000fdfbb103e87e64f3ec7b7ea66eeb8b9c29 Mon Sep 17 00:00:00 2001
From: Philipp Rudiger
Date: Mon, 10 Apr 2017 17:25:49 +0100
Subject: [PATCH 2/2] Small fix for unit tests in matplotlib 2.0
---
tests/testplotinstantiation.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/testplotinstantiation.py b/tests/testplotinstantiation.py
index 787266885d..21e3518a23 100644
--- a/tests/testplotinstantiation.py
+++ b/tests/testplotinstantiation.py
@@ -135,10 +135,9 @@ def test_dynamic_streams_refresh(self):
dmap = DynamicMap(lambda x, y: Points([(x, y)]),
kdims=[], streams=[stream])
plot = mpl_renderer.get_plot(dmap)
- plot.initialize_plot()
pre = mpl_renderer(plot, fmt='png')
+ plot.state.set_dpi(72)
stream.update(x=1, y=1)
- plot.refresh()
post = mpl_renderer(plot, fmt='png')
self.assertNotEqual(pre, post)
@@ -156,6 +155,7 @@ def history_callback(x, history=deque(maxlen=10)):
plot = mpl_renderer.get_plot(dmap)
mpl_renderer(plot)
for i in range(20):
+ plot.state.set_dpi(72)
stream.update(x=i)
x, y = plot.handles['artist'].get_data()
self.assertEqual(x, np.arange(10))