Skip to content

Instantly share code, notes, and snippets.

@jorgemarsal
Created October 25, 2015 19:32
Show Gist options
  • Save jorgemarsal/21c724c1f4439c8c256c to your computer and use it in GitHub Desktop.
Save jorgemarsal/21c724c1f4439c8c256c to your computer and use it in GitHub Desktop.
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
sns.set(style="white", context="talk")
# Set up the matplotlib figure
f, (ax1) = plt.subplots(1, 1, figsize=(10, 6), sharex=True)
# Specify data
x = np.array(['read.csv','HDFS connector\n1 core','HDFS connector\n2 cores', 'HDFS connector\n4 cores'])
y1 = np.array([31.477,30.874,16.529,10.032])
plot = sns.barplot(x, y1, palette="BuGn_d", ax=ax1)
ax1.set_ylabel("Time (secs)")
# Finalize the plot
sns.despine(bottom=True)
plt.setp(f.axes, yticks=[])
plt.tight_layout(h_pad=3)
plot.get_figure().savefig('/tmp/test.png',bbox_inches='tight')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment