I would like to make a gridplot in Seaborn (or Matplotlib) in Python as shown in the image attached below. The code for the individual plots is as follows:
import os, sys
import pandas as pd
from math import *
import numpy as np
import matplotlib.pyplot as pt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import matplotlib.gridspec as gridspec
import seaborn as sns
from Data_handling import * #own code
u_arr, v_arr = load_arrays(full_path, profile_name)
N, n = u_arr.shape[1], u_arr.shape[0]
t_max = 0.5*(n-1)
xs = np.linspace(0, L-(L/N), N)
ys = np.linspace(0, t_max, n)
X, Y = np.meshgrid(xs, ys)
pt.xlabel('x', fontsize = 18)
pt.ylabel('Time', fontsize = 18)
pt.contour(X, Y, u_arr.real, 20, cmap='RdGy')
pt.imshow(u_arr.real, extent=[xs[0], xs[-1], ys[0], ys[-1]],
vmin=0, vmax=1, origin='lower', cmap='RdGy', aspect='auto')
pt.colorbar()
pt.savefig(
os.path.join(full_path,
os.path.join(
os.path.join('ST_Figures', 'u_profile'),
'i={0}_k={1}_F={2}_dt={3}_tmax={4}.png'.format(
i, k, F,
str(dt).replace('.', ','), str(t_max).replace('.', ',')))),
dpi=500)
pt.close()
but I would edit to have a 4x4 graph plot with the axis labels as shown here: Desired Multiplot (created in InkScape)
That's to say:
- one colorbar
- labels on the bottow row and column on the LHS
- yticks on all plots, but xticks on only the bottom row
- decent spacing