function plotResultForTwoParameterScan(XParameter, YParameter, ZQuantity, varargin) p = inputParser; p.KeepUnmatched = true; addRequired(p, 'FirstParameterArray', @isvector) addRequired(p, 'SecondParameterArray', @isvector) addRequired(p, 'QuantityOfInterestArray', @ismatrix) addParameter(p, 'RescalingFactorForFirstParameter', 1, @isscalar) addParameter(p, 'XLabelString', 'X parameter', @ischar) addParameter(p, 'RescalingFactorForSecondParameter', 1, @isscalar) addParameter(p, 'YLabelString', 'Y parameter', @ischar) addParameter(p, 'RescalingFactorForQuantityOfInterest', 1, @isscalar) addParameter(p, 'ZLabelString', 'Z parameter', @ischar) addParameter(p, 'TitleString', 'Two-Parameter Scan', @ischar) p.parse(XParameter, YParameter, ZQuantity, varargin{:}) XParameter = p.Results.FirstParameterArray; RescalingFactorForXParameter = p.Results.RescalingFactorForFirstParameter; XLabelString = p.Results.XLabelString; YParameter = p.Results.SecondParameterArray; RescalingFactorForYParameter = p.Results.RescalingFactorForSecondParameter; YLabelString = p.Results.YLabelString; ZQuantity = p.Results.QuantityOfInterestArray; RescalingFactorForZQuantity = p.Results.RescalingFactorForQuantityOfInterest; ZLabelString = p.Results.ZLabelString; TitleString = p.Results.TitleString; f_h = Helper.getFigureByTag('Two-Parameter Scan'); set(groot,'CurrentFigure',f_h); a_h = get(f_h, 'CurrentAxes'); if ~isempty(get(a_h, 'Children')) clf(f_h); end f_h.Name = 'Two-Parameter Scan'; f_h.Units = 'pixels'; set(0,'units','pixels'); screensize = get(0,'ScreenSize'); f_h.Position = [[screensize(3)/3.5 screensize(4)/3.5] 750 600]; RescaledXParameter = XParameter .* RescalingFactorForXParameter; RescaledYParameter = YParameter .* RescalingFactorForYParameter; RescaledZQuantity = ZQuantity .* RescalingFactorForZQuantity; imagesc(RescaledXParameter, RescaledYParameter, RescaledZQuantity(:,:)'); set(gca,'YDir','normal'); caxis([min(min(min(RescaledZQuantity))) max(max(max(RescaledZQuantity)))]); hXLabel = xlabel(XLabelString); hYLabel = ylabel(YLabelString); shading flat; c = colorbar; c.Label.String= ZLabelString; c.Label.FontSize = 14; hTitle = sgtitle(TitleString); set([hXLabel, hYLabel] , ... 'FontSize' , 14 ); set( hTitle , ... 'FontSize' , 18 ); Helper.bringFiguresWithTagInForeground(); end