From c3646a318bb666e4dfdda42682bac2201b969973 Mon Sep 17 00:00:00 2001 From: giuliaghirardini <giulia.ghirardini@skywarder.eu> Date: Tue, 25 Feb 2025 15:29:35 +0100 Subject: [PATCH] [fixes][utilities] Update default satellite color setting and improved readability --- functions/utilities/exportFigureGUI.m | 34 +++++++++++++-------------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/functions/utilities/exportFigureGUI.m b/functions/utilities/exportFigureGUI.m index f0ef540..27b1d13 100644 --- a/functions/utilities/exportFigureGUI.m +++ b/functions/utilities/exportFigureGUI.m @@ -192,12 +192,11 @@ previewButton = uibutton(fig, 'Text', 'Update preview', ... for i = 1:length(figHandles) if strcmp(figSelectionDropDown.Items{i}, selectedIdx) selectedFig = figHandles(i); - - % Move from background to foreground current figure - uistack(selectedFig,'top') break; end end + % Move from background to foreground current figure + uistack(selectedFig,'top') updateDropdown(); if isempty(selectedFig) && isscalar(figHandles), selectedFig = figHandles(1); end @@ -209,18 +208,14 @@ previewButton = uibutton(fig, 'Text', 'Update preview', ... % Copy the axes informations check = size(obj.Children); if check(1) == 1 - if satelliteMapColorsBox.Value - satelliteMapColorsBox.Value = false; - end + if satelliteMapColorsBox.Value, satelliteMapColorsBox.Value = false; end newAx = obj.Children; hold(newAx, 'on'); end if check(1) == 2 % geoplots or 3d plots or tabfigures if isa(obj.Children(1), 'matlab.ui.container.TabGroup') - if satelliteMapColorsBox.Value - satelliteMapColorsBox.Value = false; - end + if satelliteMapColorsBox.Value, satelliteMapColorsBox.Value = false; end numTabs = numel(obj.Children(1).Children); % Get number of tabs originalFigNum = obj.Number; % Get the original figure number @@ -238,6 +233,8 @@ previewButton = uibutton(fig, 'Text', 'Update preview', ... else if strcmp(obj.Children(2).Type, 'geoaxes') satelliteMapColorsBox.Value = true; + else + satelliteMapColorsBox.Value = false; end newAx = obj.Children(2); hold(newAx, 'on'); @@ -245,15 +242,13 @@ previewButton = uibutton(fig, 'Text', 'Update preview', ... end if check(1) > 2 if isa(obj.Children(1), 'matlab.graphics.illustration.Legend') - if satelliteMapColorsBox.Value - satelliteMapColorsBox.Value = false; - end + if satelliteMapColorsBox.Value, satelliteMapColorsBox.Value = false; end + newAx = obj.Children(2:end); hold(newAx(1:check(1)-1), 'on'); else - if satelliteMapColorsBox.Value - satelliteMapColorsBox.Value = false; - end + if satelliteMapColorsBox.Value, satelliteMapColorsBox.Value = false; end + newAx = obj.Children; hold(newAx, 'on'); end @@ -269,9 +264,9 @@ previewButton = uibutton(fig, 'Text', 'Update preview', ... % end if changeColorsBox.Value, set(newAx, 'ColorOrder', lines(7)); end - grid(newAx, 'on' * gridBox.Value + 'off' * ~gridBox.Value); if changeLineStyleBox.Value, set(linesInPlot, 'LineStyle', '--'); end if satelliteMapColorsBox.Value, colormap(newAx, 'parula'); end + if WHratioField.Value > 0, daspect(newAx, [1 WHratioField.Value 1]); end if changeLineStyleBox.Value for line = linesInPlot' @@ -279,8 +274,11 @@ previewButton = uibutton(fig, 'Text', 'Update preview', ... end end - if satelliteMapColorsBox.Value, colormap(newAx, 'parula'); end - if WHratioField.Value > 0, daspect(newAx, [1 WHratioField.Value 1]); end + if gridBox.Value + grid(newAx, 'on'); + else + grid(newAx, 'off'); + end % Ensure preview updates on checkbox change addMarkersBox.ValueChangedFcn = @(src, event) updatePreview(); -- GitLab