diff --git a/src/classes/@Result/plotperf.m b/src/classes/@Result/plotperf.m index 90c312c3bb870375763e3579620ac69907871879..0749dbee49d65704cdbe7b39c15d5183b84753b4 100644 --- a/src/classes/@Result/plotperf.m +++ b/src/classes/@Result/plotperf.m @@ -48,9 +48,13 @@ function plotperf(self, varargin) DEF.base_oper = self.operPts.Properties.VariableNames; DEF.allowed_oper = [DEF.base_oper, 'advRat']; % Also allows advance ratio DEF.ALLOWED_SOLVERS = {'leishman', 'indfact', 'indvel', 'stahlhut'}; + DEF.LEISHMAN_LINE = {'LineStyle', '-', 'color', 'red'}; + DEF.INDFACT_LINE = {'LineStyle', ':', 'color', 'magenta'}; + DEF.INDVEL_LINE = {'LineStyle', '--', 'color', 'blue'}; + DEF.STAHLHUT_LINE = {'LineStyle', '-.', 'color', 'green'}; % Parse inputs - [perf, oper, solvers, operPt, newFig] = parseinputs(DEF, varargin{:}); + [perf, oper, solvers, operPt, newFig, lineSpec] = parseinputs(DEF, varargin{:}); % Plot the figure if newFig @@ -61,7 +65,6 @@ function plotperf(self, varargin) for iSolv = 1:length(solvers) thissolv = solvers{iSolv}; - if ~isempty(self.(thissolv)) if strcmpi(oper, 'advRat') operVect = vectorize(filtered.(thissolv), 'advanceRatio'); @@ -70,14 +73,14 @@ function plotperf(self, varargin) end dataVect = vectorize(filtered.(thissolv), perf); - plot(operVect, dataVect, 'DisplayName', solvers{iSolv}); + plot(operVect, dataVect, lineSpec.(thissolv){:}, 'DisplayName', thissolv); hold on; end end end -function [perf, oper, solvers, operPt, newFig] = parseinputs(DEF, varargin) +function [perf, oper, solvers, operPt, newFig, lineSpec] = parseinputs(DEF, varargin) % PARSEINPUTS Parse the varargin inputs % - Only the parameter corresponding to oper can be nan, all others need to be defined @@ -93,6 +96,10 @@ function [perf, oper, solvers, operPt, newFig] = parseinputs(DEF, varargin) addRequired(p, 'collective', valData); addParameter(p, 'solvers', DEF.ALLOWED_SOLVERS); addParameter(p, 'newFig', false, valLogi); + addParameter(p, 'leishmanLine', DEF.LEISHMAN_LINE); + addParameter(p, 'indfactLine', DEF.INDFACT_LINE); + addParameter(p, 'indvelLine', DEF.INDVEL_LINE); + addParameter(p, 'stahlhutLine', DEF.STAHLHUT_LINE); parse(p, varargin{:}); perf = p.Results.perf; @@ -110,6 +117,12 @@ function [perf, oper, solvers, operPt, newFig] = parseinputs(DEF, varargin) operPt.(p.Results.oper) = NaN; end newFig = p.Results.newFig; + + lineSpec.leishman = p.Results.leishmanLine; + lineSpec.indfact = p.Results.indfactLine; + lineSpec.indvel = p.Results.indvelLine; + lineSpec.stahlhut = p.Results.stahlhutLine; + end function vect = vectorize(struct, prop)