adjusting width of subplot columns

per freem <perfreem@...83...> writes:

hi all,

i have a 3x2 subplot figure, and i would like to adjust the relative
width of the second column. in other words, if i have:

I set the axes positions by hand in these situations using add_axes(). So:

fig = plt.figure()
width1 = 0.3
width2 = 0.2
height = 0.75 / 3
left = 0.1
bottom = 0.15

axes_column0 = []
for i in range(3):
    axes_column0.append(fig.add_axes([left, bottom + i*height, width1,
                                      height]))
axes_column1 = []
for i in range(3):
    axes_column1.append(fig.add_axes([left+width1, bottom + i*height,
                                      width2, height]))
axes_column2 = []
for i in range(3):
    axes_column2.append(fig.add_axes([left+width1+width2, bottom + i*height,
                                      width1, height]))

You can adjust this slightly if you want to put gaps between the subplots,
or otherwise use axes.set_yticklabels([]) (for example) to get rid of
unwanted tick labels.

Plot to each of the subplots using something like:

axes_column0[1].plot(x,y)

Neil