Skip to content

Issue254 #338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions plotly/plotlyfig_aux/handlegraphics/updateQuiver.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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-%
Expand Down Expand Up @@ -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
Expand Down