Forum Discussion

NicoBoss's avatar
NicoBoss
New Member
1 year ago
Solved

Overlaying graphs with independant tables using python or ...

Good day,  I have 2 independant graphs associated to 2 independant table. table1 with x1-values y1-values and table2 with x2-values y2-values  All data are decimals, BUT x1-values do not match x2-...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi NicoBoss 

     

    Thank you very much govind_021 for your prompt reply.

     

    If Time1 is not equal to Time2, I suggest you create a bridge table as follows:

     

    “Time1”

     

    "Time2"

     

    Create a new table.

     

    Bridge Table = 
    UNION(
        SELECTCOLUMNS(
            'Table1',
            "Time",
            'Table1'[Time1]),
            SELECTCOLUMNS(
            'Table2',
            "Time",
            'Table2'[Time2])
    )

     

     

    Table1 and Table2 create relationships with the bridge table respectively.

     

     

    Create a Python visual.

     

    import matplotlib.pyplot as plt
    
    # Create figure and axis
    ax = plt.gca()
    
    dataset.plot(kind= "line", x='Time1', y='Depth1', color= "Red", ax= ax)
    
    dataset.plot(kind= "line", x='Time2', y='Depth2', color= "Blue", ax= ax)
    
    # Show plot
    plt.show()
    

     

    Here is the result.

     

     

    Regards,

    Nono Chen

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.