python - Pyplot bar chart does not match table columns position with all bars -


i'm building bar graph table using code example.

everything looks when have 10 columns, above 10 columns bars shifted left , not match position of table columns. happens odd number of columns/bars (e.g. 11 , 13, not 12 , 14 looks good). looks x-axis columns 11 , 13 keeps space columns 12 , 14. i've enclosed code changes i've made above example in order reproduce problem with.

i've been struggling long , did not find on web, appreciate help.

the modified contents example:

data = [[  66386,  174296,   75131,  577908,   32015,  66386,  174296,   75131,  577908,   32015,  100000,  75131,  174296],         [  58230,  381139,   78045,   99308,  160454,  58230,  381139,   78045,   99308,  160454,  100000,  75131,  174296],         [  89135,   80552,  152558,  497981,  603535,  89135,   80552,  152558,  497981,  603535,  100000,  75131,  174296],         [  78415,   81858,  150656,  193263,   69638,  78415,   81858,  150656,  193263,   69638,  100000,  75131,  174296],         [ 139361,  331509,  343164,  781380,   52269, 139361,  331509,  343164,  781380,   52269,  100000,  75131,  174296]]  collabels = ('freeze', 'wind', 'flood', 'quake', 'hail', 'freeze2', 'wind2', 'flood2', 'quake2', 'hail2', '11th', "12th", "13th") 

make sure specify xlim:

xlim(0,len(collabels)) 

plot aligned table

if don't, matplotlib autoscale x-axis, not want in case, table underneath plot tied location of actual bars.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -