I have a plot with 5 subplots, something like:
I want the right most plot to have a little more space between the other 4. With GridSpec and GridSpecFromSubplotSpec, I have tried to adjust the wspace, as done in this SO answer. For some reason changing the wspace has 0 effect however.
from itertools import product
from matplotlib import pyplot as plt
from matplotlib.gridspec import GridSpec, GridSpecFromSubplotSpec
def no_axes():
ax.get_xaxis().set_visible(False)
ax.get_yaxis().set_visible(False)
fig = plt.figure(figsize=(12,6))
gs = GridSpec(2,3)
gs1 = GridSpecFromSubplotSpec(2, 2, subplot_spec=gs[:,:2])
gs2 = GridSpecFromSubplotSpec(2, 3, subplot_spec=gs[:,2], wspace=100000000)
# first 4 plots
for rc in product([0,1], repeat=2):
ax = fig.add_subplot(gs1[rc])
ax.plot()
no_axes()
# last plot
ax = fig.add_subplot(gs2[:])
ax.plot()
no_axes()
plt.show()