Skip to content

Instantly share code, notes, and snippets.

@nipunbatra
Last active August 29, 2015 13:56
Show Gist options
  • Save nipunbatra/8950905 to your computer and use it in GitHub Desktop.
Save nipunbatra/8950905 to your computer and use it in GitHub Desktop.
from nilmtk.plots import latexify, format_axes
import matplotlib.pyplot as plt
latexify(columns=1)
from mpltools import style
style.use('ggplot')
x = ["India", "USA", "China", "Korea", "Australia"]
y = [47, 29, 34, 26, 20]
fig, ax = plt.subplots()
ax.bar(range(len(y)), y)
format_axes(ax)
plt.xticks([0.5 + i for i in range(5)], x)
plt.ylabel(r"\% energy contribution")
plt.savefig("/home/nipun/Desktop/contribution.pdf")
plt.savefig("/home/nipun/Desktop/contribution.png")
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment