Skip to content

Commit 90a0899

Browse files
fix issue #254. quiver3 matlab function activated
1 parent f2a128f commit 90a0899

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

plotly/plotlyfig_aux/handlegraphics/updateQuiver.m

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,32 @@
115115
m = m + 3;
116116
end
117117

118+
%------------------------------------------------------------------------%
119+
120+
%-quiver z-%
121+
122+
% check for 3D plot
123+
flag3d = ~isempty(quiver_data.ZData);
124+
125+
if flag3d
126+
127+
%-format data-%
128+
zdata = quiver_data.ZData(:);
129+
wdata = quiver_data.WData(:)*scalefactor;
130+
131+
%-set 3d data-%
132+
m = 1;
133+
for n = 1:length(ydata)
134+
obj.data{quiverIndex}.z(m) = zdata(n);
135+
obj.data{quiverIndex}.z(m+1) = zdata(n) + wdata(n);
136+
obj.data{quiverIndex}.z(m+2) = nan;
137+
m = m + 3;
138+
end
139+
140+
%-scatter 3d type-%
141+
obj.data{quiverIndex}.type = 'scatter3d';
142+
end
143+
118144
%-------------------------------------------------------------------------%
119145

120146
%-quiver barbs-%
@@ -154,6 +180,10 @@
154180
for col = 1:4
155181
obj.data{quiverIndex}.x(end+1) = barb(1,col); % point 1
156182
obj.data{quiverIndex}.y(end+1) = barb(2,col);
183+
184+
if flag3d
185+
obj.data{quiverIndex}.z(end+1) = zdata(n);
186+
end
157187
end
158188
end
159189
end

0 commit comments

Comments
 (0)