Does anyone know how I can make a plot like the one shown above? I know how to make the plot after the 2 rows, but I'm not sure how I can add a vertical separator and then another 2 rows above it, as shown above.
By the way, I'm only referring to the STRUCTURE of the plot and not of the content.
Here's the code I can use for the portion after the first 2 rows:
import matplotlib.pyplot as plt
import numpy as np
f, axarr = plt.subplots(nrows=10, ncols=10,
figsize=(4,4),
gridspec_kw={'hspace': 0, 'wspace': 0})
for dim in range(10):
samples = np.random.rand(10, 256, 256, 1)
for sample_idx in range(10):
axarr[dim][sample_idx].imshow(samples[sample_idx,:,:,0],
cmap='gray')
axarr[dim][sample_idx].set_axis_off()
plt.subplots_adjust(wspace=0.1, hspace=0.1, left=0, right=1, bottom=0, top=1)
plt.show()
EDIT: I've tried some of the suggested solutions and here is what I got:
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.gridspec as gridspec
plt.subplots_adjust(hspace=0.01)
outer = gridspec.GridSpec(2, 1, height_ratios = [2, 10], hspace=.2)
gs1 = gridspec.GridSpecFromSubplotSpec(2, 10, subplot_spec=outer[0], hspace=0.01)
gs2 = gridspec.GridSpecFromSubplotSpec(10, 10, subplot_spec=outer[1], hspace=0.01)
for i in range(2):
for j in range(10):
ax = plt.subplot(gs1[i,j])
ax.plot()
ax.get_xaxis().set_visible(False)
ax.get_yaxis().set_visible(False)
for i in range(10):
for j in range(10):
ax = plt.subplot(gs2[i,j])
ax.plot()
ax.get_xaxis().set_visible(False)
ax.get_yaxis().set_visible(False)
plt.show()
Overall, the structure is what I want but how can I get rid of those dark black lines in the 3 rows?