@@ -76,14 +76,17 @@ function updateLineseries(obj,plotIndex)
76
76
% -------------------------------------------------------------------------%
77
77
78
78
% -if polar plot or not-%
79
- treatas = obj .PlotOptions .TreatAs ;
80
- ispolar = ismember(' compass' , lower(treatas )) || ismember(' ezpolar' , lower(treatas ));
79
+ treatAs = obj .PlotOptions .TreatAs ;
80
+ ispolar = ismember(' compass' , lower(treatAs )) || ismember(' ezpolar' , lower(treatAs ));
81
81
82
82
% -------------------------------------------------------------------------%
83
83
84
84
% -getting data-%
85
- x = plotData .XData ;
86
- y = plotData .YData ;
85
+ xData = plotData .XData ;
86
+ yData = plotData .YData ;
87
+
88
+ if isduration(xData ), xData = datenum(xData ); end
89
+ if isduration(yData ), yData = datenum(yData ); end
87
90
88
91
% -------------------------------------------------------------------------%
89
92
@@ -114,20 +117,20 @@ function updateLineseries(obj,plotIndex)
114
117
% -scatter x-%
115
118
116
119
if ispolar
117
- r = sqrt(x .^ 2 + y .^ 2 );
118
- obj.data{plotIndex }.r = r ;
120
+ rData = sqrt(x .^ 2 + y .^ 2 );
121
+ obj.data{plotIndex }.r = rData ;
119
122
else
120
- obj.data{plotIndex }.x = x ;
123
+ obj.data{plotIndex }.x = xData ;
121
124
end
122
125
123
126
% -------------------------------------------------------------------------%
124
127
125
128
% -scatter y-%
126
129
if ispolar
127
- theta = atan2(x , y );
128
- obj.data{plotIndex }.theta = -(rad2deg(theta ) - 90 );
130
+ thetaData = atan2(xData , yData );
131
+ obj.data{plotIndex }.theta = -(rad2deg(thetaData ) - 90 );
129
132
else
130
- obj.data{plotIndex }.y = plotData . YData ;
133
+ obj.data{plotIndex }.y = yData ;
131
134
end
132
135
133
136
% -------------------------------------------------------------------------%
@@ -190,12 +193,12 @@ function updateLineseries(obj,plotIndex)
190
193
191
194
switch legInfo .IconDisplayStyle
192
195
case ' on'
193
- showleg = true ;
196
+ showLeg = true ;
194
197
case ' off'
195
- showleg = false ;
198
+ showLeg = false ;
196
199
end
197
200
198
- obj.data{plotIndex }.showlegend = showleg ;
201
+ obj.data{plotIndex }.showlegend = showLeg ;
199
202
200
203
% -------------------------------------------------------------------------%
201
204
0 commit comments