Skip to content
Snippets Groups Projects
update_barplot.py 1.03 KiB
Newer Older
Venkat Malladi's avatar
Venkat Malladi committed
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd

N = 7
men_means = (20, 35, 30, 35, 27)

pts = np.array([
    179, 49, 189, 55720, 907, 12592, 153356])

df = pd.DataFrame([
    609, 254, 357, 55566, 3754, 12510, 153327])
Venkat Malladi's avatar
Venkat Malladi committed

ind = np.arange(N)  # the x locations for the groups
width = 0.35       # the width of the bars


f, axis = plt.subplots(2, 1, sharex=True)
df.plot(kind='bar', ax=axis[0])
df.plot(kind='bar', ax=axis[1])
axis[0].set_ylim(8000, 170000)
axis[1].set_ylim(0, 4000)
Venkat Malladi's avatar
Venkat Malladi committed
axis[1].legend().set_visible(False)

axis[0].spines['bottom'].set_visible(False)
axis[1].spines['top'].set_visible(False)
axis[0].xaxis.tick_top()
axis[0].tick_params(labeltop='off')
axis[1].xaxis.tick_bottom()
d = .015
Venkat Malladi's avatar
Venkat Malladi committed
kwargs = dict(transform=axis[0].transAxes, color='#1E8EC9', clip_on=False)
axis[0].plot((-d,+d),(-d,+d), **kwargs)
axis[0].plot((1-d,1+d),(-d,+d), **kwargs)
kwargs.update(transform=axis[1].transAxes)
axis[1].plot((-d,+d),(1-d,1+d), **kwargs)
axis[1].plot((1-d,1+d),(1-d,1+d), **kwargs)
plt.savefig('Histone_barplot.png')
plt.clf()