From 90a0899caa1d8fcd7503e53a792a32f514d6beda Mon Sep 17 00:00:00 2001 From: Gilberto Galvis Date: Fri, 13 Aug 2021 11:58:42 -0400 Subject: [PATCH 1/2] fix issue #254. quiver3 matlab function activated --- .../handlegraphics/updateQuiver.m | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/plotly/plotlyfig_aux/handlegraphics/updateQuiver.m b/plotly/plotlyfig_aux/handlegraphics/updateQuiver.m index 08103f74..c2bb7239 100644 --- a/plotly/plotlyfig_aux/handlegraphics/updateQuiver.m +++ b/plotly/plotlyfig_aux/handlegraphics/updateQuiver.m @@ -115,6 +115,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 +180,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 From d0398ab12048618fd99caf3df3141779091f4ce9 Mon Sep 17 00:00:00 2001 From: Gilberto Galvis Date: Fri, 13 Aug 2021 12:14:07 -0400 Subject: [PATCH 2/2] fix issue #254. matlab linewidth by 2 --- plotly/plotlyfig_aux/handlegraphics/updateQuiver.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plotly/plotlyfig_aux/handlegraphics/updateQuiver.m b/plotly/plotlyfig_aux/handlegraphics/updateQuiver.m index c2bb7239..57524ede 100644 --- a/plotly/plotlyfig_aux/handlegraphics/updateQuiver.m +++ b/plotly/plotlyfig_aux/handlegraphics/updateQuiver.m @@ -51,8 +51,10 @@ col = 255*quiver_data.Color; obj.data{quiverIndex}.line.color = ['rgb(' num2str(col(1)) ',' num2str(col(2)) ',' num2str(col(3)) ')']; -%-quiver line color-% -obj.data{quiverIndex}.line.width = quiver_data.LineWidth; +%------------------------------------------------------------------------% + +%-quiver line width-% +obj.data{quiverIndex}.line.width = 2 * quiver_data.LineWidth; %------------------------------------------------------------------------%