I want to separate or increase the distance of my table and my graph so they don't layover. I thought of increasing the size to right and put the table there but I can't seem to make it work, and I can't find a way to offset the table by 1 line.
Graph
global dataread
global top4
global iV
top4mod = [] #holder for table, combines amplitude and frequency (bin*3.90Hz)
plt.plot(x1, fy1, '-') #plot x-y
plt.axis([0, 500, 0, 1.2]) #range for x-y plot
plt.xlabel('Hz')
columns = ('Frequency','Hz')
rows = ['# %d' % p for p in (1,2,3,4)] #top4
colors = 'C0'
print(len(rows))
print(len(str(top4)))
print(top4)
iV=[d*bins for d in iV] # convert bins into frequency
i=0;
FirstCol = [4, 3, 2, 1]
while i < 4:
Table.append([iV[i]] + [top4[i]])#[FirstCol[i]]
i = i+1
cell_text = []
n_rows = len(Table)
index = np.arange(len(columns)) + 1 #0.3 orginal
bar_width = 0.4
y_offset = np.array([0.0] * len(columns))
for row in range(n_rows):
#plt.bar(index, Table[row], bar_width, bottom=y_offset, color='C0') #dont use this
y_offset = y_offset + Table[row]
cell_text.append(['%1.1f' % p for p in y_offset])
the_table = plt.table(cellText=Table,rowLabels=rows, colLabels=columns,loc='bottom')
#plt.figure(figsize=(7,8))
# Adjust layout to make room for the table:
plt.subplots_adjust(bottom=0.2) #left=0.2, bottom=0.2
plt.show() #display plot
tight_layout()
, so that does not help. – Fernandez