Skip to content

Commit ed612c0

Browse files
committed
fix(eventplotter/plotdqdt): Fix eventplotter error that plotted Q in each subplot.
Add isodd check to ensure each manual pick in plotdqdt has one start and one end. Add octave compatibility to plotdqdt. Replace call to arrow with annotation in plotdqdt. Add normalizeDataCoordinates function to compute arrow coordinates. Use this to eventually replace all calls to arrow. Add varargout to plotrefline and pointcloudplot to suppress output. Replace manual warning offs with withwarnoff.
1 parent f426150 commit ed612c0

10 files changed

+394
-159
lines changed

toolbox/+baseflow/eventplotter.m

+14-3
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,18 @@
111111
% plot all values
112112
allidx = struct2vec(Info, plotfields);
113113
allidx = min(allidx):1:max(allidx);
114-
115-
h1.alldata = scatter(h.ax(m), T(allidx), Q(allidx), 3*sz, ...
116-
[0.5 0.5 0.5], 'filled');
114+
115+
switch m
116+
case 1 % Q
117+
h1.alldata = scatter(h.ax(m), T(allidx), Q(allidx), 3*sz, ...
118+
[0.5 0.5 0.5], 'filled');
119+
case 2 % dQ/dt
120+
h2.alldata = scatter(h.ax(m), T(allidx), dqdt(allidx), 3*sz, ...
121+
[0.5 0.5 0.5], 'filled');
122+
case 3 % d2Q/dt2
123+
h3.alldata = scatter(h.ax(m), T(allidx), d2qdt(allidx), 3*sz, ...
124+
[0.5 0.5 0.5], 'filled');
125+
end
117126

118127
for n = 1:numel(plotfields)
119128

@@ -145,6 +154,8 @@
145154
legend(['all data', plotfields], 'AutoUpdate', 'off', 'Orientation', ...
146155
'horizontal', 'Location', 'ne', 'FontSize', 10);
147156
set(gca,'FontSize',10)
157+
158+
datetick;
148159
end
149160

150161
% add labels

toolbox/+baseflow/fitevents.m

+10-18
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,17 @@
7575
% manage warnings
7676
if isoctave
7777
%warning('off','Octave:invalid-fun-call');
78-
warning('off','Octave:nearly-singular-matrix');
78+
withwarnoff({ ...
79+
'Octave:nearly-singular-matrix'} ...
80+
);
7981
else
80-
warning('off','MATLAB:rankDeficientMatrix');
81-
warning('off','stats:nlinfit:IterationLimitExceeded');
82-
warning('off','stats:nlinfit:ModelConstantWRTParam');
83-
warning('off','stats:nlinfit:IllConditionedJacobian');
84-
warning('off','baseflow:deps:rsquare:NegativeRsquared');
82+
withwarnoff({ ...
83+
'MATLAB:rankDeficientMatrix', ...
84+
'stats:nlinfit:IterationLimitExceeded', ...
85+
'stats:nlinfit:ModelConstantWRTParam', ...
86+
'stats:nlinfit:IllConditionedJacobian', ...
87+
'baseflow:deps:rsquare:NegativeRsquared'} ...
88+
);
8589
end
8690

8791
debugflag = false;
@@ -142,18 +146,6 @@
142146
for n = 1:numel(vars)
143147
Results.(vars{n}) = Results.(vars{n})(ikeep);
144148
end
145-
146-
147-
% TURN WARNINGS BACK ON
148-
if isoctave
149-
warning('on','Octave:nearly-singular-matrix');
150-
else
151-
warning('on','MATLAB:rankDeficientMatrix');
152-
warning('on','stats:nlinfit:IterationLimitExceeded');
153-
warning('on','stats:nlinfit:ModelConstantWRTParam');
154-
warning('on','stats:nlinfit:IllConditionedJacobian');
155-
warning('on','baseflow:deps:rsquare:NegativeRsquared');
156-
end
157149
end
158150

159151
% PREP FITS

0 commit comments

Comments
 (0)