diff --git a/AdvDataPlot.py b/AdvDataPlot.py
index 97b3c3717ae09ac483d35d7a3fbc226b6bdd94f7..34018338a6a5b263a0697515117cafb7fdf0c55c 100644
--- a/AdvDataPlot.py
+++ b/AdvDataPlot.py
@@ -53,7 +53,7 @@ class MainWindow (sg.Window):
     
     def def_file_browse(self, key:str):
         data_path = os.path.dirname(os.path.realpath(__file__)) + "/data"
-        self._input_data = sg.Input(default_text=data_path, key=f'-path_{key}-', size=(130, 1), font=("Consolas", 10))
+        self._input_data = sg.Input(default_text=data_path, key=f'-path_{key}-', size=(67, 1), font=("Consolas", 10), enable_events=True)
         self.import_xlsx =  sg.FileBrowse("Browse EXCEL",initial_folder=data_path, file_types=(('Excel Files', '*.xlsx'),), key=f'-browse_{key}-')
         self.open_xlsx = sg.Button("OPEN", key=f'-open_{key}-')
         return [self._input_data, self.import_xlsx, self.open_xlsx]
@@ -134,5 +134,8 @@ while True:
         window.update_do()
     if event == '-trace_selvar-':
         window.trace_selected_variables(1)
+    if 'path' in event:
+        window[event].Widget.xview_moveto(1)
+
     
 window.close()
