Exemplo n.º 1
0
def plot_singular_values_and_vectors_only_time(fig_name, s, network_object,
                                               v_right, h_right, right_args):

    fig = plt.figure(constrained_layout=True)
    gs = fig.add_gridspec(2, 1, height_ratios=[1, 1], wspace=0.0, hspace=0.01)

    a0 = fig.add_subplot(gs[0, 0])  # plotting singular values
    a3 = fig.add_subplot(gs[1, 0])  # plotting right singular vectors

    plot_utils.plot_singular_values(a0, s)
    plot_utils.plot_multiple_right_singular_vectors(a3, v_right, h_right,
                                                    **right_args)

    a0.text(0.0,
            1.0,
            'A',
            horizontalalignment='left',
            transform=a0.transAxes,
            verticalalignment='top',
            fontsize=9,
            fontweight='bold')
    a3.text(0.0,
            1.0,
            'B',
            horizontalalignment='left',
            transform=a3.transAxes,
            verticalalignment='top',
            fontsize=9,
            fontweight='bold')

    fig.set_size_inches(fig_width_onecolum, 4.5)
    plt.savefig(figures_subfolder + fig_name, bbox_inches='tight')
Exemplo n.º 2
0
def plot_singular_values_and_vectors(fig_name, s, network_object, x_left,
                                     states_left, left_args, v_right, h_right,
                                     right_args):

    fig = plt.figure(constrained_layout=True)
    gs = fig.add_gridspec(2,
                          4,
                          height_ratios=[1, 1],
                          width_ratios=[7, 0.4, 1, 6],
                          wspace=0.0,
                          hspace=0.01)

    a0 = fig.add_subplot(gs[0, 0])  # plotting singular values
    a1 = fig.add_subplot(gs[:, 2])  # plotting states - left singular vectors
    a2 = fig.add_subplot(gs[:, 3])  # plotting values - left singular vectors
    a3 = fig.add_subplot(gs[1, 0])  # plotting right singular vectors

    plot_utils.plot_singular_values(a0, s)
    plot_utils.plot_multiple_left_singular_vectors(a1,
                                                   a2,
                                                   x_left,
                                                   states_left,
                                                   network_object,
                                                   sort_ids=[0, 1],
                                                   **left_args)
    plot_utils.plot_multiple_right_singular_vectors(a3, v_right, h_right,
                                                    **right_args)

    a0.text(0.0,
            1.0,
            'A',
            horizontalalignment='left',
            transform=a0.transAxes,
            verticalalignment='top',
            fontsize=9,
            fontweight='bold')
    a2.text(0.0,
            1.0,
            'B',
            horizontalalignment='left',
            transform=a2.transAxes,
            verticalalignment='top',
            fontsize=9,
            fontweight='bold')
    a3.text(0.0,
            1.0,
            'C',
            horizontalalignment='left',
            transform=a3.transAxes,
            verticalalignment='top',
            fontsize=9,
            fontweight='bold')

    fig.set_size_inches(fig_width_max, 4.5)
    plt.savefig(figures_subfolder + fig_name, bbox_inches='tight')
Exemplo n.º 3
0
def plot_appendix_simulations(fig_name,
                              x_t,
                              h,
                              s,
                              network_object,
                              states,
                              x_left,
                              left_args,
                              v_right,
                              h_right,
                              right_args,
                              xlabel_main='time (in days)',
                              color_limits=[1E-3, 1]):

    fig = plt.figure(constrained_layout=True)
    gs = fig.add_gridspec(2,
                          7,
                          height_ratios=[1, 1],
                          width_ratios=[1, 6, 0.4, 7, 0.4, 1, 6],
                          wspace=0.0,
                          hspace=0.01)

    a0_0 = fig.add_subplot(gs[:, 0])  # plotting states - full progression
    a0_1 = fig.add_subplot(gs[:, 1])  # plotting values - full progression
    a1_0 = fig.add_subplot(gs[0, 3])  # plotting singular values
    a2_0 = fig.add_subplot(gs[:, 5])  # plotting states - left singular vectors
    a2_1 = fig.add_subplot(gs[:, 6])  # plotting values - left singular vectors
    a3_0 = fig.add_subplot(gs[1, 3])  # plotting right singular vectors

    plot_utils.plot_full_states(a0_0,
                                a0_1,
                                network_object,
                                x_t,
                                states,
                                h,
                                xlabel=xlabel_main,
                                color_limits=color_limits,
                                frequency_domain=False)
    plot_utils.plot_singular_values(a1_0, s)
    plot_utils.plot_multiple_left_singular_vectors(a2_0, a2_1, x_left, states,
                                                   network_object, **left_args)
    plot_utils.plot_multiple_right_singular_vectors(a3, v_right, h_right,
                                                    **right_args)

    a0_0.text(0.0,
              1.0,
              'A',
              horizontalalignment='left',
              transform=a0.transAxes,
              verticalalignment='top',
              fontsize=9,
              fontweight='bold')
    a1_0.text(0.0,
              1.0,
              'B',
              horizontalalignment='left',
              transform=a2.transAxes,
              verticalalignment='top',
              fontsize=9,
              fontweight='bold')
    a2_0.text(0.0,
              1.0,
              'C',
              horizontalalignment='left',
              transform=a3.transAxes,
              verticalalignment='top',
              fontsize=9,
              fontweight='bold')
    a3_0.text(0.0,
              1.0,
              'D',
              horizontalalignment='left',
              transform=a3.transAxes,
              verticalalignment='top',
              fontsize=9,
              fontweight='bold')

    fig.set_size_inches(fig_width_max, 5.0)
    plt.savefig(figures_subfolder + fig_name, bbox_inches='tight')