Skip to content

Instantly share code, notes, and snippets.

@vaer-k
Forked from andershammar/matplotlib-zeppelin
Last active September 29, 2017 21:58
Show Gist options
  • Save vaer-k/7859fec52db7faa08026dd699c76e7d5 to your computer and use it in GitHub Desktop.
Save vaer-k/7859fec52db7faa08026dd699c76e7d5 to your computer and use it in GitHub Desktop.
Example showing how to use matplotlib from a Zeppelin notebook
%pyspark
import matplotlib.pyplot as plt
z.configure_mpl(width=400, height=300, fmt='svg')
# Example data
people = ('Goku', 'Vegeta', 'Gohan', 'Raditz', 'Trunks')
y_pos = np.arange(len(people))
performance = 3 + 10 * np.random.rand(len(people))
error = np.random.rand(len(people))
plt.barh(y_pos, performance, xerr=error, align='center', alpha=0.4)
plt.yticks(y_pos, people)
plt.xlabel('Times')
plt.title('How many times have they gone super saiyan today?')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment