par1.tick_params(axis='y', colors=p2.get_color(), which='both', **tkw)
        par2.tick_params(axis='y', colors=p3.get_color(), which='both', **tkw)
        par3.tick_params(axis='y', colors=p4.get_color(), which='both', **tkw)
        host.tick_params(axis='x', **tkw)

        despine_plt(host)
        despine_plt(par1)
        despine_plt(par2)
        despine_plt(par3)
        par2.spines["right"].set_visible(True)
        par3.spines["right"].set_visible(True)

        plt.setp(par2.spines.values(), color='k', alpha=0.6)
        plt.setp(par3.spines.values(), color='k', alpha=0.6)

        host.set_xlabel(name[target], fontsize=10)

        i += 1

row_labels = [plt_config.title_dict[t] for t in target_set]
base_plot.set_row_labels(labels=row_labels,
                         axes=hosts,
                         pos=0,
                         rotation=90,
                         pad=-0.25,
                         fontsize=22)

base_plot.add_alphabet_label(6, hosts, pos=(0.05, 0.15), fontsize=13)

plt.savefig(f'tuning_uh_threshs.png', bbox_inches="tight", dpi=300)
                        target_var,
                        resample_method[target_var],
                        normalize_method[target_var],
                        imputer_method,
                        vars_to_load,
                        mode)
        ax = axes[i,j] 
        if i == 0:
            ax.set_title(plt_config.title_dict[target_var], fontsize=12) 
        base_plot.set_n_ticks(ax)
        base_plot.set_minor_ticks(ax)
        base_plot.despine_plt(ax)
        ax.grid(color='w')
        for model_name in results.keys():
            ax.plot(lead_times, results[model_name][metric], color=line_colors[model_name], label=model_name)

major_ax = base_plot.set_major_axis_labels(fig, xlabel='Lead time (minutes)', labelpad=40)
base_plot.add_alphabet_label(n_panels, axes, pos=(0.9, 0.09))
base_plot.set_legend(n_panels, fig, ax=axes.flat[0], major_ax=major_ax)

row_labels = [translate[m] for m in vars_to_load]
base_plot.set_row_labels(labels=row_labels, axes=axes, pos=0,
        rotation=90, pad=-0.2, fontsize=10)


fig_fname = f'metrics_different_lead_times_{time}.png'
my_plt._save_fig( fig=fig, fname = fig_fname)



Ejemplo n.º 3
0
plt.spatial_plotting(fig,
                     axes.flat[3],
                     x,
                     y,
                     z1=np.ma.masked_where(
                         probability_objects_labelled_severe == 0.,
                         probability_objects_labelled_severe),
                     z2=mrms_dbz,
                     z3=wofs_dbz,
                     lsr_points=lsr_points,
                     map_ax=map_axes[3],
                     z1_is_integers=True,
                     title='Matched to any LSR')

n_panels = 4
base_plot.add_alphabet_label(n_panels, axes, pos=(0.9, 0.05), fontsize=17)
additional_handles = [
    Line2D([0], [0],
           marker='o',
           color='w',
           markerfacecolor='r',
           markersize=8,
           alpha=0.8),
    Line2D([0], [0],
           marker='o',
           color='w',
           markerfacecolor='g',
           markersize=8,
           alpha=0.8),
    Line2D([0], [0], color='b', alpha=0.8, markersize=1.5),
    Line2D([0], [0], color='k', alpha=0.8, markersize=1.5),