import matplotlib.pyplot as plt
import numpy as np
from common_lib.plot_setting.variable_length_subplots import GENERATE_AXIS_ALONG_ROW



def GENERATE_AXIS(flag_plot):

    if flag_plot == "Plot_DTV_Field":
        out_dict = PLOT_1_DTV_Field()


    fig_width        = out_dict["fig_width"]
    fig_height       = out_dict["fig_height"]
    r_sum            = out_dict["r_sum"]
    c_sum            = out_dict["c_sum"]
    xy_coord_dict    = out_dict["xy_coord_dict"]
    row_col_len_dict = out_dict["row_col_len_dict"]
    fig              = plt.figure(figsize=(fig_width,fig_height))
    ax               = GENERATE_AXIS_ALONG_ROW(plt,xy_coord_dict,row_col_len_dict,r_sum,c_sum)
    return fig,ax

def PLOT_1_DTV_FIELD():
    fig_width      = 30.0
    fig_height     = 30.0
    r1,r2,r3       = 4,4,4
    c1,c2,c3       = 4,4,4
    r_sum          = r1+r2+r3
    c_sum          = c1+c2+c3

    xy_coord_dict    = [\
                        (0,0),\
                        (0,c1),\
                        (0,c1+c2),\
                        (r1,0),\
                        (r1,c1),\
                        (r1,c1+c2),\
                        (r1+r2,0),\
                        (r1+r2,c1),\
                        (r1+r2,c1+c2),\
                       ]

    row_col_len_dict = [\
                        (r1,c1),\
                        (r1,c2),\
                        (r1,c3),\
                        (r2,c1),\
                        (r2,c2),\
                        (r2,c3),\
                        (r3,c1),\
                        (r3,c2),\
                        (r3,c3),\
                       ]

    out_dict = vars()
    return out_dict 

