Repository: zeppelin
Updated Branches:
  refs/heads/branch-0.7 ca62d386a -> a45ef6bdc


[HOTFIX][ZEPPELIN-1980] - Test and update CI for matplotlib 2.0.0

### What is this PR for?
Matplotlib 2.0.0 was just released. It has introduced some major changes 
including some to the `rcParams` which makes it incompatible with Zeppelin's 
built-in plotting backend. This PR updates the backend config for 2.0.0 as well 
as the CI tests.

### What type of PR is it?
Hot Fix

### What is the Jira issue?
[ZEPPELIN-1980](https://issues.apache.org/jira/browse/ZEPPELIN-1980)

### How should this be tested?
Run the matplotlib tutorial notebook with matplotlib 2.0.0 installed.

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No

If possible, this should be included as a hotfix for 0.7.0.

Author: Alex Goodman <ago...@users.noreply.github.com>

Closes #1912 from agoodm/ZEPPELIN-1980 and squashes the following commits:

202548c [Alex Goodman] Use figure.dpi instead of savefig.dpi
2678359 [Alex Goodman] Make CI install latest matplotlib

(cherry picked from commit 7941d37518a9393435680833c0828b13c77dd863)
Signed-off-by: Mina Lee <mina...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/a45ef6bd
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/a45ef6bd
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/a45ef6bd

Branch: refs/heads/branch-0.7
Commit: a45ef6bdc6a36d00385f99442a74070f9fd444b1
Parents: ca62d38
Author: Alex Goodman <ago...@users.noreply.github.com>
Authored: Wed Jan 18 16:29:20 2017 -0800
Committer: Mina Lee <mina...@apache.org>
Committed: Sun Jan 22 15:02:01 2017 +0900

----------------------------------------------------------------------
 interpreter/lib/python/mpl_config.py     | 8 ++++++--
 testing/install_external_dependencies.sh | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/a45ef6bd/interpreter/lib/python/mpl_config.py
----------------------------------------------------------------------
diff --git a/interpreter/lib/python/mpl_config.py 
b/interpreter/lib/python/mpl_config.py
index 14aa60d..e48678f 100644
--- a/interpreter/lib/python/mpl_config.py
+++ b/interpreter/lib/python/mpl_config.py
@@ -50,8 +50,12 @@ def get(key):
 def _on_config_change():
     # dpi
     dpi = _config['dpi']
-    matplotlib.rcParams['savefig.dpi'] = dpi
+    
+    # For older versions of matplotlib, savefig.dpi is not synced with
+    # figure.dpi by default
     matplotlib.rcParams['figure.dpi'] = dpi
+    if matplotlib.__version__ < '2.0.0':
+        matplotlib.rcParams['savefig.dpi'] = dpi
     
     # Width and height
     width = float(_config['width']) / dpi
@@ -75,7 +79,7 @@ def _on_config_change():
     
     
 def _init_config():
-    dpi = matplotlib.rcParams['savefig.dpi']
+    dpi = matplotlib.rcParams['figure.dpi']
     fmt = matplotlib.rcParams['savefig.format']
     width, height = matplotlib.rcParams['figure.figsize']
     fontsize = matplotlib.rcParams['font.size']

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/a45ef6bd/testing/install_external_dependencies.sh
----------------------------------------------------------------------
diff --git a/testing/install_external_dependencies.sh 
b/testing/install_external_dependencies.sh
index ebf7d0f..9382307 100755
--- a/testing/install_external_dependencies.sh
+++ b/testing/install_external_dependencies.sh
@@ -44,5 +44,5 @@ if [[ -n "$PYTHON" ]] ; then
   conda update -q conda
   conda info -a
   conda config --add channels conda-forge
-  conda install -q matplotlib=1.5.3 pandasql
+  conda install -q matplotlib pandasql
 fi

Reply via email to