Skip to content

Issue263 fixed #341

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 17, 2021
Merged
Changes from 1 commit
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
Prev Previous commit
fix issue #263
  • Loading branch information
galvisgilberto committed Aug 14, 2021
commit a6a8ca1c6220091c90938e7b67cc324cbe2984ab
37 changes: 27 additions & 10 deletions plotly/plotlyfig_aux/handlegraphics/updatePColor.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,28 @@

%-------------------------------------------------------------------------%

%-handle vertices-%
xdata = []; ydata = []; zdata = []; cdata = [];

for n = 1:size(pcolor_data.XData, 2)-1
for m = 1:size(pcolor_data.XData, 1)-1
xdata = [xdata pcolor_data.XData(m:m+1, n:n+1) NaN(2,1)];
ydata = [ydata pcolor_data.YData(m:m+1, n:n+1) NaN(2,1)];
zdata = [zdata pcolor_data.ZData(m:m+1, n:n+1) NaN(2,1)];
cdata = [cdata ones(2,3)*pcolor_data.CData(m, n)];
%-format data-%
XData = pcolor_data.XData;
YData = pcolor_data.YData;
ZData = pcolor_data.ZData;
CData = pcolor_data.CData;

xdata = zeros(size(XData, 1)-1*2, size(XData, 2)-1*2);
ydata = zeros(size(XData, 1)-1*2, size(XData, 2)-1*2);
zdata = zeros(size(XData, 1)-1*2, size(XData, 2)-1*2);
cdata = zeros(size(XData, 1)-1*2, size(XData, 2)-1*2);

for n = 1:size(XData, 2)-1
for m = 1:size(XData, 1)-1

% get indices
n1 = 2*(n-1)+1; m1 = 2*(m-1)+1;

% get surface mesh
xdata(m1:m1+1,n1:n1+1) = XData(m:m+1, n:n+1);
ydata(m1:m1+1,n1:n1+1) = YData(m:m+1, n:n+1);
zdata(m1:m1+1,n1:n1+1) = ZData(m:m+1, n:n+1);
cdata(m1:m1+1,n1:n1+1) = ones(2,2)*CData(m, n);
end
end

Expand All @@ -60,7 +73,7 @@

%-------------------------------------------------------------------------%

%-colorscale to map-%
%-coloring-%
cmap = figure_data.Colormap;
len = length(cmap)-1;

Expand All @@ -71,6 +84,8 @@

obj.data{patchIndex}.surfacecolor = cdata;
obj.data{patchIndex}.showscale = false;
obj.data{patchIndex}.cmin = min(CData(:));
obj.data{patchIndex}.cmax = max(CData(:));

%-------------------------------------------------------------------------%

Expand All @@ -92,13 +107,15 @@
obj.layout.scene.xaxis.showticklabels = true;
obj.layout.scene.xaxis.zeroline = false;
obj.layout.scene.xaxis.showgrid = false;
obj.layout.scene.xaxis.title = '';

%-------------------------------------------------------------------------%

%-hide axis-y-%
obj.layout.scene.yaxis.zeroline = false;
obj.layout.scene.yaxis.showgrid = false;
obj.layout.scene.yaxis.showticklabels = true;
obj.layout.scene.yaxis.title = '';

%-------------------------------------------------------------------------%

Expand Down