From c66997bc2abf7b0136390e93ec6ff6756f945d77 Mon Sep 17 00:00:00 2001
From: giuliaghirardini <giulia.ghirardini@skywarder.eu>
Date: Thu, 27 Mar 2025 18:24:14 +0100
Subject: [PATCH] [fixes] Fixed a bug

---
 .../mainExportStandardizedFigure.m            | 30 +++++--------------
 1 file changed, 7 insertions(+), 23 deletions(-)

diff --git a/functions/utilities/exportStandardizedFigure/mainExportStandardizedFigure.m b/functions/utilities/exportStandardizedFigure/mainExportStandardizedFigure.m
index 2645b10..f437219 100644
--- a/functions/utilities/exportStandardizedFigure/mainExportStandardizedFigure.m
+++ b/functions/utilities/exportStandardizedFigure/mainExportStandardizedFigure.m
@@ -489,10 +489,10 @@ allDefaultButton = uibutton(fig, 'Text', 'Reset All', ...
         % Cache figure to reset easily
         selectedIdx = figSelectionDropDown.Value;
         figToExp = figHandles(strcmp(figSelectionDropDown.Items, selectedIdx));
-
-        currentPath = mfilename('fullpath');
-        cachePath = fullfile(currentPath, '..','cachedFigs', selectedIdx);
-        savefig(figToExp, cachePath);
+        % 
+        % currentPath = mfilename('fullpath');
+        % cachePath = fullfile(currentPath, '..','cachedFigs', selectedIdx);
+        % savefig(figToExp, cachePath);
 
         % Try to export figure
         try
@@ -556,29 +556,13 @@ allDefaultButton = uibutton(fig, 'Text', 'Reset All', ...
     end
 
     function saveTemporaryFigure()
-        % Force to save fig
-        exportPDFBox.Value = false;
-        exportFIGBox.Value= true;
-
         % retrieve local path to save temp fig in temp folder
-        tempPath = [pwd '\temp'];
+        filepath = fileparts(mfilename('fullpath'));
+        tempPath = [filepath '\temp'];
         if ~isfolder(tempPath)
-            error('Not such a directory');
+            mkdir(tempPath);
         end
 
-        % Get values from the GUI components
-        exportPDF = false;
-        addMarkers = false;
-        exportFIG = true;
-        changeColors = false;
-        percTextwidth = percTextField.Value;
-        overwriteFigure = true;
-
-        % Call the exportStandardizedFigure function
-        % selectedIdx = figSelectionDropDown.Value;
-        % figToExp = figHandles(strcmp(figSelectionDropDown.Items, selectedIdx));
-        % name = getFigureNames(figToExp);
-
         figToExp = findFigures(fig);
         names = getFigureNames(figToExp);
 
-- 
GitLab