KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Can't seem to locate in the documentation how to increase the line-height of the cells, as the text itself is very cramped. Any help with code is appreciated! Table formatting doesn't seem to be well documented... # Plot line width matplotlib.rc('lines', linewidth=3) ind = np.arange(len(overall)) fig = pyplot.figure() ax = fig.add_subplot(211) ax.set_title('Overall Rating of Experience') ax.set_ylabel('Score (0-100)') # Plot data on chart plot1 = ax.plot(ind, overall) plot2 = ax.plot(ind, svc_avg) plot3 = ax.plot(ind, benchmark) ax.yaxis.grid(True, which='major', ls='-', color='#9F9F9F') ax.set_ylim([min(overall + svc_avg + benchmark) - 3, 100]) ax.set_xlim([-.5,1.5]) ax.get_xaxis().set_ticks([]) ax.set_position([.25, .3, 0.7, 0.5]) colLabels = ['July', 'August'] rowLabels = ['Average', 'Service Average', 'Benchmark'] cellText = [overall, svc_avg, benchmark] the_table = ax.table(cellText=cellText, rowLoc='right', rowColours=colors, rowLabels=rowLabels, colWidths=[.5,.5], colLabels=colLabels, colLoc='center', loc='bottom') EDIT: Thanks to Oz for the answer-- Looping through the properties of the table allows easy modification of the height property: table_props = the_table.properties() table_cells = table_props['child_artists'] for cell in table_cells: cell.set_height(0.1)
Tags (comma-separated)
Save Edits
Cancel