多重绘图Seaborn和轴特定(如图所示)

时间:2018-08-06 17:34:32

标签: python matplotlib plot seaborn

我想用Python在Seaborn(或Matplotlib)中制作一个网格图,如下图所示。各个图的代码如下:

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()

但是我要编辑一个带有轴标签的4x4图形,如下所示:Desired Multiplot (created in InkScape)

这就是说:

  • 一个颜色条
  • LHS底部行和列上的标签
  • 所有图上的
  • yticks,但底行上的xticks
  • 适当的间距

0 个答案:

没有答案