Created
January 6, 2017 19:03
-
-
Save seufagner/c06c6f52c590e7909667f78ebc96aa6d to your computer and use it in GitHub Desktop.
show plots from matplotlib on zeppelin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%pyspark | |
import os | |
import matplotlib.pyplot as plt; plt.rcdefaults() | |
import numpy as np | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
import StringIO | |
import matplotlib | |
matplotlib.style.use('ggplot') | |
plt.rcdefaults() | |
plt.switch_backend('agg') | |
def show(p): | |
img = StringIO.StringIO() | |
p.savefig(img, format='svg') | |
img.seek(0) | |
print "%html <div style='width:600px'>" + img.buf + "</div>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment