Skip to content

Issue204 fixed heatmap #345

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 10 commits into from
Aug 17, 2021
Merged
Prev Previous commit
Next Next commit
fix issue #264
  • Loading branch information
galvisgilberto committed Aug 14, 2021
commit 454aeca476d4d90fd045d2bc5eec8b99bf5e52d8
39 changes: 35 additions & 4 deletions plotly/plotlyfig_aux/handlegraphics/updatePColor.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,18 @@
YData = pcolor_data.YData;
ZData = pcolor_data.ZData;
CData = pcolor_data.CData;
usegrid = false;

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);
if isvector(XData)
usegrid = true;
[XData, YData] = meshgrid(XData, YData);
end

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

for n = 1:size(XData, 2)-1
for m = 1:size(XData, 1)-1
Expand Down Expand Up @@ -89,6 +96,30 @@

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

%-setting grid mesh-%
if usegrid
% x-direction
xmin = min(XData(:));
xmax = max(XData(:));
xsize = (xmax - xmin) / (size(XData, 2) - 1);
obj.data{patchIndex}.contours.x.start = xmin;
obj.data{patchIndex}.contours.x.end = xmax;
obj.data{patchIndex}.contours.x.size = xsize;
obj.data{patchIndex}.contours.x.show = true;
obj.data{patchIndex}.contours.x.color = 'black';
% y-direction
ymin = min(YData(:));
ymax = max(YData(:));
ysize = (ymax - ymin) / (size(YData, 2)-1);
obj.data{patchIndex}.contours.y.start = ymin;
obj.data{patchIndex}.contours.y.end = ymax;
obj.data{patchIndex}.contours.y.size = ysize;
obj.data{patchIndex}.contours.y.show = true;
obj.data{patchIndex}.contours.y.color = 'black';
end

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

%-aspectratio-%
obj.layout.scene.aspectratio.x = 12;
obj.layout.scene.aspectratio.y = 10;
Expand Down