diff --git a/plotly/plotlyfig_aux/handlegraphics/updateQuiver.m b/plotly/plotlyfig_aux/handlegraphics/updateQuiver.m index 44556851..57524ede 100644 --- a/plotly/plotlyfig_aux/handlegraphics/updateQuiver.m +++ b/plotly/plotlyfig_aux/handlegraphics/updateQuiver.m @@ -51,6 +51,8 @@ col = 255*quiver_data.Color; obj.data{quiverIndex}.line.color = ['rgb(' num2str(col(1)) ',' num2str(col(2)) ',' num2str(col(3)) ')']; +%------------------------------------------------------------------------% + %-quiver line width-% obj.data{quiverIndex}.line.width = 2 * quiver_data.LineWidth; @@ -115,6 +117,32 @@ m = m + 3; end +%------------------------------------------------------------------------% + +%-quiver z-% + +% check for 3D plot +flag3d = ~isempty(quiver_data.ZData); + +if flag3d + + %-format data-% + zdata = quiver_data.ZData(:); + wdata = quiver_data.WData(:)*scalefactor; + + %-set 3d data-% + m = 1; + for n = 1:length(ydata) + obj.data{quiverIndex}.z(m) = zdata(n); + obj.data{quiverIndex}.z(m+1) = zdata(n) + wdata(n); + obj.data{quiverIndex}.z(m+2) = nan; + m = m + 3; + end + + %-scatter 3d type-% + obj.data{quiverIndex}.type = 'scatter3d'; +end + %-------------------------------------------------------------------------% %-quiver barbs-% @@ -154,6 +182,10 @@ for col = 1:4 obj.data{quiverIndex}.x(end+1) = barb(1,col); % point 1 obj.data{quiverIndex}.y(end+1) = barb(2,col); + + if flag3d + obj.data{quiverIndex}.z(end+1) = zdata(n); + end end end end