def profiles_sub(areas, ax1, cases, linestd, linestd_nn, var, varl):
    for case, ls in zip(cases, linests):
        linestd[case] = ls
        linestd_nn[get_nice_name_case(case)] = ls
    ax = ax1  # plt.subplots(1, figsize=[6,8])
    for area in areas:
        prof_dic = get_averaged_fields.get_profiles(
            cases,
            varl,
            startyear,
            endyear,
            area=area,
            pressure_adjust=pressure_adjust)

        for case in cases:
            kwargs = dict(color=get_area_col(area), linestyle=linestd[case])
            plot_profile(prof_dic[case][var],
                         ax=ax,
                         kwargs=kwargs,
                         xscale='linear',
                         label=case + ', ' + area,
                         ylim=[1000, 200])  # ,
    ax.grid(False, which='both')
    sns.despine(ax=ax)
    #ax.set_yscale('log')
    set_scalar_formatter(ax)
Beispiel #2
0
def plt_prof_map_together(var, areas, cases, asp_rat=1, width=6):
    fig = plt.figure(figsize=[width, asp_rat * width])
    gs = gridspec.GridSpec(2, 2, height_ratios=[1, 1.],
                           width_ratios=[5, 1])  #width_ratios=[2, 1])
    ax1 = plt.subplot(gs[1, 0])
    ax2 = plt.subplot(gs[1, 1])
    ax3 = plt.subplot(gs[0, :], projection=ccrs.Robinson())
    ax2.axis('off')

    cmapd = get_cmap_dic(areas)

    linestd = dict()
    linestd_nn = dict()
    for case, ls in zip(cases, linests):
        linestd[case] = ls
        linestd_nn[get_nice_name_case(case)] = ls
    ax = ax1  # plt.subplots(1, figsize=[6,8])

    for area in areas:
        prof_dic = get_averaged_fields.get_profiles(
            cases, [var],
            startyear,
            endyear,
            area=area,
            pressure_adjust=pressure_adjust)

        for case in cases:
            kwargs = dict(color=get_area_col(area), linestyle=linestd[case])
            plot_profile(prof_dic[case][var],
                         ax=ax,
                         kwargs=kwargs,
                         xscale='log',
                         label=case + ', ' + area,
                         ylim=[1000, 200])  #,
    ax.grid(False, which='both')
    sns.despine(ax=ax)
    ax.set_yscale('log')

    set_scalar_formatter(ax)
    cases_nn = [get_nice_name_case(case) for case in cases]
Beispiel #3
0
                                               pressure_adjust=pressure_adjust)
 
     for case in cases:
         kwargs = dict(color=get_area_col(area), linestyle=linestd[case])
         plot_profile(prof_dic[case][var], 
                      ax=ax, 
                      kwargs=kwargs, 
                      xscale='log', 
                      label=case+', '+ area,
                      ylim=[1000,200])#, 
 ax.grid(False, which='both')
 sns.despine(ax=ax)
 ax.set_yscale('log')
 
 
 set_scalar_formatter(ax)
 
 # maps:
 if var_map is not None:
     var=var_map
 maps_dic = get_averaged_fields.get_maps_cases(cases,[var],startyear, endyear,
                                    avg_over_lev=avg_over_lev,
                                    pmin=pmin,
                                    pressure_adjust=pressure_adjust)
 
 plot_map(var, cases[0], maps_dic, figsize=None,
          ax=ax3, cmap_abs='Reds', cbar_orientation='horizontal', kwargs_abs=map_kwargs)
 
 
 
 #plt.tight_layout()