\ No newline at end of file
diff --git a/main.py b/main.py
index 609bcf3357aba0546bf15631b3fefb8c51f2e9d1..896bd9d2fe0e21c7ae5793e382b6baafa70ef2fa 100644
--- a/main.py
+++ b/main.py
@@ -208,7 +208,8 @@ class MainProgram (MainWindow):
         """        
         try:
             self.dataframe = pd.read_excel(path)
-            self.dataframe['Sample_time_s'] = self.dataframe['Sample_time']/1000
+            self.data.update_layout_on_columns(self, self.dataframe.columns)
+            self.dataframe['Sample_time_s'] = self.dataframe['Sample']/1000 if 'TRACE' in path else self.dataframe['Sample_time']/1000
             sg.popup("Done")
             self.data.enable_plot_buttons(True)
         except Exception as e:
@@ -216,17 +217,12 @@ class MainProgram (MainWindow):
             self.data.enable_plot_buttons(False)
 
     def trace_selected_variables (self):
-        if(self.data._do_tq):
-            self.dataframe.plot(x="Sample_time_s",y=[f"Torque_A{i}" for i in range(1,7,1)], grid=True),plt.ylabel("Motor Torque (N.m)")
-        if(self.data._do_curr):
-            self.dataframe.plot(x="Sample_time_s",y=[f"Current_A{i}" for i in range(1,7,1)], grid=True),plt.ylabel("Motor Current (%)")
-        if(self.data._do_temp):
-            self.dataframe.plot(x="Sample_time_s",y=[f"Temperature_A{i}" for i in range(1,7,1)], grid=True),plt.ylabel("Motor Temperature (°K)")
-        if(self.data._do_posact):
-            self.dataframe.plot(x="Sample_time_s",y=[f"Position_Command_A{i}" for i in range(1,7,1)], grid=True),plt.ylabel("Robot command position in grid (mm))")
-        if(self.data._do_posreal):
-            self.dataframe.plot(x="Sample_time_s",y=[f"Position_A{i}" for i in range(1,7,1)], grid=True),plt.ylabel("Real Robot position in grid (mm))")
-        plt.pause(0.1) # Alternative to plt.show() that is not blocking
+        plt.close('all')
+        for i, var in enumerate(self.data._var_totrace):
+            if(self.data._do_trace_var[i]):
+                self.dataframe.plot(x="Sample_time_s",y=[f"{var}_A{i}" for i in range(1,7,1)], grid=True),plt.ylabel(f"Motor {var}")
+            plt.tight_layout()
+            plt.pause(0.1) # Alternative to plt.show() that is not blocking
 
     def trace_sampling (self):
         self.dataframe.plot(x="Sample_time_s",y=["Queue_Read", "Queue_Write"], grid=True),plt.ylabel("Samples")
@@ -272,7 +268,7 @@ class MainProgram (MainWindow):
             if event == '-doconst_speed-':
                 self.collection_settings.update_speed_entry()
 
-            if '-do_' in event:
+            if '-varplot_cbx' in event:
                 self.data.update_do()
 
             ## ---- Robot selector Events ---- ##
@@ -298,9 +294,12 @@ class MainProgram (MainWindow):
                 self.gripper_close()
 
             ## ---- Trace Events ---- ##
+            if 'path' in event:
+                self[event].Widget.xview_moveto(1)
 
-            if event == '-open_xlsx-':
-                self.open_xlsx(values['-data_path-'])
+            if '-open_data' in event :
+                nb = int(event.removeprefix("-open_data").removesuffix("-")) # get the identifier of the clicked button
+                self.open_xlsx(values[f'-path_data{nb}-'])
                 
             if event == '-trace_selvar-':
                 self.trace_selected_variables()
@@ -311,7 +310,6 @@ class MainProgram (MainWindow):
             if event == '-trace_latency-':
                 self.trace_latencies()
 
-
             ## ---- Other windows updates ---- ## 
 
             for i in range(len(self.window_latency)):
diff --git a/ui/ui_data.py b/ui/ui_data.py
index c1242bf3a158b1d6e5cdf53de77afe93ac384313..1279bb6be7910228fb7fa1e05d550d38816f5529 100644
--- a/ui/ui_data.py
+++ b/ui/ui_data.py
@@ -1,18 +1,16 @@
 import PySimpleGUI as sg
+import pandas as pd
 import os
 
 class UI_Data (sg.Frame):
     
     _disabled = False
     
-    _do_tq = True
-    _do_curr = True
-    _do_temp = True
-    _do_posact = False
-    _do_posreal = False
+    _var_totrace = []
+    _do_trace_var = []
     
     def __init__ (self):
-        """_summary_ : Class constructor
+        """ : Class constructor
         With __make_layout, generate a pysimplegui frame to be integrated in the main window for launching measuring sequence and data printing
         sg elements like checkbox and buttons are stored in the class to be accessed easily
         To print collection results from an excel file, select it with "Browse" and store it in python with "OPEN"
@@ -22,43 +20,38 @@ class UI_Data (sg.Frame):
         super().__init__("Collected Data", self.__make_layout(), expand_x=True)
 
     def __make_layout (self):
-        data_path = os.path.dirname(os.path.realpath(__file__)) + "/data"
         self._btn_start = sg.Button('START SEQUENCE', key='-BTN_start-', button_color='white', size=(15, 2),expand_x=True)
         
-        self._input_data = sg.Input(default_text=data_path, key='-data_path-', size=(40, 1), font=("Consolas", 10))
-        self.import_xlsx =  sg.FileBrowse("Browse EXCEL",initial_folder=data_path, file_types=(('Excel Files', '*.xlsx'),), key='-browse_xlsx-')
-        self.open_xlsx = sg.Button("OPEN", key='-open_xlsx-')
+        self.import_data = self.__make_file_browse('1')
         
         self.trace_selvariables = sg.Button('Trace Selected variables', key='-trace_selvar-', disabled=True, expand_x=True)
         self.trace_samples = sg.Button('Trace Sample collection history', key='-trace_sample-', disabled=True, expand_x=True)
         self.trace_latency = sg.Button('Trace Sample latency distribution', key='-trace_latency-', disabled=True, expand_x=True)
         
-        self.do_tq = sg.Checkbox('Motor torque', key='-do_tq-', size=(25, 1), enable_events=True,  default=True)
-        self.do_curr = sg.Checkbox('Motor current', key='-do_curr-', size=(25, 1), enable_events=True, default=True)
-        self.do_tptr = sg.Checkbox('Motor temperature', key='-do_tprt-', size=(25, 1),enable_events=True, default=True)
-        self.do_posact = sg.Checkbox('Robot command position', key='-do_posact-', size=(25, 1), enable_events=True, default=False)
-        self.do_posreal = sg.Checkbox('Robot measured position', key='-do_posreal-', size=(25, 1), enable_events=True, default=False)
+        self.var_checkbox = []
 
         self._layout = [
             [ self._btn_start ],
             [ sg.Frame("Quickview of the colelcted data in excel file :", border_width=0, expand_y=True, layout = [
                     [ sg.VPush() ],
-                    [ self._input_data, self.import_xlsx, self.open_xlsx ],
+                    [ self.import_data ],
                     [ self.trace_selvariables, self.trace_samples ],
                     [ self.trace_latency ],
                     [ sg.VPush() ]
                     ]),
-              sg.Frame("Variables to plot :", border_width=0, layout=[
-                    [self.do_tq],
-                    [self.do_curr],
-                    [self.do_tptr],
-                    [self.do_posact],
-                    [self.do_posreal]
-                    ]),
+              sg.Frame("Variables to plot :", layout=[ [sg.Col(layout=[], key='-col_var_to_plot-')] ])
             ],
         ]
         return self._layout
     
+    def __make_file_browse(self, key:str):
+        data_path = os.getcwd() + "/data"
+        
+        self._input_data = sg.Input(default_text=data_path, key=f'-path_data{key}-', size=(50, 1), font=("Consolas", 10), enable_events=True)
+        self.import_xlsx =  sg.FileBrowse("Browse EXCEL",initial_folder=data_path, file_types=(('Excel Files', '*.xlsx'),), key=f'-browse_data{key}-')
+        self.open_xlsx = sg.Button("OPEN", key=f'-open_data{key}-')
+        return [self._input_data, self.import_xlsx, self.open_xlsx]
+    
     @property
     def disabled (self): # called when : print(disabled)
         return self._disabled
@@ -72,7 +65,7 @@ class UI_Data (sg.Frame):
         self._btn_start.update(disabled=v)
         
     def enable_plot_buttons(self, enable):
-        """_summary_
+        """
         Updates the state of the plot butons to prevent data plot if no data is already stored in python
         Args:
             enable (bool): True/False to enable/disable buttons
@@ -82,11 +75,39 @@ class UI_Data (sg.Frame):
         self.trace_latency.update(disabled=not(enable))
         
     def update_do (self):
-        """_summary_
-        Update the state of the variables do_XXX if a checkbox is clicked
         """
-        self._do_tq = bool(self.do_tq.get())
-        self._do_curr = bool(self.do_curr.get())
-        self._do_temp = bool(self.do_tptr.get())
-        self._do_posact = bool(self.do_posact.get())
-        self._do_posreal = bool(self.do_posreal.get())
\ No newline at end of file
+        Update the state of the variable _do_trace_var if a checkbox is clicked
+        """
+        for i, _ in enumerate(self._var_totrace):
+            self._do_trace_var[i] = bool(self.var_checkbox[i].get())
+        
+    def update_layout_on_columns(self, win: sg.Window, columns):
+        """
+        Updates the window's layout to display new checkboxes
+        in order to plot or not the variables from a dataframe
+        Args:
+            win (sg.Window): window to modify the layout
+            columns (list): columns of the dataframe
+        Stored in class variable:
+            list: list of the collected variables on one robot axis
+        """
+        for i, _ in enumerate(self._var_totrace):   # reset before displaying
+            key = f'-varplot_line{i}-'
+            if key in win.key_dict:
+                win[key].Widget.destroy()
+                del win.AllKeysDict[key]
+                del win.AllKeysDict[f'-varplot_cbx{i}-']
+        win.read(100)        
+        self._var_totrace = []
+        self._do_trace_var = []
+        self.var_checkbox = []
+        i=0
+        for col in columns:
+            if '_A1' in col: # sorting the variables per axis
+                colname = col.rsplit('_A1', 1)[0] 
+                self._var_totrace.append(colname)
+                self.var_checkbox.append(sg.Checkbox('Motor ' + colname, enable_events=True, default=True, key=f'-varplot_cbx{i}-'))
+                win.extend_layout(win['-col_var_to_plot-'], [[sg.pin(sg.Col([[self.var_checkbox[i]]], key=f'-varplot_line{i}-', pad=(1,0.2)))]])
+                self._do_trace_var.append(True)
+                i+=1
+