space_height = 1.0 ftsize = 12 # parameters for subplots subplot_width = (plot_width - margin_left - margin_right - space_width) / 3.0 # equal aspect ratio for r, x subplot_height = subplot_width * xD_limit / rD_limit plot_height = subplot_height + margin_bottom + margin_top # parameters for colorbar clb_left = 0.4 clb_right = 1.2 clb_bottom = 3.0 clb_width = margin_right - clb_left - clb_right clb_height = subplot_height - clb_bottom # min and max of axis fig = plt.figure(figsize=cm2inch(plot_width, plot_height)) # create the first axes for instantaneous plot ax0 = fig.add_axes([ margin_left / plot_width, margin_bottom / plot_height, 2.0 * subplot_width / plot_width, subplot_height / plot_height ], aspect='equal') ax0.contourf(ri, zi, vi, 60, vmin=vmin, vmax=vmax, cmap=clmp) ax0.contour(ri, zi, Zi, [ 0.351, ], linewidths=2.0) # limits ax0.set_xlim(-rD_limit, rD_limit) ax0.set_ylim(0.0, xD_limit) # lables
space_height = 1.0 ftsize = 12 # total height determined by the number of vars plot_height = ((subplot_h + space_height) * float(len(var)) - space_height + margin_top + margin_bottom) # min and max of axis xmin = 0.0 xmax = 0.3 xtick = tuple(np.arange(xmin, xmax, 0.1)) # generate the figure fig, axes = plt.subplots(len(var), len(xD_value), sharex='col', sharey='row', figsize=fr.cm2inch(plot_width, plot_height)) # generate the axis for i, v in enumerate(var): for j, z in enumerate(xD_value): axes[i, j].plot(data[z]['r'], data[z][v], '-b', label='Sim.', linewidth=1.5) axes[i, j].plot(expr[z]['r'], expr[z][v], 'ok', label='Exp.', linewidth=1.5) # ylabel, temperature has a unit if v == 'T':
space_height = 1.0 ftsize = 12 # total height determined by the number of vars plot_height =(subplot_h+space_height)*float(len(xD)) \ -space_height+margin_top+margin_bottom # min and max of axis xmin = 0.0 xmax = 1.0 xtick = (0.0, 0.2, 0.4, 0.6, 0.8) # generate the figure fig, axes = plt.subplots(len(xD), 2, sharex='col', sharey='all', figsize=cm2inch(plot_width, plot_height)) # generate the axis for x in xD: axes[xD.index(x), 0].scatter(expr[x]['Z'], expr[x][var], marker='.', c='k', edgecolor='none') axes[xD.index(x), 1].scatter(data[x]['Z'], data[x][var], marker='.', c='k', edgecolor='none') # ylabel, temperature has a unit if var == 'T': axes[xD.index(x),
# total width is fixed plot_width = 19.0 margin_left = 1.5 margin_right = 0.3 margin_bottom = 1.2 margin_top = 0.2 space_width = 4.0 space_height = 1.0 ftsize = 12 # total height determined by the number of vars plot_height = ( (plot_width - margin_left - margin_right - space_width) / 2.0 * 0.8 + margin_bottom + margin_top) # generate the figure fig, axes = plt.subplots(1, 2, figsize=fr.cm2inch(plot_width, plot_height)) for z in xd_val: axes[0].plot(simu[z][:, 0], simu[z][:, 1], label=r"$\mathrm{{Sim.}}\quad x/D={:.2g}$".format(z), linewidth=1.5) axes[1].plot(simu[z][:, 0], simu[z][:, 2], label=r"$\mathrm{{Sim.}}\quad x/D={:.2g}$".format(z), linewidth=1.5) axes[0].plot(expr[:, 0], expr[:, 1], 'ok', label='Exp.', linewidth=1.5) axes[1].plot(expr[:, 0], expr[:, 2], 'ok', label='Exp.', linewidth=1.5) # xlabel