I'm trying to get the python tables for a bar plot to be aligned. For example in the attached graph, you'll see that x-axis is not properly aligned to the vertical line that is down by the python table.
I tried modifying the scale of the figure
I want the font size of the table to be 40 so that it will be visible when i print the IEEEtran paper.
#!/usr/bin/env python
import csv
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
def plot_bar(dataset):
matplotlib.rc('font', family='sans-serif')
matplotlib.rc('font', serif='Helvetica Neue')
matplotlib.rc('text', usetex='false')
matplotlib.rcParams.update({'font.size': 30})
fig = plt.figure()
ax = fig.add_subplot(111)
fig = matplotlib.pyplot.gcf()
fig.set_size_inches(30.0,7.5)
N = len(dataset[1])
Load = dataset[0]
QoS = dataset[1]
Energy = dataset[2]
ind = np.arange(N)
width = 0.35
plt.tick_params(axis='both', which='major', labelsize=35, pad=15)
plt.tick_params(axis='y', which='minor', labelsize=35, pad=15)
rects1 = ax.bar(ind, QoS, width,
color='0.2',
label='HP')
rects3 = ax.bar(ind+width, Energy, width,
color='0.4',
label='OM')
lns = [rects1, rects3]
labs = [l.get_label() for l in lns]
ax.legend(lns, labs, ncol=2)
ax.set_xlim(-width,len(ind)+width)
ax.set_ylim(0, 16000)
ax.set_ylabel('RPS/Watt', fontsize=35)
ax.set_xlabel('Percentage of Max Capacity', fontsize=35)
xTickMarks = dataset[0]
ax.set_xticks(ind+width)
xtickNames = ax.set_xticklabels(xTickMarks)
plt.setp(xtickNames, rotation=0, fontsize=40)
plt.xticks([])
ax.yaxis.grid()
cell_text = [['2S-0.65GHz', '3S-0.65GHz', '4S-0.65GHz', '4S-0.65GHz', '2B2S-1.15GHz', '2B2S-1.15GHz', '3B2S-1.15GHz', '2B-1.15GHz', '2B-1.15GHz', '2B-1.15GHz', '2B-1.15GHz','2B-1.15GHz', '2B-1.15GHz', '2B-1.15GHz', '2B-1.15GHz', '2B-1.15GHz'],
['2S-0.65GHz', '3S-0.65GHz', '4S-0.65GHz', '4S-0.65GHz', '2B-1.15GHz', '2B-1.15GHz', '2B-1.15GHz', '2B-1.15GHz', '2B-1.15GHz', '2B-1.15GHz', '2B-1.15GHz', '2B-1.15GHz', '2B-1.15GHz', '2B-1.15GHz', '2B-1.15GHz', '2B-1.15GHz']]
colors=['0.2','0.4']
rows = ['HP','OM']
Loc='right'
the_table = plt.table(cellText=cell_text,
rowLabels=rows,
colLabels=Load,
rowColours=colors,
cellLoc='right',
loc='bottom')
the_table.scale(1,2.5)
the_table.auto_set_font_size(False)
the_table.set_fontsize(12)
plt.subplots_adjust(left=0.2, bottom=0.2)
ax.xaxis.labelpad = 70
ax.yaxis.labelpad = 20
fig.savefig('rps-watt' +'.eps',format='eps',bbox_inches='tight', pad_inches=0.1, dpi=1000)
dataset = [['29%', '40%', '51%', '63%', '69%', '71%', '74%', '77%', '80%', '83%', '86%', '89%', '91%', '94%', '97%', '100%'], [6524.0, 8749.0, 10470.0, 13096.0, 13126.0, 12965.0, 13493.0, 13717.0, 14351.0, 14993.0, 15308.0, 14320.0, 13179.0, 9809.0, 10168.0, 10621.0], [6524.0, 8749.0, 10470.0, 13096.0, 6827.0, 5586.0, 7697.0, 8205.0, 8298.0, 8733.0, 8887.0, 9278.0, 9659.0, 9809.0, 10168.0, 10621.0]]
plot_bar(dataset)

